forked from jettify/pytorch-optimizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
94 lines (79 loc) · 2.34 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import os
import re
import sys
from setuptools import setup, find_packages
install_requires = ['torch>=1.1.0', 'pytorch_ranger>=0.1.1']
PY35 = (3, 5, 0)
if sys.version_info < PY35:
raise RuntimeError('torch-optimizer requires Python 3.5.0+')
def _read(f):
with open(os.path.join(os.path.dirname(__file__), f)) as f_:
return f_.read().strip()
def _read_version():
regexp = re.compile(r"^__version__\W*=\W*'([\d.abrc]+)'")
init_py = os.path.join(
os.path.dirname(__file__), 'torch_optimizer', '__init__.py'
)
with open(init_py) as f:
for line in f:
match = regexp.match(line)
if match is not None:
return match.group(1)
raise RuntimeError(
'Cannot find version in torch_optimizer/__init__.py'
)
classifiers = [
'License :: OSI Approved :: Apache Software License',
'Intended Audience :: Developers',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Operating System :: OS Independent',
'Development Status :: 3 - Alpha',
]
keywords = [
'torch-optimizer',
'pytorch',
# optimizers
'accsgd',
'adabound',
'adamod',
'diffgrad',
'lamb',
'lookahead',
'novograd',
'pid',
'qhadam',
'qhm',
'radam',
'sgdw',
'yogi',
'ranger',
]
project_urls = {
'Website': 'https://github.com/jettify/pytorch-optimizer',
'Documentation': 'https://pytorch-optimizer.readthedocs.io',
'Issues': 'https://github.com/jettify/pytorch-optimizer/issues',
}
setup(
name='torch-optimizer',
version=_read_version(),
description=('pytorch-optimizer'),
long_description='\n\n'.join((_read('README.rst'), _read('CHANGES.rst'))),
long_description_content_type='text/x-rst',
classifiers=classifiers,
platforms=['POSIX'],
author='Nikolay Novik',
author_email='[email protected]',
url='https://github.com/jettify/pytorch-optimizer',
download_url='https://pypi.org/project/torch-optimizer/',
license='Apache 2',
packages=find_packages(),
install_requires=install_requires,
keywords=keywords,
zip_safe=True,
include_package_data=True,
project_urls=project_urls,
)