File tree Expand file tree Collapse file tree 3 files changed +15
-13
lines changed
Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ### 0.5.5 - Own ` __version__ ` was incorrect
4+
5+ Fixed [ #4 ] ( https://github.com/smarie/python-getversion/issues/4 ) .
6+
37### 0.5.4 - Fixed bug in case of package both installed and in the path
48
59Fixed bug (incorrect version number) happening when a package is both installed and available on python path. This typically happens when a developer is working on a new version of a package while an older version is already installed. Fixes [ #3 ] ( https://github.com/smarie/python-getversion/issues/3 ) .
Original file line number Diff line number Diff line change @@ -131,20 +131,19 @@ If your project uses git, I would recommend the following:
131131
132132 try:
133133 # import version from _version.py generated by setuptools_scm
134- from _version import version
135- __version__ = version
136- del version
134+ from <pkgname>._version import version as _v
135+ __version__ = _v
137136 except ImportError:
138137 # use setuptools_scm to get the current version using git
139- from setuptools_scm import get_version
140- from os.path import join, pardir, dirname
141- __version__ = get_version( join(dirname(__file__), pardir))
138+ from setuptools_scm import get_version as _gv
139+ from os import path as _path
140+ __version__ = _gv(_path. join(_path. dirname(__file__), _path. pardir))
142141
143142 * then, EITHER in ` setup.py ` :
144143
145144 setup(
146145 ...
147- use_scm_version={'write_to': '%s/_version.py' % DISTNAME }
146+ use_scm_version={'write_to': '%s/_version.py' % <pkgname> }
148147 )
149148
150149 * OR when you wish to create releases, after git-tagging your project and before publishing it, do
Original file line number Diff line number Diff line change 66
77try :
88 # import version from _version.py generated by setuptools_scm
9- from _version import version
10- __version__ = version
11- del version
9+ from getversion ._version import version as _v
10+ __version__ = _v
1211except ImportError :
1312 # use setuptools_scm to get the current version using git
1413 # we do not use this because our tests rely on the fact that this is NOT done correctly :)
15- # from setuptools_scm import get_version
16- # from os.path import join, pardir, dirname
17- # __version__ = get_version( join(dirname(__file__), pardir))
14+ # from setuptools_scm import get_version as _gv
15+ # from os import path as _path
16+ # __version__ = _gv(_path. join(_path. dirname(__file__), _path. pardir))
1817 pass
1918
2019__all__ = [
You can’t perform that action at this time.
0 commit comments