-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
28 lines (22 loc) · 714 Bytes
/
setup.py
File metadata and controls
28 lines (22 loc) · 714 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
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(),
)