Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support .egg-info dist metadata. #2264

Merged
merged 4 commits into from
Nov 4, 2023

Conversation

jsirois
Copy link
Member

@jsirois jsirois commented Oct 10, 2023

This will allow inventorying system interpreters and venvs; which will
enable strict-checking support for PEX exlucions via --provided as
well as more general resolving from venvs (i.e.: adding a new option to
the --index/--find-links, --pex-repository and --lock set of
resolve repository options).

The new -d/--distributions option is added to
pex3 interpreter inspect to support creating the aforementioned
inventories.

This will allow inventorying system interpreters for use with both
resolving from them (and venvs) and thus supporting strict support
for `--provided` / `--exclude`.

The new `-d/--distributions` option is added to `pex3 interpreter
inspect` to support creating these inventories.
@jsirois jsirois requested review from kaos, benjyw and huonw October 10, 2023 19:47
@jsirois
Copy link
Member Author

jsirois commented Oct 10, 2023

Work towards #2097 and #1361.

@jsirois
Copy link
Member Author

jsirois commented Oct 10, 2023

The necessary motivational background is twofold.

  1. System Python inventories:

Today, for example, on Ubuntu 22.04, just 1 system package (jeepney) is installed from a wheel; the rest from ~python setup.py install:

$ ls /usr/lib/python3/dist-packages/ | grep -E "\.(dist-info|egg-info)" | sort
PyGObject-3.42.1.egg-info
PyJWT-2.3.0.egg-info
PyYAML-5.4.1.egg-info
SecretStorage-3.3.1.egg-info
blinker-1.4.egg-info
command_not_found-0.3.egg-info
cryptography-3.4.8.egg-info
dbus_python-1.2.18.egg-info
distro-1.7.0.egg-info
distro_info-1.1+ubuntu0.1.egg-info
httplib2-0.20.2.egg-info
importlib_metadata-4.6.4.egg-info
jeepney-0.7.1.dist-info
keyring-23.5.0.egg-info
launchpadlib-1.10.16.egg-info
lazr.restfulclient-0.14.4.egg-info
lazr.uri-1.0.6.egg-info
more_itertools-8.10.0.egg-info
netifaces-0.11.0.egg-info
oauthlib-3.2.0.egg-info
pyparsing-2.4.7.egg-info
python_apt-2.4.0+ubuntu2.egg-info
setuptools-59.6.0.egg-info
six-1.16.0.egg-info
systemd_python-234.egg-info
ubuntu_advantage_tools-8001.egg-info
ufw-0.36.1.egg-info
unattended_upgrades-0.1.egg-info
wadllib-1.3.6.egg-info
zipp-1.0.0.egg-info
  1. Venvs with items installed from sdists with older Pips:

Here cowsay 5.0 is sdist-only:

$ python3.10 -mvenv sdist-example.venv
$ sdist-example.venv/bin/pip -q install cowsay==5.0
$ ls sdist-example.venv/lib/python3.10/site-packages | grep -E "\.(dist-info|egg-info)" | sort
cowsay-5.0.egg-info
pip-22.0.2.dist-info
setuptools-59.6.0.dist-info

@jsirois
Copy link
Member Author

jsirois commented Oct 10, 2023

Unfortunately, the Mac unit test errors are likely real; so this will have to wait until November to go green. The fix will likely be both hard won and utterly insignificant though; so it's safe to review this.

@jsirois
Copy link
Member Author

jsirois commented Oct 10, 2023

Ok, sorted.

Copy link
Collaborator

@benjyw benjyw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

pex/dist_metadata.py Outdated Show resolved Hide resolved
@jsirois jsirois mentioned this pull request Nov 4, 2023
2 tasks
@jsirois jsirois merged commit 9f8c763 into pex-tool:main Nov 4, 2023
24 checks passed
@jsirois jsirois deleted the pex3/interpreter/dists branch November 4, 2023 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants