|
1 | 1 | #!/usr/bin/env python |
2 | | -from setuptools import setup |
3 | | -from os.path import abspath, dirname, join |
| 2 | +import os |
| 3 | +from pathlib import Path |
4 | 4 |
|
| 5 | +from setuptools import find_packages, setup |
5 | 6 |
|
6 | | -def readfile(filename): |
7 | | - path = join(dirname(abspath(__file__)), filename) |
8 | | - with open(path, "rt") as filehandle: |
9 | | - return filehandle.read() |
| 7 | +# allow setup.py to be run from any path |
| 8 | +os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) |
| 9 | + |
| 10 | + |
| 11 | +this_directory = Path(__file__).parent |
| 12 | +long_description = (this_directory / "README.md").read_text() |
| 13 | +requirements = """ |
| 14 | +pip |
| 15 | +requests |
| 16 | +""" |
10 | 17 |
|
11 | 18 |
|
12 | 19 | setup( |
13 | 20 | name="hypernode_api_python", |
14 | 21 | version="0.0.1", |
15 | 22 | description='"Hypernode API Client for Python"', |
16 | | - long_description=readfile("README.md"), |
17 | | - long_description_content_type="text/markdown", |
18 | | - author="Hypernode", |
| 23 | + url="https://github.com/ByteInternet/hypernode_api_python", |
| 24 | + packages=find_packages( |
| 25 | + include=["hypernode_api_python", "requirements/base.txt"], exclude=["tests"] |
| 26 | + ), |
| 27 | + author="Hypernode Team", |
19 | 28 | author_email="support@hypernode.com", |
| 29 | + install_requires=requirements.split("\n"), |
| 30 | + python_requires=">=3.7", |
| 31 | + long_description=long_description, |
| 32 | + long_description_content_type="text/markdown", |
20 | 33 | license="MIT", |
21 | | - url="https://github.com/ByteInternet/hypernode_api_python", |
22 | | - packages=["hypernode_api_python"], |
23 | | - install_requires=["pip"], |
24 | | - entry_points={"console_scripts": []}, |
25 | 34 | ) |
0 commit comments