|
| 1 | +from importlib.machinery import SourceFileLoader |
| 2 | +import io |
| 3 | +import os.path |
| 4 | + |
| 5 | +from setuptools import find_packages, setup |
| 6 | + |
| 7 | +sourcedml = SourceFileLoader("sourced-ml-core", "./sourced/ml/core/__init__.py").load_module() |
| 8 | + |
| 9 | +with io.open(os.path.join(os.path.dirname(__file__), "README.md"), encoding="utf-8") as f: |
| 10 | + long_description = f.read() |
| 11 | + |
| 12 | +tf_requires = ["tensorflow>=1.0,<2.0"] |
| 13 | +tf_gpu_requires = ["tensorflow-gpu>=1.0,<2.0"] |
| 14 | +exclude_packages = ( |
| 15 | + ("sourced.ml.core.tests", "sourced.ml.core.tests.source") |
| 16 | + if not os.getenv("ML_CORE_SETUP_INCLUDE_TESTS", False) |
| 17 | + else () |
| 18 | +) |
| 19 | + |
| 20 | + |
| 21 | +setup( |
| 22 | + name="sourced-ml-core", |
| 23 | + description="Library containing the core algorithms for machine learning on source code. " |
| 24 | + "Provides API and tools to train and use models based " |
| 25 | + "on source code features extracted from Babelfish's UASTs.", |
| 26 | + long_description=long_description, |
| 27 | + long_description_content_type="text/markdown", |
| 28 | + version=sourcedml.__version__, |
| 29 | + license="Apache 2.0", |
| 30 | + author="source{d}", |
| 31 | + author_email="machine-learning@sourced.tech", |
| 32 | + url="https://github.com/src-d/ml-core", |
| 33 | + download_url="https://github.com/src-d/ml-core", |
| 34 | + packages=find_packages(exclude=exclude_packages), |
| 35 | + keywords=[ |
| 36 | + "machine learning on source code", |
| 37 | + "word2vec", |
| 38 | + "id2vec", |
| 39 | + "github", |
| 40 | + "swivel", |
| 41 | + "bow", |
| 42 | + "bblfsh", |
| 43 | + "babelfish", |
| 44 | + ], |
| 45 | + install_requires=[ |
| 46 | + "PyStemmer>=1.3,<2.0", |
| 47 | + "bblfsh>=2.12.7,<3.0", |
| 48 | + "modelforge>=0.12.1,<0.13", |
| 49 | + "pygments>=2.2.0,<3.0", |
| 50 | + "keras>=2.0,<3.0", |
| 51 | + "scikit-learn>=0.19,<1.0", |
| 52 | + "tqdm>=4.20,<5.0", |
| 53 | + ], |
| 54 | + extras_require={"tf": tf_requires, "tf_gpu": tf_gpu_requires}, |
| 55 | + tests_require=["docker>=3.6.0,<4.0"], |
| 56 | + package_data={ |
| 57 | + "": ["LICENSE.md", "README.md"], |
| 58 | + "sourced.ml.core.tests": ["./asdf/*.asdf", "./swivel/*", "identifiers.csv.tar.gz"], |
| 59 | + }, |
| 60 | + python_requires=">=3.5", |
| 61 | + classifiers=[ |
| 62 | + "Development Status :: 3 - Alpha", |
| 63 | + "Environment :: Console", |
| 64 | + "Intended Audience :: Developers", |
| 65 | + "License :: OSI Approved :: Apache Software License", |
| 66 | + "Operating System :: POSIX", |
| 67 | + "Programming Language :: Python :: 3.5", |
| 68 | + "Programming Language :: Python :: 3.6", |
| 69 | + "Programming Language :: Python :: 3.7", |
| 70 | + "Topic :: Software Development :: Libraries", |
| 71 | + ], |
| 72 | +) |
0 commit comments