Skip to content

Conversation

@smoser
Copy link
Member

@smoser smoser commented Mar 14, 2024

We tried python-3.12-default to provide symlinks python3 -> python3.12. That caused some problems as many things expected to get a /usr/bin/python3 (or /usr/bin/python) from installing 'python-3.12'.

The change here is to instead have python-3.12 provide /usr/bin/python3 as it did before, and depend on python-3.12-base for the primary files. python-3.12 and python-3.12-dev contain only symlinks.

The other changes here are a move of some files out of the runtime package and into -dev (usr/lib/python3.X/config-3.X-x86_64-linux-gnu). debian/ubuntu put these files in the -dev package.

Fixes:

Related:

Pre-review Checklist

For new package PRs only

  • This PR is marked as fixing a pre-existing package request bug
    • Alternatively, the PR is marked as related to a pre-existing package request bug, such as a dependency
  • REQUIRED - The package is available under an OSI-approved or FSF-approved license
  • REQUIRED - The version of the package is still receiving security updates
  • This PR links to the upstream project's support policy (e.g. endoflife.date)

For new version streams

  • The upstream project actually supports multiple concurrent versions.
  • Any subpackages include the version string in their package name (e.g. name: ${{package.name}}-compat)
  • The package (and subpackages) provides: logical unversioned forms of the package (e.g. nodejs, nodejs-lts)

For security-related PRs

  • The security fix is recorded in the advisories repo

For version bump PRs

  • The epoch field is reset to 0

For PRs that add patches

  • Patch source is documented

We tried python-3.12-default to provide symlinks python3 -> python3.12.
That caused some problems as many things expected to get a
/usr/bin/python3 (or /usr/bin/python) from installing
'python-3.12'.

The change here is to instead have python-3.12 provide /usr/bin/python3
as it did before, and depend on python-3.12-base for the primary files.
python-3.12 and python-3.12-dev contain only symlinks.

The other changes here are a move of some files out of the runtime
package and into -dev (usr/lib/python3.X/config-3.X-x86_64-linux-gnu).
debian/ubuntu put these files in the -dev package.
@smoser smoser force-pushed the fix/python3.12-no-defaults-again branch 2 times, most recently from 734f5eb to f8184b8 Compare March 14, 2024 02:52
@smoser smoser force-pushed the fix/python3.12-no-defaults-again branch from f8184b8 to 3b696da Compare March 14, 2024 02:53
@smoser smoser requested a review from xnox March 14, 2024 03:09
@ajayk
Copy link
Member

ajayk commented Mar 14, 2024

downloaded the generated apps from the build and ran a simple test with pip

ERROR: python-3.12-base-3.12.2-r7.apk: UNTRUSTED signature
/work/packages/aarch64 # apk add  python-3.12-base-3.12.2-r7.apk  --allow-untrusted
(1/13) Installing libbz2-1 (1.0.8-r6)
(2/13) Installing libexpat1 (2.6.2-r0)
(3/13) Installing libffi (3.4.6-r0)
(4/13) Installing gdbm (1.23-r4)
(5/13) Installing xz (5.6.1-r0)
(6/13) Installing libgcc (13.2.0-r5)
(7/13) Installing libstdc++ (13.2.0-r5)
(8/13) Installing mpdecimal (4.0.0-r0)
(9/13) Installing ncurses-terminfo-base (6.4_p20231125-r1)
(10/13) Installing ncurses (6.4_p20231125-r1)
(11/13) Installing readline (8.2-r3)
(12/13) Installing sqlite-libs (3.45.1-r0)
(13/13) Installing python-3.12-base (3.12.2-r7)
OK: 69 MiB in 28 packages
/work/packages/aarch64 # apk add  python-3.12-3.12.2-r7.apk  --allow-untrusted
(1/1) Installing python-3.12 (3.12.2-r7)
OK: 69 MiB in 29 packages
/work/packages/aarch64 # python --version
Python 3.12.2
/work/packages/aarch64 # apk add py3.12-pip-24.0-r1.apk  --allow-untrusted
(1/2) Installing py3.12-setuptools (69.1.1-r0)
(2/2) Installing py3.12-pip (24.0-r1)
OK: 90 MiB in 31 packages
/work/packages/aarch64 # pip3


/tmp # apk add vim 
(1/1) Installing vim (9.1.0173-r0)
OK: 123 MiB in 32 packages
/tmp # vim requirements.txt
/tmp # pip install -r requirements.txt 
Collecting requests (from -r requirements.txt (line 1))
  Downloading requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
Collecting charset-normalizer<4,>=2 (from requests->-r requirements.txt (line 1))
  Downloading charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (33 kB)
Collecting idna<4,>=2.5 (from requests->-r requirements.txt (line 1))
  Downloading idna-3.6-py3-none-any.whl.metadata (9.9 kB)
Collecting urllib3<3,>=1.21.1 (from requests->-r requirements.txt (line 1))
  Downloading urllib3-2.2.1-py3-none-any.whl.metadata (6.4 kB)
Collecting certifi>=2017.4.17 (from requests->-r requirements.txt (line 1))
  Downloading certifi-2024.2.2-py3-none-any.whl.metadata (2.2 kB)
Downloading requests-2.31.0-py3-none-any.whl (62 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.6/62.6 kB 8.2 MB/s eta 0:00:00
Downloading certifi-2024.2.2-py3-none-any.whl (163 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 163.8/163.8 kB 8.3 MB/s eta 0:00:00
Downloading charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (137 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 137.3/137.3 kB 29.9 MB/s eta 0:00:00
Downloading idna-3.6-py3-none-any.whl (61 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.6/61.6 kB 16.1 MB/s eta 0:00:00
Downloading urllib3-2.2.1-py3-none-any.whl (121 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.1/121.1 kB 21.9 MB/s eta 0:00:00
Installing collected packages: urllib3, idna, charset-normalizer, certifi, requests
Successfully installed certifi-2024.2.2 charset-normalizer-3.3.2 idna-3.6 requests-2.31.0 urllib3-2.2.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

@xnox xnox merged commit 2772407 into wolfi-dev:main Mar 14, 2024
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