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

python dev #20318

Merged
merged 49 commits into from
Jun 18, 2024
Merged

python dev #20318

merged 49 commits into from
Jun 18, 2024

Conversation

xnox
Copy link
Contributor

@xnox xnox commented May 28, 2024

  • Make several core python packages build for mulitple python versions.
    At this point most things should use the py/pip-build-install pipeline
    and generally look like py3-pyyaml

    Also:

    • rename cython.yaml, numpy.yaml to py3-

      These are python packages and present in pypi, for
      consistency, name them like other python packages.

    Co-authored-by: Dimitri John Ledkov [email protected]

  • Resolve the dependency loop.
    flit-core has bootstrap_install.py to handle this, so we use it.

    pip doesn't stricktly depend on wheel, although buidling many projects
    assumes that it is there.

  • Fun stuff
    Signed-off-by: Dimitri John Ledkov [email protected]

  • Revert "Fun stuff"
    hahhah just kidding

    This reverts commit 3a96413.

  • Drop pybins and allow to install them all
    Requires Replaces priority chainguard-dev/melange#1166

    Drop pybins, instead build all packages with commands in /usr/bin.
    Set replaces, replaces-priority to ensure they are apk installable.
    Also set provider-priority such that apk add py3-pip transparently
    installs py3.12-pip alone.

    This is all great, however not at all supported by apko. But imho
    should be supported. As one simply has to sort packages in replaces
    priority order prior to streaming. And allow overriding files between
    packages that have replaces declared.

    ...
    (13/25) Installing python-3.10-base (3.10.14-r1)
    (14/25) Installing py3.10-flit-core (3.9.0-r2)
    (15/25) Installing py3.10-setuptools (69.5.1-r1)
    (16/25) Installing py3.10-pip (24.0-r2)
    (17/25) Installing python-3.11-base (3.11.9-r1)
    (18/25) Installing py3.11-flit-core (3.9.0-r2)
    (19/25) Installing py3.11-setuptools (69.5.1-r1)
    (20/25) Installing py3.11-pip (24.0-r2)
    (21/25) Installing python-3.12-base (3.12.3-r1)
    (22/25) Installing py3.12-flit-core (3.9.0-r2)
    (23/25) Installing py3.12-setuptools (69.5.1-r1)
    (24/25) Installing py3.12-pip (24.0-r2)
    (25/25) Installing py3-supported-pip (24.0-r2)
    OK: 197 MiB in 40 packages
    
    -rwxrwxr-x    1 root     root           946 Apr 26 22:22 /usr/bin/pip3.12
    -rwxrwxr-x    1 root     root           946 Apr 26 22:22 /usr/bin/pip3.11
    -rwxrwxr-x    1 root     root           946 Apr 26 22:22 /usr/bin/pip3.10
    -rwxrwxr-x    1 root     root           940 Apr 26 22:22 /usr/bin/pip3
    -rwxrwxr-x    1 root     root           938 Apr 26 22:22 /usr/bin/pip
  • wip

  • Make several core python packages build for mulitple python versions.
    At this point most things should use the py/pip-build-install pipeline
    and generally look like py3-pyyaml

    Also:

    • rename cython.yaml, numpy.yaml to py3-

      These are python packages and present in pypi, for
      consistency, name them like other python packages.

    Co-authored-by: Dimitri John Ledkov [email protected]

  • Resolve the dependency loop.
    flit-core has bootstrap_install.py to handle this, so we use it.

    pip doesn't stricktly depend on wheel, although buidling many projects
    assumes that it is there.

  • Some cleanups of things. pip-build-install-bootstrap simplifies.
    You can get started with:
    make package/pip-zipapp
    package/py3-{supported-python,setuptools,installer,wheel,pip}

    Then most of core deps are built.

  • Upgrade setuptools
    Signed-off-by: Dimitri John Ledkov [email protected]

  • Test setuptools
    Signed-off-by: Dimitri John Ledkov [email protected]

  • fixes

  • tomli
    Signed-off-by: Dimitri John Ledkov [email protected]

  • foo

  • Add pip-zipapp.yaml file.

  • Remove no longer needed cython-0
    Signed-off-by: Dimitri John Ledkov [email protected]

  • Split wheel binary into -bin subpackage
    Signed-off-by: Dimitri John Ledkov [email protected]

  • Make py3-pip coinstallable
    Signed-off-by: Dimitri John Ledkov [email protected]

  • py3-supported-cython is not coinstallable, and not needed
    Signed-off-by: Dimitri John Ledkov [email protected]

  • Fix py3-tomli priorities
    Signed-off-by: Dimitri John Ledkov [email protected]

  • py3-six fix up environment

  • Fix up py3-numpy

