|
1 | 1 | import setuptools
|
| 2 | +from pkg_resources import parse_requirements as _parse_requirements |
2 | 3 |
|
3 | 4 |
|
4 |
| -# read the contents of the README.md file to get a long_description |
5 |
| -from os import path |
6 |
| -this_directory = path.abspath(path.dirname(__file__)) |
7 |
| -with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: |
8 |
| - readme = f.read() |
9 |
| - long_description = readme[:readme.find('## Contents')].strip() |
| 5 | +def get_long_description(): |
| 6 | + """Read the long_description from the README.md file""" |
| 7 | + with open('README.md') as f: |
| 8 | + readme = f.read() |
| 9 | + end = '<!-- End of long_description for setup.py -->' |
| 10 | + return readme[:readme.find(end)].strip() |
| 11 | + |
| 12 | + |
| 13 | +def parse_requirements(): |
| 14 | + """Parse the requirements.txt file""" |
| 15 | + with open('requirements.txt') as f: |
| 16 | + parsed_requirements = _parse_requirements(f) |
| 17 | + requirements = [str(ir) for ir in parsed_requirements] |
| 18 | + return requirements |
| 19 | + |
10 | 20 |
|
11 | 21 | setuptools.setup(
|
12 | 22 | name="dislib",
|
13 | 23 | version=open('VERSION').read().strip(),
|
14 | 24 | author="Barcelona Supercomputing Center",
|
15 | 25 |
|
16 | 26 | description="The distributed computing library on top of PyCOMPSs",
|
17 |
| - long_description=long_description, |
| 27 | + long_description=get_long_description(), |
18 | 28 | long_description_content_type='text/markdown',
|
19 | 29 | url="http://dislib.bsc.es",
|
20 | 30 | project_urls={
|
|
33 | 43 | "Topic :: Software Development :: Libraries :: Python Modules",
|
34 | 44 | "Topic :: System :: Distributed Computing",
|
35 | 45 | ],
|
36 |
| - install_requires=[ |
37 |
| - "scikit-learn", |
38 |
| - "numpy", |
39 |
| - "scipy", |
40 |
| - "cvxpy" |
41 |
| - ] |
| 46 | + install_requires=parse_requirements(), |
42 | 47 | )
|
0 commit comments