Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[patch:pkg] Remove requirements.py #182

Merged
merged 1 commit into from
Jan 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions requirements.py

This file was deleted.

61 changes: 60 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,72 @@
# -*- encoding: utf-8 -*-

from setuptools import setup, find_packages
from requirements import *

import platform
from pkg_resources import packaging

VERSION = '0.12.0'

with open('README.md', 'r', encoding='utf8') as fh:
long_description = fh.read()

pkg_versions = {
'Cython': '>=0.28.5',
'numpy': '>=1.17,<2',
'scipy': '>=1.3,<2',
'hmmlearn': '==0.2.4',
'dtaidistance[numpy]': '>=2.2,<2.3',
'scikit-learn': '>=0.22,<1',
'tqdm': '>=4.36,<5',
'joblib': '>=0.14,<1',
# [torch]
'torch': '>=1.8+cpu',
# [docs]
'sphinx': '==3.5.4',
'numpydoc': '',
'sphinx_rtd_theme': '',
'm2r2': '',
# [test]
'pytest': '==5.3.2',
# [notebooks]
'jupyter': '==1.0.0',
'requests': '==2.25.1',
'matplotlib': '==3.3.3',
'pandas': '==1.1.5',
'seaborn': '==0.11.1',
'torchaudio': '==0.8.0',
'torchvision': '==0.9.0',
'torchfsdd': '==0.1.2',
'librosa': '==0.8.0'
}

extra_pkgs = {
'torch': ['dev', 'torch', 'test', 'docs', 'notebooks'],
'pytest': ['dev', 'test'],
**{pkg:['dev', 'docs'] for pkg in ('sphinx', 'numpydoc', 'sphinx_rtd_theme', 'm2r2')},
**{pkg:['dev', 'notebooks'] for pkg in (
'jupyter', 'requests', 'matplotlib', 'pandas',
'seaborn', 'tqdm', 'torchaudio', 'torchvision',
'torchfsdd', 'librosa'
)},
}

def load_requires(*pkgs):
return [pkg + pkg_versions[pkg] for pkg in pkgs]

def reverse_extra(extra):
return [pkg + pkg_versions[pkg] for pkg, extras in extra_pkgs.items() if extra in extras]

python_requires = '>=3.6,<3.10'

setup_requires = load_requires('Cython', 'numpy', 'scipy')

install_requires = load_requires('numpy', 'hmmlearn', 'dtaidistance[numpy]', 'scipy', 'scikit-learn', 'tqdm', 'joblib')
if packaging.version.parse(platform.python_version()) < packaging.version.parse('3.8'):
install_requires.append('importlib_metadata') # Backports for importlib.metadata in Python <3.8

extras_require = {extra:reverse_extra(extra) for extra in ('torch', 'dev', 'test', 'notebooks', 'docs')}

setup(
name = 'sequentia',
version = VERSION,
Expand Down