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

feat(24.04): add python3-pip slices #356

Open
wants to merge 4 commits into
base: ubuntu-24.04
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions slices/python3-pip.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package: python3-pip

essential:
- python3-pip_copyright

slices:
bins:
# Although pip requires python3, python3.x slices are not listed as an
# essential here because we might choose to install python3-pip with
# different versions of python3.
# For pip with python3.12, please use the "bins3-12" slice.
essential:
- python3-pip_libs
contents:
/usr/bin/pip:
/usr/bin/pip3:

libs:
essential:
- ca-certificates_data
- python3-setuptools_libs
- python3-wheel_libs
contents:
/usr/lib/python3/dist-packages/pip-*.dist-info/**:
/usr/lib/python3/dist-packages/pip/**:

# pip binaries with python3.12.
bins3-12:
essential:
- python3-pip_bins
- python3.12_standard

copyright:
contents:
/usr/share/doc/python3-pip/copyright:
16 changes: 16 additions & 0 deletions slices/python3-pkg-resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package: python3-pkg-resources

essential:
- python3-pkg-resources_copyright

slices:
libs:
# Although pkg-resources requires python3, python3.x slices are not listed
# as an essential here because we might choose to install
# python3-pkg-resources with different versions of python3.
contents:
/usr/lib/python3/dist-packages/pkg_resources/**:

copyright:
contents:
/usr/share/doc/python3-pkg-resources/copyright:
20 changes: 20 additions & 0 deletions slices/python3-setuptools.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package: python3-setuptools

essential:
- python3-setuptools_copyright

slices:
libs:
# Although setuptools requires python3, python3.x slices are not listed as
# an essential here because we might choose to install python3-setuptools
# with different versions of python3.
essential:
- python3-pkg-resources_libs
contents:
/usr/lib/python3/dist-packages/_distutils_hack/**:
/usr/lib/python3/dist-packages/setuptools-*.egg-info/**:
/usr/lib/python3/dist-packages/setuptools/**:

copyright:
contents:
/usr/share/doc/python3-setuptools/copyright:
17 changes: 17 additions & 0 deletions slices/python3-wheel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package: python3-wheel

essential:
- python3-wheel_copyright

slices:
libs:
# Although wheel requires python3, python3.x slices are not listed as an
# essential here because we might choose to install python3-wheel with
# different versions of python3.
contents:
/usr/lib/python3/dist-packages/wheel-*.dist-info/**:
/usr/lib/python3/dist-packages/wheel/**:

copyright:
contents:
/usr/share/doc/python3-wheel/copyright:
11 changes: 11 additions & 0 deletions tests/spread/integration/python3-pip/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
summary: Integration tests for python3-pip

execute: |
rootfs="$(install-slices python3-pip_bins3-12)"
# pip depends on python3.
ln -s /usr/bin/python3.12 ${rootfs}/usr/bin/python3
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
ln -s /usr/bin/python3.12 ${rootfs}/usr/bin/python3
ln -s ${rootfs}/usr/bin/python3.12 ${rootfs}/usr/bin/python3

Copy link
Member Author

Choose a reason for hiding this comment

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

This would not work, because when I run within chroot, it's going to look for python3 at ${rootfs}/usr/bin but there won't be any directory ${rootfs} within the chroot jail.

# Smoke tests.
chroot ${rootfs} /usr/bin/pip --version
chroot ${rootfs} /usr/bin/pip install --upgrade setuptools
Loading