Skip to content

Commit

Permalink
Prepare 2.4.1 release with an installation failure fix
Browse files Browse the repository at this point in the history
This addresses the following error happening during installation
of the package:

    Collecting pygtrie
      Downloading pygtrie-2.4.0.tar.gz (35 kB)
        ERROR: Command errored out with exit status 1:
         command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-p_3v3rdq/pygtrie/setup.py'"'"'; __file__='"'"'/tmp/pip-install-p_3v3rdq/pygtrie/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-yevdgn7f
             cwd: /tmp/pip-install-p_3v3rdq/pygtrie/
        Complete output (5 lines):
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/tmp/pip-install-p_3v3rdq/pygtrie/setup.py", line 5, in <module>
            import packaging.version
        ModuleNotFoundError: No module named 'packaging'
        ----------------------------------------
    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Fixes: google#32
  • Loading branch information
mina86 committed Nov 20, 2020
1 parent 99055a6 commit 4f2476e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import distutils.command.build_py
import distutils.command.sdist
import distutils.core
import packaging.version
import os
import os.path
import re
Expand Down Expand Up @@ -128,12 +127,12 @@ def get_readme_lines():
yield '\n'

with codecs.open('version-history.rst', 'r', 'utf-8') as fd:
min_version = packaging.version.parse('2.0')
version_re = re.compile(r'^- ([0-9.]*):')
min_major_version = 2
version_re = re.compile(r'^([0-9]+)\.[0-9.]+:')
cleanup_re = re.compile(r':(?:class|func|const):`([^`]*)`')
for line in fd:
m = version_re.search(line)
if m and packaging.version.parse(m.group(1)) < min_version:
if m and int(m.group(1)) < min_major_version:
break
line, _ = cleanup_re.subn(r'``\1``', line)
yield line
Expand All @@ -146,7 +145,6 @@ def get_readme_lines():
'name': 'pygtrie',
'version': release,
'description': 'A pure Python trie data structure implementation.',
'long_description_content_type': 'text/x-rst',
'long_description': readme,
'author': 'Michal Nazarewicz',
'author_email': '[email protected]',
Expand Down
8 changes: 7 additions & 1 deletion version-history.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
Version History
---------------

2.4.0: 2020/11/19
2.4.1: 2020/11/20

- Remove dependency on ``packaging`` module from ``setup.py`` to fix
installation on systems without that package. [Thanks to Eric
McLachlan for reporting]

2.4.0: 2020/11/19 [pulled back from PyPi]

- Change ``children`` argument of the ``node_factory`` passed to
:func:`Trie.traverse` from a generator to an iterator with a custom
Expand Down

0 comments on commit 4f2476e

Please sign in to comment.