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

stdeb build fails on Ubuntu 24.04 because it's using Python 3.12 #8

Open
mendhak opened this issue Aug 3, 2024 · 6 comments
Open

Comments

@mendhak
Copy link
Owner

mendhak commented Aug 3, 2024

This project uses stdeb to build the deb package.
I'm able to build it on Ubuntu 22.04, but not on Ubuntu 24.04.
This is because Ubuntu 24.04 comes with Python 3.12.
And in Python 3.12, configparser has been disabled: python/cpython#89336

A few options to consider.

Wait for this PR to be merged/resolved, which makes it compatible with 3.12: astraw/stdeb#196

Build in 22.04. In the future build in 22.04 in a VM. 😬

In the future, try using pyenv to fall back to 3.11 and build with that maybe

Move to something else to build debs. eg, pybuild

@pixmusix
Copy link

@mendhak Do you feel this issue is resolved?
Is there anything I can help with?

@mendhak
Copy link
Owner Author

mendhak commented Feb 14, 2025

Hi thanks for reminder. So if I understood correctly, the fix has been implemented, but it's not been released yet? I guess it's going to be released in stdeb 0.11.0 but there hasn't been any release yet.

I guess there's still time before Ubuntu 26.04 so I wonder if I could just wait a while longer before deciding on alternatives.

@mendhak
Copy link
Owner Author

mendhak commented Feb 14, 2025

Or maybe some way to do the .deb build using pyenv or uv, maybe that's worth trying to figure out?

@mendhak
Copy link
Owner Author

mendhak commented Feb 15, 2025

I've spent yesterday and today on this. I learned that package build tools really, really don't like you working in virtual environments. So I've ruled out uv and pyenv.

I now have a working branch that uses pybuild instead of stdeb to build the .deb. It works both on local machine but for safety I have also made it build in a Docker image.

I am considering switching away from stdeb to pybuild, because pybuild is considered more modern and I don't have to wait on stdeb's next release which could be a while away (or could be much sooner!). I am seeing many other projects have switched stdeb to pybuild so I am thinking the "writing is on the wall".

I am aware there is an AUR package, I am wondering @yochananmarqos if I switch from stdeb to pybuild would that be manageable for you? For example there would be no more setup.py, there is now pyproject.toml and debian/control and debian/links files. I don't know much about AUR but from what I can tell it takes some existing files and replaces lines to make them Arch compatible.

I also saw the comment about tag reuse, oops, sorry about that, I hadn't realized I'd actually done it; I think I was messing around with Github Actions at the time, I'll be careful in the future.

@yochananmarqos
Copy link

yochananmarqos commented Feb 16, 2025

@mendhak

if I switch from stdeb to pybuild would that be manageable for you?

I see it's using Hatchling as the build backend now. However, the pyproject.toml should be in the root directory instead of debian_build/ and the src/ folder should be renamed to grub-reboot-picker/ as the module name.

I tried building it from the pybuild_poc_2 branch, but it didn't actually install anything except for the dist-info files in site-packages.

See PEP 517 for reference.

@mendhak
Copy link
Owner Author

mendhak commented Feb 16, 2025

Hi @yochananmarqos thanks for that, I'm not expert at packaging so I made weird choices, always open to doing it the right way.

I've now adjusted the paths. src renamed to grub-reboot-picker, pyproject.toml is in the top directory

https://github.com/mendhak/grub-reboot-picker/tree/pybuild_poc_2

I build like this:

source version.sh
# Build the package
dpkg-buildpackage -uc -us

For some reason the .deb ends up in the parent directory so I have to copy it to a subdirectory:

# Grab the deb and dsc files
mkdir -p output
mv ../grub-reboot-picker_${version}* output/

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

No branches or pull requests

3 participants