Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit 8d6a118

Browse files
Change version to be dynamically synced (#258)
* Change setup.py and __init__.py to use __version__.py Co-authored-by: Thomas Hu <[email protected]>
1 parent 61d3fd0 commit 8d6a118

File tree

4 files changed

+37
-11
lines changed

4 files changed

+37
-11
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ coverage.xml
1111
dist
1212
htmlcov
1313
venv
14-
*.sw[op]

codecov/__init__.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111
from time import sleep
1212
from json import loads
1313

14+
from .__version__ import (
15+
__author__,
16+
__author_email__,
17+
__copyright__,
18+
__description__,
19+
__license__,
20+
__title__,
21+
__url__,
22+
__version__,
23+
)
24+
1425
try:
1526
from urllib.parse import urlencode
1627
except ImportError: # pragma: no cover
@@ -29,7 +40,7 @@
2940
logging.captureWarnings(True)
3041

3142

32-
version = VERSION = __version__ = "2.0.21"
43+
version=__version__
3344

3445
COLOR = True
3546

@@ -999,7 +1010,7 @@ def main(*argv, **kwargs):
9991010
)
10001011
)
10011012

1002-
query["package"] = "py" + VERSION
1013+
query["package"] = "py" + version
10031014
urlargs = (
10041015
urlencode(
10051016
dict([(k, v.strip()) for k, v in query.items() if v not in ("", None)])

codecov/__version__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
__author__ = 'Codecov'
2+
__author_email__ = '[email protected]'
3+
__copyright__ = 'Copyright 2020 Codecov'
4+
__description__ = 'Hosted coverage reports for GitHub, Bitbucket and Gitlab'
5+
__license__ = 'Apache 2.0'
6+
__title__ = 'codecov'
7+
__url__ = 'https://github.com/codecov/codecov-python'
8+
__version__ = '2.1.3'
9+

setup.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env python
2+
from codecs import open
3+
import os
24
from setuptools import setup
35

4-
version = "2.1.1"
56
classifiers = [
67
"Development Status :: 5 - Production/Stable",
78
"Environment :: Plugins",
@@ -19,17 +20,23 @@
1920
"Topic :: Software Development :: Testing",
2021
]
2122

23+
filepath = os.path.abspath(os.path.dirname(__file__))
24+
25+
about = {}
26+
with open(os.path.join(filepath, 'codecov', '__version__.py'), 'r', 'utf-8') as f:
27+
exec(f.read(), about)
28+
2229
setup(
23-
name="codecov",
24-
version=version,
25-
description="Hosted coverage reports for GitHub, Bitbucket and Gitlab",
30+
name=about['__title__'],
31+
version=about['__version__'],
32+
description=about['__description__'],
2633
long_description=None,
2734
classifiers=classifiers,
2835
keywords="coverage codecov code python java scala php",
29-
author="@codecov",
30-
author_email="[email protected]",
31-
url="https://github.com/codecov/codecov-python",
32-
license="http://www.apache.org/licenses/LICENSE-2.0",
36+
author=about['__author__'],
37+
author_email=about['__author_email__'],
38+
url=about['__url__'],
39+
license=about['__license__'],
3340
packages=["codecov"],
3441
include_package_data=True,
3542
zip_safe=True,

0 commit comments

Comments
 (0)