|
| 1 | +#! /usr/bin/env python |
| 2 | +"""Install script for sktime""" |
| 3 | + |
| 4 | +from setuptools import find_packages |
| 5 | +from setuptools import setup |
| 6 | +import codecs |
| 7 | +import os |
| 8 | +import re |
| 9 | +import sys |
| 10 | +import platform |
| 11 | + |
| 12 | +try: |
| 13 | + import numpy as np |
| 14 | +except ModuleNotFoundError as e: |
| 15 | + raise ModuleNotFoundError("No module named 'numpy'. Please install " |
| 16 | + "numpy first using `pip install numpy`.") |
| 17 | +try: |
| 18 | + from Cython.Build import cythonize |
| 19 | +except ModuleNotFoundError as e: |
| 20 | + raise ModuleNotFoundError("No module named 'cython'. Please install " |
| 21 | + "cython first using `pip install cython`.") |
| 22 | + |
| 23 | +HERE = os.path.abspath(os.path.dirname(__file__)) |
| 24 | + |
| 25 | + |
| 26 | +def read(*parts): |
| 27 | + # intentionally *not* adding an encoding option to open, See: |
| 28 | + # https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690 |
| 29 | + with codecs.open(os.path.join(HERE, *parts), 'r') as fp: |
| 30 | + return fp.read() |
| 31 | + |
| 32 | + |
| 33 | +def find_version(*file_paths): |
| 34 | + version_file = read(*file_paths) |
| 35 | + version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M) |
| 36 | + if version_match: |
| 37 | + return version_match.group(1) |
| 38 | + else: |
| 39 | + raise RuntimeError("Unable to find version string.") |
| 40 | + |
| 41 | + |
| 42 | +# raise warning for Python versions prior to 3.6 |
| 43 | +if sys.version_info < (3, 6): |
| 44 | + raise RuntimeError("sktime requires Python 3.6 or later. The current" |
| 45 | + " Python version is %s installed in %s." |
| 46 | + % (platform.python_version(), sys.executable)) |
| 47 | + |
| 48 | + |
| 49 | +DISTNAME = 'sktime' |
| 50 | +DESCRIPTION = 'scikit-learn compatible toolbox for learning with time series/panel data' |
| 51 | +with codecs.open('README.rst', encoding='utf-8-sig') as f: |
| 52 | + LONG_DESCRIPTION = f.read() |
| 53 | +MAINTAINER = 'F. Király' |
| 54 | +MAINTAINER_EMAIL = '[email protected]' |
| 55 | +URL = 'https://github.com/alan-turing-institute/sktime' |
| 56 | +LICENSE = 'BSD-3-Clause' |
| 57 | +DOWNLOAD_URL = 'https://pypi.org/project/sktime/#files' |
| 58 | +PROJECT_URLS = { |
| 59 | + 'Issue Tracker': 'https://github.com/alan-turing-institute/sktime/issues', |
| 60 | + 'Documentation': 'https://alan-turing-institute.github.io/sktime/', |
| 61 | + 'Source Code': 'https://github.com/alan-turing-institute/sktime' |
| 62 | +} |
| 63 | +VERSION = find_version('sktime', '__init__.py') |
| 64 | +INSTALL_REQUIRES = ['numpy>=1.16.0', |
| 65 | + 'scipy>=1.2.0', |
| 66 | + 'scikit-learn>=0.21.0', |
| 67 | + 'pandas>=0.23.0', |
| 68 | + 'scikit-posthocs>=0.5.0', |
| 69 | + 'statsmodels>=0.9.0'] |
| 70 | +CLASSIFIERS = ['Intended Audience :: Science/Research', |
| 71 | + 'Intended Audience :: Developers', |
| 72 | + 'License :: OSI Approved', |
| 73 | + 'Programming Language :: Python', |
| 74 | + 'Topic :: Software Development', |
| 75 | + 'Topic :: Scientific/Engineering', |
| 76 | + 'Operating System :: Microsoft :: Windows', |
| 77 | + 'Operating System :: POSIX', |
| 78 | + 'Operating System :: Unix', |
| 79 | + 'Operating System :: MacOS', |
| 80 | + 'Programming Language :: Python :: 3.6', |
| 81 | + 'Programming Language :: Python :: 3.7'] |
| 82 | +EXTRAS_REQUIRE = { |
| 83 | + 'tests': [ |
| 84 | + 'pytest', |
| 85 | + 'pytest-cov'], |
| 86 | + 'docs': [ |
| 87 | + 'sphinx', |
| 88 | + 'sphinx-gallery', |
| 89 | + 'sphinx_rtd_theme', |
| 90 | + 'numpydoc', |
| 91 | + 'matplotlib' |
| 92 | + ] |
| 93 | +} |
| 94 | + |
| 95 | +setup(name=DISTNAME, |
| 96 | + maintainer=MAINTAINER, |
| 97 | + maintainer_email=MAINTAINER_EMAIL, |
| 98 | + description=DESCRIPTION, |
| 99 | + license=LICENSE, |
| 100 | + url=URL, |
| 101 | + version=VERSION, |
| 102 | + download_url=DOWNLOAD_URL, |
| 103 | + long_description=LONG_DESCRIPTION, |
| 104 | + zip_safe=False, # the package can run out of an .egg file |
| 105 | + classifiers=CLASSIFIERS, |
| 106 | + packages=find_packages(), |
| 107 | + include_package_data=True, |
| 108 | + install_requires=INSTALL_REQUIRES, |
| 109 | + extras_require=EXTRAS_REQUIRE, |
| 110 | + ext_modules=cythonize( |
| 111 | + ["sktime/distances/elastic_cython.pyx"], |
| 112 | + annotate=True), |
| 113 | + include_dirs=[np.get_include()] |
| 114 | + ) |
0 commit comments