Skip to content

Commit 7918f58

Browse files
committed
Do not call _get_package_version() on import
Hopefully, helps out an xonsh issue on fedora? xonsh/xonsh#3607
1 parent baa4b75 commit 7918f58

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def main():
4848
"""Setup.py entry point."""
4949
setuptools.setup(
5050
name='wcwidth',
51+
# NOTE: manually manage __version__ in wcwidth/__init__.py !
5152
version=_get_version(
5253
_get_here(os.path.join('wcwidth', 'version.json'))),
5354
description=(

wcwidth/__init__.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,18 @@
1616
_bisearch,
1717
list_versions,
1818
_wcmatch_version,
19-
_wcversion_value,
20-
_get_package_version)
19+
_wcversion_value)
2120

2221
# The __all__ attribute defines the items exported from statement,
2322
# 'from wcwidth import *', but also to say, "This is the public API".
2423
__all__ = ('wcwidth', 'wcswidth', 'list_versions')
25-
__version__ = _get_package_version()
24+
25+
# I used to use a _get_package_version() function to use the `pkg_resources'
26+
# module to parse the package version from our version.json file, but this blew
27+
# some folks up, or more particularly, just the `xonsh' shell.
28+
#
29+
# Yikes! I always wanted to like xonsh and tried it many times but issues like
30+
# these always bit me, too, so I can sympathize -- this version is now manually
31+
# kept in sync with version.json to help them out. Shucks, this variable is just
32+
# for legacy, from the days before 'pip freeze' was a thing.
33+
__version__ = '0.2.4'

wcwidth/version.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"tables": ["4.1.0", "5.0.0", "5.1.0", "5.2.0", "6.0.0", "6.1.0", "6.2.0", "6.3.0", "7.0.0", "8.0.0", "9.0.0", "10.0.0", "11.0.0", "12.0.0", "12.1.0", "13.0.0"], "package": "0.2.3", "default": "8.0.0"}
1+
{"tables": ["4.1.0", "5.0.0", "5.1.0", "5.2.0", "6.0.0", "6.1.0", "6.2.0", "6.3.0", "7.0.0", "8.0.0", "9.0.0", "10.0.0", "11.0.0", "12.0.0", "12.1.0", "13.0.0"], "package": "0.2.4", "default": "8.0.0"}

0 commit comments

Comments
 (0)