smoser and others added 29 commits March 28, 2024 20:13
At this point most things should use the py/pip-build-install pipeline
and generally look like py3-pyyaml

Also:
* rename cython.yaml, numpy.yaml to py3-<name>

  These are python packages and present in pypi, for
  consistency, name them like other python packages.

Co-authored-by: Dimitri John Ledkov <[email protected]>
flit-core has bootstrap_install.py to handle this, so we use it.

pip doesn't stricktly depend on wheel, although buidling many projects
assumes that it is there.
Signed-off-by: Dimitri John Ledkov <[email protected]>
hahhah just kidding

This reverts commit 3a96413.
Requires chainguard-dev/melange#1166

Drop pybins, instead build all packages with commands in /usr/bin.
Set replaces, replaces-priority to ensure they are apk installable.
Also set provider-priority such that `apk add py3-pip` transparently
installs py3.12-pip alone.

This is all great, however not at all supported by apko. But imho
should be supported. As one simply has to sort packages in replaces
priority order prior to streaming. And allow overriding files between
packages that have replaces declared.

```console
...
(13/25) Installing python-3.10-base (3.10.14-r1)
(14/25) Installing py3.10-flit-core (3.9.0-r2)
(15/25) Installing py3.10-setuptools (69.5.1-r1)
(16/25) Installing py3.10-pip (24.0-r2)
(17/25) Installing python-3.11-base (3.11.9-r1)
(18/25) Installing py3.11-flit-core (3.9.0-r2)
(19/25) Installing py3.11-setuptools (69.5.1-r1)
(20/25) Installing py3.11-pip (24.0-r2)
(21/25) Installing python-3.12-base (3.12.3-r1)
(22/25) Installing py3.12-flit-core (3.9.0-r2)
(23/25) Installing py3.12-setuptools (69.5.1-r1)
(24/25) Installing py3.12-pip (24.0-r2)
(25/25) Installing py3-supported-pip (24.0-r2)
OK: 197 MiB in 40 packages

-rwxrwxr-x    1 root     root           946 Apr 26 22:22 /usr/bin/pip3.12
-rwxrwxr-x    1 root     root           946 Apr 26 22:22 /usr/bin/pip3.11
-rwxrwxr-x    1 root     root           946 Apr 26 22:22 /usr/bin/pip3.10
-rwxrwxr-x    1 root     root           940 Apr 26 22:22 /usr/bin/pip3
-rwxrwxr-x    1 root     root           938 Apr 26 22:22 /usr/bin/pip
```
At this point most things should use the py/pip-build-install pipeline
and generally look like py3-pyyaml

Also:
* rename cython.yaml, numpy.yaml to py3-<name>

  These are python packages and present in pypi, for
  consistency, name them like other python packages.

Co-authored-by: Dimitri John Ledkov <[email protected]>
flit-core has bootstrap_install.py to handle this, so we use it.

pip doesn't stricktly depend on wheel, although buidling many projects
assumes that it is there.
You can get started with:
   make package/pip-zipapp \
     package/py3-{supported-python,setuptools,installer,wheel,pip}

Then most of core deps are built.
Signed-off-by: Dimitri John Ledkov <[email protected]>
Signed-off-by: Dimitri John Ledkov <[email protected]>
Signed-off-by: Dimitri John Ledkov <[email protected]>
Signed-off-by: Dimitri John Ledkov <[email protected]>
Signed-off-by: Dimitri John Ledkov <[email protected]>
Signed-off-by: Dimitri John Ledkov <[email protected]>
Signed-off-by: Dimitri John Ledkov <[email protected]>
Copy link
Contributor Author

@xnox xnox left a comment

Choose a reason for hiding this comment

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

@smoser @pnasrat i think this is roughly in the state we agreed for things to be in.

Very large pull request, and still see knitpicks here and there.

subpackage naming for numpy / cython / pip / wheel would is very important to get right. So please chip in your thoughts there.

