From e5c89ac69662cebb6aba852b8f66c897cdb86c83 Mon Sep 17 00:00:00 2001 From: Quoc-Tuan Truong <tuantq.vnu@gmail.com> Date: Fri, 21 Dec 2018 01:02:53 +0800 Subject: [PATCH] Alpha-1 Release --- LICENSE.md => LICENSE | 0 MANIFEST.in | 5 ++ README.md | 2 +- setup.cfg | 2 + setup.py | 110 ++++++++++++++++++++++++------------------ 5 files changed, 72 insertions(+), 47 deletions(-) rename LICENSE.md => LICENSE (100%) create mode 100644 MANIFEST.in create mode 100644 setup.cfg diff --git a/LICENSE.md b/LICENSE similarity index 100% rename from LICENSE.md rename to LICENSE diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..728c87ea --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +include LICENSE +snclude README.md +recursive-include doc * +recursive-include examples * +recursive-include surprise *.c *.cpp *.pyx diff --git a/README.md b/README.md index 6fce682c..7bbb0ae0 100644 --- a/README.md +++ b/README.md @@ -90,4 +90,4 @@ Then, run the appropriate Cornac install command according to your platform. ## License -[Apache License 2.0](LICENSE.md) +[Apache License 2.0](LICENSE) diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..b88034e4 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[metadata] +description-file = README.md diff --git a/setup.py b/setup.py index 4747b711..0500037d 100644 --- a/setup.py +++ b/setup.py @@ -1,71 +1,89 @@ - import setuptools import os - try: from Cython.Build import cythonize except ImportError: use_cython = False else: - use_cython = True - - -with open("README.md", "r") as fh: + use_cython = True + +with open('README.md', 'r') as fh: long_description = fh.read() - - -#cython c++ modules + +# cython c++ modules external_modules = [] if use_cython: - ext_c2pf = setuptools.Extension("c2pf", - sources=["./cornac/models/c2pf/cython/c2pf.pyx", "./cornac/models/c2pf/cpp/cpp_c2pf.cpp"], - libraries=[], - include_dirs=['./cornac/models/c2pf/cpp/','./cornac/utils/external/eigen/Eigen','./cornac/utils/external/eigen/unsupported/Eigen/'], - language="c++" ) - external_modules += cythonize(ext_c2pf) - # - ext_pmf = './cornac/models/pmf/cython/pmf.pyx' - external_modules += cythonize(ext_pmf) - - - + ext_c2pf = setuptools.Extension('c2pf', + sources=[ + 'cornac/models/c2pf/cython/c2pf.pyx', + 'cornac/models/c2pf/cpp/cpp_c2pf.cpp'], + libraries=[], + include_dirs=[ + 'cornac/models/c2pf/cpp/', + 'cornac/utils/external/eigen/Eigen', + 'cornac/utils/external/eigen/unsupported/Eigen/' + ], + language='c++') + external_modules += cythonize(ext_c2pf) + # + ext_pmf = 'cornac/models/pmf/cython/pmf.pyx' + external_modules += cythonize(ext_pmf) else: ext_c2pf = [setuptools.Extension('c2pf', - sources=['./cornac/models/c2pf/cython/c2pf.cpp', "./cornac/models/c2pf/cpp/cpp_c2pf.cpp"], - language='c++', - include_dirs=['./cornac/models/c2pf/cpp/','./cornac/utils/external/eigen/Eigen','./cornac/utils/external/eigen/unsupported/Eigen/'])] + sources=[ + 'cornac/models/c2pf/cython/c2pf.cpp', + 'cornac/models/c2pf/cpp/cpp_c2pf.cpp' + ], + language='c++', + include_dirs=[ + 'cornac/models/c2pf/cpp/', + 'cornac/utils/external/eigen/Eigen', + 'cornac/utils/external/eigen/unsupported/Eigen/' + ])] external_modules += ext_c2pf # ext_pmf = [setuptools.Extension('pmf', - ['./cornac/models/pmf/cython/pmf.c'])] + ['cornac/models/pmf/cython/pmf.c'])] external_modules += ext_pmf - - -#Handling PyTorch dependency + +# Handling PyTorch dependency if os.name == 'nt': - torch_dl = 'http://download.pytorch.org/whl/cpu/torch-0.4.1-cp36-cp36m-win_amd64.whl' + torch_dl = 'http://download.pytorch.org/whl/cpu/torch-0.4.1-cp36-cp36m-win_amd64.whl' elif os.name == 'posix': - torch_dl = 'http://download.pytorch.org/whl/cpu/torch-0.4.1-cp36-cp36m-linux_x86_64.whl' - - + torch_dl = 'http://download.pytorch.org/whl/cpu/torch-0.4.1-cp36-cp36m-linux_x86_64.whl' + setuptools.setup( - name="cornac", - version="0.1.0", - author="Aghiles Salah", - author_email="asalah@smu.edu.sg", - description="A collection of recommendation algorithms and comparisons", + name='cornac', + version='0.1.0.post1', + author='Aghiles Salah', + author_email='asalah@smu.edu.sg', + description='A collection of recommendation algorithms and comparisons', long_description=long_description, - long_description_content_type="text/markdown", - url="", + long_description_content_type='text/markdown', + url='https://cornac.preferred.ai/', + download_url='https://github.com/PreferredAI/cornac/archive/v0.1.0.tar.gz', + keywords=['recommender', 'recommendation', 'factorization', 'multimodal'], zip_safe=False, - ext_modules = external_modules, - install_requires=['numpy', 'scipy', 'pandas','tensorflow>=1.2.1','torch>=0.4.0'], - dependency_links = [torch_dl], + ext_modules=external_modules, + install_requires=[ + 'numpy', + 'scipy', + 'pandas', + 'tensorflow>=1.2.1', + 'torch>=0.4.0' + ], + dependency_links=[torch_dl], packages=setuptools.find_packages(), classifiers=( - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Science/Research', + 'Intended Audience :: Education', + 'Intended Audience :: Developers', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'License :: OSI Approved :: Apache Software License', + 'Topic :: Software Development', + 'Topic :: Scientific/Engineering', ), -) \ No newline at end of file +) -- GitLab