Hey Pants folks! I'm having an interesting proble...
# general
Hey Pants folks! I'm having an interesting problem that I hope someone on here might be able to help me with. I'm using Pants for Python builds and recently I've been having an issue when I update a package version; I get the following error:
Copy code
ProcessExecutionFailure: Process 'Resolving constraints.txt' failed with exit code 1.
KeyError: "There is no item named 'Hypercorn-0.13.2.dist-info/METADATA' in the archive"
In that example, I went from
0.11.2 to 0.13.2. At first I was thinking this is just related to that particular library, but I've seen that issue happen with another:
. Other requirements seem to be updating fine and updating that package with pip directly seems to work. Has anyone else experienced this kind of issue and/or can point me in the right direction? Any help would be more appreciated! Thanks!
Hi! Sorry for the trouble. Can you post some surrounding log context, when running with
? You can also DM me if there is anything sensitive in there, or redact
Oh and also Pants version and what command you were running that exposes this?
Hey @happy-kitchen-89482, Thank you for the quick reply! (and I apologize from my slow one). We are running Pants version 2.6.0 and I have attached the output from around the error snippet I first posted. I'm not sure if this is helpful, but when I downloaded and unarchived the
from pypi, the directory name it had was
but the file that's been looked for (and throwing the error on) is
(with the capital
in the name). This might be a red herring, but case mismatches seem to be a regular pest in my life 😄
Ok, thanks for the data. This is an old Pex bug. Repro at 2.1.42:
Copy code
$ pex --python python3.7 pex==2.1.42 -cpex -- Hypercorn==0.13.2 --disable-cache -- -c "import hypercorn; print(hypercorn.__file__)"
  File "/home/jsirois/.pex/installed_wheels/65c5c41e7bd725c6e82b3cd1a3d829ce48781cab/pex-2.1.42-py2.py3-none-any.whl/pex/dist_metadata.py", line 107, in _parse_wheel_package_info
    with whl.open(os.path.join(dist_info_dir, DistInfoDistribution.PKG_INFO)) as fp:
  File "/usr/lib/python3.7/zipfile.py", line 1503, in open
    zinfo = self.getinfo(name)
  File "/usr/lib/python3.7/zipfile.py", line 1431, in getinfo
    'There is no item named %r in the archive' % name)
KeyError: "There is no item named 'Hypercorn-0.13.2.dist-info/METADATA' in the archive"
Fixed at 2.1.43:
Copy code
$ pex --python python3.7 pex==2.1.43 -cpex -- Hypercorn==0.13.2 --disable-cache -- -c "import hypercorn; print(hypercorn.__file__)"
That changelog is here: https://github.com/pantsbuild/pex/releases/tag/v2.1.43 And the fix was here: https://github.com/pantsbuild/pex/pull/1376 I'll drum up the magic to change the Pex version you're using here in a bit assuming you can't easily just upgrade Pants to 2.7x or newer.
@silly-diamond-59365 this addition to your
should do it:
Copy code
version = "v2.1.45"
known_versions.add = [
🙌 1
That works here in the Pants 2.6.x branch if I add
to Pants'
and then
./pants repl 3rdparty/python:Hypercorn