-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
executable file
·75 lines (63 loc) · 2.26 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
#!/usr/bin/env python
from pathlib import Path
from setuptools import setup
from typing import List, Tuple
__here__ = Path(__file__).parent.absolute()
def parse_requirements(file_path: Path) -> Tuple[List[str], List[str]]:
requirements, dependencies = [], []
with open(file_path) as f:
for line in f:
line = line.strip()
if not line or line.startswith('#'):
continue
if line.startswith("-e"):
line = line.split(' ', 1)[1]
dependencies.append(line)
line = line.split("#egg=", 1)[1]
requirements.append(line)
elif line.startswith("-r"):
name = Path(line.split(' ', 1)[1])
path = file_path.parent / name
subrequirements, subdependencies = parse_requirements(path)
requirements.extend(subrequirements)
dependencies.extend(subdependencies)
else:
requirements.append(line)
return requirements, dependencies
README = (__here__ / "README.rst").read_text()
REQUIREMENTS, DEPENDENCIES = parse_requirements(__here__ / "requirements.txt")
setup(
name="python-object-extractor",
version="1.0.0",
description=(
"Extract Python object (like class, function, etc) with its "
"dependencies from local project."
),
license="MIT",
url="https://github.com/oblalex/python-object-extractor",
author="Alexander Oblovatnyi",
author_email="[email protected]",
packages=[
"python_object_extractor",
],
namespace_packages=[],
include_package_data=True,
install_requires=REQUIREMENTS,
dependency_links=DEPENDENCIES,
classifiers=[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3.7",
"License :: OSI Approved :: MIT License",
"Environment :: Console",
"Intended Audience :: System Administrators",
"Intended Audience :: Developers",
"Natural Language :: English",
"Topic :: Software Development :: Code Generators",
"Topic :: Utilities",
],
entry_points={
'console_scripts': [
'python-object-extractor=python_object_extractor.main:main',
],
}
)