|
1 | 1 | # -*- coding: utf-8 -*-
|
2 | 2 |
|
3 | 3 | import os
|
4 |
| -import setuptools |
| 4 | +from setuptools import find_packages |
5 | 5 |
|
6 | 6 | about = {}
|
7 | 7 | with open(os.path.join('ExtractTable', '__version__.py'), 'r') as f:
|
|
10 | 10 | with open('README.md', 'r') as f:
|
11 | 11 | readme = f.read()
|
12 | 12 |
|
| 13 | +with open("requirements.txt") as fh: |
| 14 | + requires = [x.strip() for x in fh.readlines()] |
13 | 15 |
|
14 |
| -setuptools.setup( |
| 16 | + |
| 17 | +def setup_package(): |
| 18 | + metadata = dict( |
15 | 19 | name=about['__title__'],
|
16 | 20 | version=about['__version__'],
|
17 | 21 | description=about['__description__'],
|
|
21 | 25 | author=about['__author__'],
|
22 | 26 | author_email=about['__author_email__'],
|
23 | 27 | license=about['__license__'],
|
24 |
| - packages=setuptools.find_packages(), |
25 |
| - install_requires=['requests>=2.21', 'pandas>=0.24', 'PyPDF2>=1.26'], |
| 28 | + packages=find_packages(), |
| 29 | + install_requires=requires, |
26 | 30 | classifiers=[
|
27 | 31 | # Trove classifiers
|
28 | 32 | # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
|
32 | 36 | 'Programming Language :: Python :: 3.8',
|
33 | 37 | 'Programming Language :: Python :: 3.9',
|
34 | 38 | 'Programming Language :: Python :: 3.10'
|
35 |
| - ], |
36 |
| - python_requires=">=3.6", |
37 |
| - ) |
| 39 | + ]) |
| 40 | + |
| 41 | + try: |
| 42 | + from setuptools import setup |
| 43 | + except ImportError: |
| 44 | + from distutils.core import setup |
| 45 | + |
| 46 | + setup(**metadata) |
| 47 | + |
| 48 | + |
| 49 | +if __name__ == '__main__': |
| 50 | + setup_package() |
0 commit comments