py3-cython.yaml Show resolved Hide resolved
py3-flit-core.yaml Show resolved Hide resolved
py3-gpep517.yaml Show resolved Hide resolved
py3-numpy.yaml Show resolved Hide resolved
py3-pathspec.yaml Outdated Show resolved Hide resolved
py3-pip.yaml Show resolved Hide resolved
py3-pip.yaml Show resolved Hide resolved
py3-pyyaml.yaml Outdated Show resolved Hide resolved
py3-six.yaml Outdated Show resolved Hide resolved
py3-wheel.yaml Show resolved Hide resolved
@pnasrat
Copy link
Contributor

pnasrat commented Jun 17, 2024

Was going to test the cython deps moving to py3-cython however getting depsolving issues. @xnox am I missing something I need locally (melange seems current) to fix this

2024/06/17 14:49:15 INFO error during command execution: failed to build package: unable to build guest: unable to generate image: installing apk packages: error getting package dependencies: solving "py3-supported-pip" constraint: resolving "py3-supported-pip-24.0-r2.apk" deps:                                       
resolving "py3.11-pip-base-24.0-r2.apk" deps:                                                                                                                                                                                                                                                                                 
resolving "py3.11-setuptools-70.0.0-r0.apk" deps:                                                                                                                                                                                                                                                                             
solving "python-3.11" constraint:   python-3.11-3.11.1-r5.apk disqualified because python-3.10-3.10.14-r2.apk already provides python3                                                                                                                                                                                        
  python-3.11-3.11.1-r6.apk disqualified because python-3.10-3.10.14-r2.apk already provides python3                                                                                                                                                                                                                          
  python-3.11-3.11.1-r7.apk disqualified because python-3.10-3.10.14-r2.apk already provides python3                                                                                                                                                                                                                          
  python-3.11-3.11.1-r8.apk disqualified because python-3.10-3.10.14-r2.apk already provides python3                                                                                                                                                                                                                          
  python-3.11-3.11.2-r0.apk disqualified because python-3.10-3.10.14-r2.apk already provides python3                                                                                                                                                                                                                          
  python-3.11-3.11.3-r0.apk disqualified because python-3.10-3.10.14-r2.apk already provides python3                                                                                                                                                                                                                          
  python-3.11-3.11.4-r0.apk disqualified because python-3.10-3.10.14-r2.apk already provides python3                                                                                                                                                                                                                          
  python-3.11-3.11.5-r0.apk disqualified because python-3.10-3.10.14-r2.apk already provides python3                                                                                                                                                                                                                          
  python-3.11-3.11.5-r1.apk disqualified because python-3.10-3.10.14-r2.apk already provides python-3                                                                                                                                                                                                                         
  python-3.11-3.11.5-r2.apk disqualified because python-3.10-3.10.14-r2.apk already provides python-3                                                                                                                                                                                                                         
  python-3.11-3.11.6-r0.apk disqualified because python-3.10-3.10.14-r2.apk already provides python-3                                                                                                                                                                                                                         
  python-3.11-3.11.7-r0.apk disqualified because python-3.10-3.10.14-r2.apk already provides python-3                                                                                                                                                                                                                         
  python-3.11-3.11.7-r1.apk disqualified because python-3.10-3.10.14-r2.apk already provides python-3                                                                                                                                                                                                                         
  python-3.11-3.11.8-r0.apk disqualified because python-3.10-3.10.14-r2.apk already provides python-3                                                                                                                                                                                                                         
  python-3.11-3.11.8-r1.apk disqualified because python-3.10-3.10.14-r2.apk already provides python-3                                                                                                                                                                                                                         
  python-3.11-3.11.8-r2.apk disqualified because python-3.11-base-3.11.9-r3.apk already provides cmd:pydoc3.11                                                                                                                                                                                                                
  python-3.11-3.11.8-r3.apk disqualified because python-3.11-base-3.11.9-r3.apk already provides cmd:pydoc3.11                                                                                                                                                                                                                
  python-3.11-3.11.8-r4.apk disqualified because python-3.10-3.10.14-r2.apk already provides python-3                                                                                                                                                                                                                         
  python-3.11-3.11.8-r5.apk disqualified because python-3.10-3.10.14-r2.apk already provides python-3                                                                                                                                                                                                                         
  python-3.11-3.11.9-r0.apk disqualified because python-3.10-3.10.14-r2.apk already provides python-3                                                                                                                                                                                                                         
  python-3.11-3.11.9-r1.apk disqualified because python-3.10-3.10.14-r2.apk already provides python-3                                                                                                                                                                                                                         
  python-3.11-3.11.9-r2.apk disqualified because python-3.10-3.10.14-r2.apk already provides python-3                                                                                                                                                                                                                         
  python-3.11-3.11.9-r3.apk disqualified because python-3.10-3.10.14-r2.apk already provides python-3     
