|
1 | 1 | from setuptools import setup, find_packages |
2 | 2 |
|
3 | 3 |
|
4 | | -try: # for pip >= 10 |
5 | | - from pip._internal.req import parse_requirements |
6 | | -except ImportError: # for pip <= 9.0.3 |
7 | | - from pip.req import parse_requirements |
| 4 | +def parse_requirements(filename): |
| 5 | + """ load requirements from a pip requirements file """ |
| 6 | + lineiter = (line.strip() for line in open(filename)) |
| 7 | + return [line for line in lineiter if line and not line.startswith("#")] |
8 | 8 |
|
9 | 9 |
|
10 | | -# parse_requirements() returns generator of pip.req.InstallRequirement objects |
11 | | -install_reqs = parse_requirements('requirements.txt', session='null') |
12 | | - |
13 | | - |
14 | | -# reqs is a list of requirement |
15 | | -# e.g. ['django==1.5.1', 'mezzanine==1.4.6'] |
16 | | -reqs = [str(ir.req) for ir in install_reqs] |
| 10 | +reqs = parse_requirements('requirements.txt') |
17 | 11 |
|
18 | 12 |
|
19 | 13 | with open('README.md') as f: |
20 | 14 | long_description = f.read() |
21 | 15 |
|
22 | 16 |
|
23 | 17 | setup(name='pytorch2keras', |
24 | | - version='0.2.3', |
25 | | - description='The deep learning models convertor', |
| 18 | + version='0.2.4', |
| 19 | + description='The deep learning models converter', |
26 | 20 | long_description=long_description, |
27 | 21 | long_description_content_type='text/markdown', |
28 | 22 | url='https://github.com/nerox8664/pytorch2keras', |
|
0 commit comments