|
1 | 1 | from setuptools import setup |
2 | 2 | import re |
3 | 3 |
|
| 4 | + |
4 | 5 | def get_readme(): |
5 | 6 | __version__, __minor_version__ = "0.0.dev0", "0.0" |
6 | 7 | # define __version__ and __minor_version__ from djrill/_version.py, |
7 | 8 | # but without importing from djrill (which would break setup) |
8 | 9 | with open("djrill/_version.py") as f: |
9 | | - code = compile(f.read(), "djrill/_version.py", 'exec') |
| 10 | + code = compile(f.read(), "djrill/_version.py", "exec") |
10 | 11 | exec(code) |
11 | 12 |
|
12 | 13 | def long_description_from_readme(rst): |
13 | 14 | # In release branches, freeze some external links to refer to this X.Y version: |
14 | 15 | if not "dev" in __version__: |
15 | | - rst = re.sub(r'branch=master', 'branch=v' + __minor_version__, rst) # Travis build status |
16 | | - rst = re.sub(r'/latest', '/v' + __minor_version__, rst) # ReadTheDocs |
| 16 | + rst = re.sub(r"branch=master", "branch=v" + __minor_version__, rst) # Travis build status |
| 17 | + rst = re.sub(r"/latest", "/v" + __minor_version__, rst) # ReadTheDocs |
17 | 18 | return rst |
18 | 19 |
|
19 | | - with open('README.rst') as f: |
| 20 | + with open("README.rst") as f: |
20 | 21 | return long_description_from_readme(f.read()) |
21 | 22 |
|
| 23 | + |
22 | 24 | setup( |
23 | 25 | long_description=get_readme(), |
24 | 26 | long_description_content_type="text/x-rst", |
|
0 commit comments