Skip to content

Commit 6259a7a

Browse files
committed
Do not set __version__
1 parent 9e712a2 commit 6259a7a

File tree

4 files changed

+6
-17
lines changed

4 files changed

+6
-17
lines changed

docs/source/conf.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import datetime
99

10-
import vws
10+
from pkg_resources import get_distribution
1111

1212
project = 'VWS-Python'
1313
author = 'Adam Dangoor'
@@ -31,7 +31,10 @@
3131
# The version info for the project you're documenting, acts as replacement for
3232
# |version| and |release|, also used in various other places throughout the
3333
# built documents.
34-
version = vws.__version__
34+
#
35+
# Use ``pkg_resources`` as per
36+
# https://github.com/pypa/setuptools_scm#usage-from-sphinx.
37+
version = get_distribution(project).version
3538
_month, _day, _year, *_ = version.split('.')
3639
release = f'{_month}.{_day}.{_year}'
3740

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ VWS-Auth-Tools==2019.12.28.3
22
requests==2.22.0
33
timeout-decorator==0.4.1
44
urllib3==1.25.7
5-
setuptools-scm==3.3.3

setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ def _get_dependencies(requirements_file: Path) -> List[str]:
2525
)
2626

2727
setup(
28-
use_scm_version={
29-
'write_to': 'src/vws/_setuptools_scm_version.txt',
30-
},
28+
use_scm_version=True,
3129
setup_requires=['setuptools_scm', 'setuptools_scm_git_archive'],
3230
install_requires=INSTALL_REQUIRES,
3331
extras_require={'dev': DEV_REQUIRES},

src/vws/__init__.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,10 @@
44

55
from pathlib import Path
66

7-
from setuptools_scm import get_version
8-
97
from .query import CloudRecoService
108
from .vws import VWS
119

1210
__all__ = [
1311
'CloudRecoService',
1412
'VWS',
1513
]
16-
17-
try:
18-
__version__ = get_version(root='..', relative_to=Path(__file__).parent)
19-
except LookupError: # pragma: no cover
20-
# When pkg_resources and git tags are not available,
21-
# for example in a PyInstaller binary,
22-
# we write the file ``_setuptools_scm_version.py`` on ``pip install``.
23-
_VERSION_FILE = Path(__file__).parent / '_setuptools_scm_version.txt'
24-
__version__ = _VERSION_FILE.read_text()

0 commit comments

Comments
 (0)