-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
32 lines (24 loc) · 724 Bytes
/
setup.py
File metadata and controls
32 lines (24 loc) · 724 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
import setuptools
import subprocess
from os.path import abspath, dirname, join
from pathlib import Path
def here(rel_path):
return join(abspath(dirname(__file__)), rel_path)
def read(rel_path):
return Path(here(rel_path)).read_text()
def long_description():
lines = read('README.md').splitlines()
lines_ = []
cut = False
for line in lines:
if '<!-- cut -->' in line:
cut = True
elif '<!-- end -->' in line:
cut = False
elif not cut:
lines_.append(line)
return '\n'.join(lines_)
setuptools.setup(
version=subprocess.check_output([here('describe-version')]).decode('utf-8').strip(),
long_description=long_description(),
)