Skip to content

Commit 3138a92

Browse files
authored
Ensure use of setuptools-scm version (#118)
1 parent fb63e81 commit 3138a92

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ Vagrantfile
1717
/python_vagrant.egg-info/
1818
*.egg-info/
1919
*.box
20+
src/vagrant/_version.py

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ filterwarnings = ["error"]
2323

2424
[tool.setuptools_scm]
2525
local_scheme = "no-local-version"
26+
write_to = "src/vagrant/_version.py"

src/vagrant/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424
from . import compat
2525

2626

27-
# python package version
28-
# should match r"^__version__ = '(?P<version>[^']+)'$" for setup.py
29-
__version__ = "0.5.15"
30-
27+
# python package version dumped by setuptools-scm
28+
try:
29+
from ._version import version as __version__
30+
except ImportError:
31+
__version__ = "unknown"
3132

3233
log = logging.getLogger(__name__)
3334

0 commit comments

Comments
 (0)