make[1]: *** [Makefile:150: packages/x86_64/py3-cython-3.0.10-r1.apk] Error 1

@pnasrat
Copy link
Contributor

pnasrat commented Jun 17, 2024

Ah looks like I was pulling in a transient dep to the old world running this first fixes:

make package/pip-zipapp package/py3-{supported-python,setuptools,installer,wheel,pip}

py3-cython.yaml Outdated Show resolved Hide resolved
This reverts commit 634fa93.

Various packages still depend on `cython~0`

Signed-off-by: Pris Nasrat <[email protected]>
@pnasrat
Copy link
Contributor

pnasrat commented Jun 17, 2024

2024-06-17T15:46:38.8965488Z Error: unable to build graph:
2024-06-17T15:46:38.8967047Z grpc-1.63.0-r1: unable to resolve dependency cython~0: could not find constraint "cython~0" in indexes
2024-06-17T15:46:38.8968617Z py3-aiohttp-3.9.5-r0: unable to resolve dependency cython~0: could not find constraint "cython~0" in indexes
2024-06-17T15:46:38.8970253Z py3-h5py-3.11.0-r0: unable to resolve dependency cython~0: could not find constraint "cython~0" in indexes
2024-06-17T15:46:38.8972238Z py3-pyyaml-6.0.1-r5: unable to resolve dependency py3-supported-cython: could not find package that provides py3-supported-cython in indexes
2024-06-17T15:46:38.8974502Z tensorflow-core-2.16.1-r0: unable to resolve dependency cython~0: could not find constraint "cython~0" in indexes
2024-06-17T15:46:38.8975687Z 2024/06/17 15:46:38 ERRO unable to build graph:
2024-06-17T15:46:38.8976883Z grpc-1.63.0-r1: unable to resolve dependency cython~0: could not find constraint "cython~0" in indexes
2024-06-17T15:46:38.8978616Z py3-aiohttp-3.9.5-r0: unable to resolve dependency cython~0: could not find constraint "cython~0" in indexes
2024-06-17T15:46:38.8980319Z py3-h5py-3.11.0-r0: unable to resolve dependency cython~0: could not find constraint "cython~0" in indexes
2024-06-17T15:46:38.8982313Z py3-pyyaml-6.0.1-r5: unable to resolve dependency py3-supported-cython: could not find package that provides py3-supported-cython in indexes
2024-06-17T15:46:38.8984349Z tensorflow-core-2.16.1-r0: unable to resolve dependency cython~0: could not find constraint "cython~0" in indexes

clean before build to ensure versioned cpython libs created for all py versions

Signed-off-by: Pris Nasrat <[email protected]>
build-base pulls in wolfi-baselayout and transitively ca-certificates-bundle

Signed-off-by: Pris Nasrat <[email protected]>
@pnasrat
Copy link
Contributor

pnasrat commented Jun 17, 2024

Depends on split out pip-zipapp PR #22162 to be able to CI build/test

@pnasrat
Copy link
Contributor

pnasrat commented Jun 17, 2024

Scan package for CVES is reporting CVE-2018-20225 which has been previously nak'd

ff77050

@pnasrat
Copy link
Contributor

pnasrat commented Jun 17, 2024

New package name: py3-pip py3-pip-24.0-r2.apk advisory will need to be created after merge similar to

https://github.com/wolfi-dev/advisories/blob/main/py3.12-pip.advisories.yaml

Have draft PR for that here wolfi-dev/advisories#5849

py3-pathspec.yaml Show resolved Hide resolved
@xnox xnox dismissed smoser’s stale review June 18, 2024 08:35

feedback addressed

@xnox xnox marked this pull request as ready for review June 18, 2024 08:35
@xnox xnox merged commit a7465d7 into main Jun 18, 2024
7 of 8 checks passed
@xnox xnox deleted the python-dev branch June 18, 2024 10:10
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.

5 participants