From 43546da6949ea9a70e4cb01534bfa345dd362906 Mon Sep 17 00:00:00 2001 From: Steve Dougherty Date: Wed, 12 Jul 2023 04:43:15 -0400 Subject: [PATCH 1/2] Work around requirementslib AttributeError MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/pypa/pipenv/issues/5167#issuecomment-1349316531 This could lead to failures like $ pipenv install Pipfile.lock (6c5d3c) out of date, updating to (dd7943)... Locking [packages] dependencies... ⠸ Resolving dependencies... Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pipenv/resolver.py", line 845, in main() File "/usr/lib/python3/dist-packages/pipenv/resolver.py", line 831, in main _main( File "/usr/lib/python3/dist-packages/pipenv/resolver.py", line 811, in _main resolve_packages( File "/usr/lib/python3/dist-packages/pipenv/resolver.py", line 759, in resolve_packages results, resolver = resolve( ^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/resolver.py", line 738, in resolve return resolve_deps( ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/utils/resolver.py", line 1100, in resolve_deps results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps( ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/utils/resolver.py", line 888, in actually_resolve_deps resolver = Resolver.create( ^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/utils/resolver.py", line 458, in create constraints, skipped, index_lookup, markers_lookup = resolver.get_metadata( ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/utils/resolver.py", line 246, in get_metadata constraint_update, lockfile_update = self.get_deps_from_req( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/utils/resolver.py", line 325, in get_deps_from_req req_list, lockfile = get_vcs_deps(reqs=[req]) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/utils/dependencies.py", line 125, in get_vcs_deps with temp_path(), locked_repository(requirement) as repo: File "/usr/lib/python3.11/contextlib.py", line 137, in __enter__ return next(self.gen) ^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/utils/dependencies.py", line 375, in locked_repository with requirement.req.locked_vcs_repo(src_dir=src_dir) as repo: File "/usr/lib/python3.11/contextlib.py", line 137, in __enter__ return next(self.gen) ^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/vendor/requirementslib/models/requirements.py", line 2203, in locked_vcs_repo self._parsed_line.vcsrepo = vcsrepo ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/vendor/requirementslib/models/requirements.py", line 903, in vcsrepo setupinfo = SetupInfo.create( ^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 1564, in create created.get_initial_info() File "/usr/lib/python3/dist-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 1393, in get_initial_info parsed.update(self.parse_setup_py()) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 1118, in parse_setup_py parsed = ast_parse_setup_py(self.setup_py.as_posix()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 839, in ast_parse_setup_py return SetupReader.read_setup_py(Path(path), raising) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 180, in read_setup_py "install_requires": caller(cls._find_install_requires, setup_call, body), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 172, in caller return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 335, in _find_install_requires return [el.s for el in value.elts] ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 335, in return [el.s for el in value.elts] ^^^^ AttributeError: 'IfExp' object has no attribute 's' --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 5b1a544b..44f58fa1 100644 --- a/setup.py +++ b/setup.py @@ -134,7 +134,7 @@ "Topic :: Text Processing :: Linguistic", "Topic :: Text Processing :: Markup :: HTML" ], - install_requires = [ + install_requires = list([ "future", "backports.csv", "mysqlclient", @@ -148,6 +148,6 @@ "python-docx", "cherrypy", "requests" - ], + ]), zip_safe = False ) From e8a3a88b4c65e7680e219da9f9f37f4cf097a91c Mon Sep 17 00:00:00 2001 From: Steve Dougherty Date: Wed, 12 Jul 2023 05:12:39 -0400 Subject: [PATCH 2/2] fixup! bump version number --- pattern/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pattern/__init__.py b/pattern/__init__.py index 2cef34ee..69c66216 100644 --- a/pattern/__init__.py +++ b/pattern/__init__.py @@ -44,7 +44,7 @@ __author__ = "Tom De Smedt" __credits__ = "Tom De Smedt, Walter Daelemans" -__version__ = "3.6" +__version__ = "3.7" __copyright__ = "Copyright (c) 2010 University of Antwerp (BE)" __license__ = "BSD"