Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathsetup.py
More file actions
Latest commit
37 lines (27 loc) · 954 Bytes
/
Copy pathsetup.py
File metadata and controls
37 lines (27 loc) · 954 Bytes
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
"""Setups the project."""
importpathlib
fromsetuptoolsimportsetup
CWD=pathlib.Path(__file__).absolute().parent
PKG_NAME="cleandiffuser"
defget_version():
"""Gets the version."""
path=CWD/PKG_NAME/"__init__.py"
content=path.read_text()
forlineincontent.splitlines():
ifline.startswith("__version__"):
returnline.strip().split()[-1].strip().strip('"')
raiseRuntimeError("bad version data in __init__.py")
defget_description():
"""Gets the description from the readme."""
withopen("README.md") asfh:
long_description=""
header_count=0
forlineinfh:
ifline.startswith("##"):
header_count+=1
ifheader_count<2:
long_description+=line
else:
break
returnlong_description
setup(name=PKG_NAME, version=get_version(), long_description=get_description())