1
10
Fork
You've already forked recipes
1

Minimal Python package builder #168

Merged
jhuntwork merged 3 commits from oryktos/merelinux-recipes:recipe-extra-python-installer into main 2026年06月30日 13:53:07 +02:00
Contributor
Copy link

More Alpine aports/apkbuild conversions. I'm working toward uv, based on the aports APKBUILD. This and py3-gpep517 seem to be dependencies for multiple packages, so might be useful for general Python packaging if not using uv for Python environment management.

This builds successfully, but I have no idea if it works for building other Python packages.


Notes

Apkbuild things I'm not sure how to handle

These are in the aports apkbuild but I don't know how/where they fit.

checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="default-bytecode-levels.patch"
# checkdepends causes weird circular behaviour,
# because py3-pytest depends on this down the chain
options="!check"

Hermeticity hacks

Using cut to get the last parts of the Python site-packages path is fragile, but avoids hard-coding the Python minor version. At least, it might be relatively stable. The aim is to cut off the leading /mere/store/python3.14-{hash}/ part, leaving just usr/lib/python3.14/site-packages.

Using files "usr/lib/" feels like too much of a hack given the files built. But I also don't know exactly which files are installed and which are just auxiliary. The output tarball only contains the target subdir tree, so maybe it's fine. As above, this is mainly to avoid hard-coding the Python minor version.

Noarch

The apkbuild architecture is noarch. Mere doesn't recognise this, so I listed aarch64 and x86_64.

Patch file

The patch file isn't used explicitly in the apkbuild. Is it applied in the apkbuild function default_unpack? This is not clear. Including the source doesn't affect the Mere output package. I might need to dig into how Alpine packaging default functions work.

More Alpine aports/apkbuild conversions. I'm working toward [uv][uv], based on the [aports APKBUILD][apk-installer]. This and [py3-gpep517][apk-gpep517] seem to be dependencies for multiple packages, so might be useful for general Python packaging if not using uv for Python environment management. This builds successfully, but I have no idea if it works for building other Python packages. [apk-gpep517]: https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/py3-gpep517 [apk-installer]: https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/py3-installer [uv]: https://docs.astral.sh/uv/ ****** # Notes ## Apkbuild things I'm not sure how to handle These are in the aports apkbuild but I don't know how/where they fit. checkdepends="py3-pytest" subpackages="$pkgname-pyc" source="default-bytecode-levels.patch" # checkdepends causes weird circular behaviour, # because py3-pytest depends on this down the chain options="!check" ## Hermeticity hacks Using `cut` to get the last parts of the Python `site-packages` path is fragile, but avoids hard-coding the Python minor version. At least, it might be relatively stable. The aim is to cut off the leading `/mere/store/python3.14-{hash}/` part, leaving just `usr/lib/python3.14/site-packages`. Using `files "usr/lib/"` feels like too much of a hack given the files built. But I also don't know exactly which files are installed and which are just auxiliary. The output tarball only contains the target subdir tree, so maybe it's fine. As above, this is mainly to avoid hard-coding the Python minor version. ## Noarch The apkbuild architecture is `noarch`. Mere doesn't recognise this, so I listed aarch64 and x86_64. ## Patch file The patch file isn't used explicitly in the apkbuild. Is it applied in the apkbuild function `default_unpack`? This is not clear. Including the source doesn't affect the Mere output package. I might need to dig into how Alpine packaging default functions work.
extra/python-installer: Python wheel builder
All checks were successful
/ validate (pull_request) Successful in 5s
40bb3c0044
Minimal Python package (wheel) builder, ported from the Alpine aport.
@ -0,0 +10,4 @@
release0
description"Low-level library for installing from a Python wheel distribution"
url"https://github.com/pypa/installer"
archs"aarch64""x86_64"

If this isn't arch-specific, we could say 'any' here. Corresponds to 'noarch'.

If this isn't arch-specific, we could say 'any' here. Corresponds to 'noarch'.
@ -0,0 +7,4 @@
recipe{
name"py3-installer"
version"1.0.0"
release0

Up to now I've been using 1 for the first release of a specific version.

Up to now I've been using 1 for the first release of a specific version.

Only a couple of minor nitpicks, otherwise, looks great, thank you!

Only a couple of minor nitpicks, otherwise, looks great, thank you!
remove commented/unused source file
All checks were successful
/ validate (pull_request) Successful in 5s
f7133af0a9
Author
Contributor
Copy link

Updated! I removed the commented source, set the release to 1, and set architectures to any. It still builds successfully, so it seems to be all good.

What are your thoughts on the package name? I thought the prefix should be py- or python- to denote that it's a Python(-specific) package, but wasn't sure if it should be the former or latter.

Updated! I removed the commented source, set the release to 1, and set architectures to any. It still builds successfully, so it seems to be all good. What are your thoughts on the package name? I thought the prefix should be `py-` or `python-` to denote that it's a Python(-specific) package, but wasn't sure if it should be the former or latter.

On the name, I don't have a preference, but we should be consistent. You have an opportunity here to sort of start us off on a standard 😄. If you want to update the name, feel free to do so, otherwise let me know, I'm happy to approve/merge when you're ready.

On the name, I don't have a preference, but we should be consistent. You have an opportunity here to sort of start us off on a standard 😄. If you want to update the name, feel free to do so, otherwise let me know, I'm happy to approve/merge when you're ready.
Author
Contributor
Copy link

I see! I'm worried I might set things off on the wrong foot, but the Ubuntu, Gentoo, and OpenSUSE repos appear to use the python- prefix too. So I will stick with it, I think!

I see! I'm worried I might set things off on the wrong foot, but the Ubuntu, Gentoo, and OpenSUSE repos appear to use the `python-` prefix too. So I will stick with it, I think!
oryktos changed title from (削除) WIP: Minimal Python package builder (削除ここまで) to Minimal Python package builder 2026年06月30日 12:16:48 +02:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
merelinux/recipes!168
Reference in a new issue
merelinux/recipes
No description provided.
Delete branch "oryktos/merelinux-recipes:recipe-extra-python-installer"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?