-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix failing CI #2122
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
base: main
Are you sure you want to change the base?
Fix failing CI #2122
Conversation
9d5a230 to
17a72d8
Compare
|
@jordansissel |
|
I appreciate your effort to battle the black box that is GitHub Runners!
for Python wheel: is this finding a real problem for fpm and not just a problem on CI? Because as I read it, fpm can’t create Python packages when run on Ubuntu 22.04 with the default wheel version? This feels like a bug correctly identified - that this older wheel isn’t supported (this wasn’t an intentional choice)
+1
Feels like a bug. Fpm should be able to package click even if click is already installed. I’ll read more about your venv idea soon.
these files I think aren’t used anymore since a recent change moved fpm from using setup.py to only use pip. It’s worth another review, but I believe they’re fine to delete (the tests and get_metadata.py) |
|
Thanks for the response @jordansissel! I'll go through and respond to all of your comments.
I would say that the fact that we need a newer version of wheel is not a bug in fpm, because the new feature is for
I agree with you, this does feel like it's an fpm bug. It seems to be the case that the fpm Python code should run in a temporary virtual environment. We would also need to detect if the user is already running in a virtual environment to prevent nested virtual environments. Pip version pip 23.0 (released on 01/30/2023, between our two Ubuntu releases) implemented PEP 668. The following Dockerfile can be used to reproduce the bug, which gives us an error message from pip specifically telling us we should use a virtual environment (importantly we do not get any error if we switch the base image to If we updated the fpm Python code to use a virtual environment, then we would not need to setup the virtual environment in the CI. So it seems that our two options are to require the user to use a virtual environment when using fpm to package Python projects, or we upgrade fpm to automatically utilize a virtual environment when building Python packages.
We double checked and confirmed that commit 8e27610 removes this file and the dependency on We also realized that fpm does not actually have a dependency on setuptools since it is a dependency of pip, which is what fpm actually depends on. So to recap, our main question for you right now is as follows: do we want fpm itself to have the ability to detect and create Python virtual environments, or is setting up a Python virtual environment the sole responsibility of each fpm end user? |
|
@jordansissel |
In such cases, fpm should create (and destroy) the virtual environment because fpm would be doing this to work around some kind of problem that, ideally, the user is unaware of. However, see below:
I don't think we need this, and worry a virtual environment would cause different problems once the python package is pulled out of the virtual env... it's worth testing, though. Without a virtual env -- I did a little bit of digging. I think fpm should be using the If we have to setup a virutal env, I accept that, but it may bring new challenges, and I'm not sure what side effects that may have (rewriting |
I'd like to understand more about this. It was not intended that older versions do not work. If I try myself on Ubuntu 22.04 in docker, python3 and wheel 0.37.1 (via dpkg/apt), packaging django fails: This error comes from fpm's python script that tries to parse the package's metadata. However, I see that installing django with pip directly works fine: If this error is something you were addressing by upgrading to Ubuntu 24.04, then this further confirms my belief that something about this is a bug in fpm or needs further investigation. |
|
My time is limited lately, but I'm attending to these as best I can. Most days I get maybe 30 minutes, usually less, to attend to any computer-related tasks, including open source issue investigations. |
Thanks! We really appreciate the help! |
|
Thanks so much for the helpful response @jordansissel!
I did some more digging, and I found that you are right that we don't need to use a virtual environment to solve this particular problem. I tried to change the
I will address the This is why these tests fail in the CI for
This error you got (and that I was able to reproduce) is actually a new problem that I hadn't seen before. As you mentioned, the error comes from the |
|
@jordansissel |
|
Howdy @jordansissel , currently this is our most important PR because it will fix the broken CI and allow us to move forward with lots of other fixes accordingly. If you are short on time nowadays then you can simply accept and merge this PR as-is safely, or if you have a few minutes then you can also review the changes we made to the FPM code related to packaging Python projects. Either way, it should be safe for you to merge this PR now so that we can get un-stuck. Thanks in advance! |
|
Noted! I’ll work on this as soon as I can. I appreciate the effort to stabilize github actions :)
…On Thu, Dec 4, 2025, at 10:43 AM, William N. Braswell, Jr. wrote:
*wbraswell* left a comment (jordansissel/fpm#2122) <#2122 (comment)>
Howdy @jordansissel <https://github.com/jordansissel> , currently this is our most important PR because it will fix the broken CI and allow us to move forward with lots of other fixes accordingly. If you are short on time nowadays then you can simply accept and merge this PR as-is safely, or if you have a few minutes then you can also review the changes we made to the FPM code related to packaging Python projects. Either way, it should be safe for you to merge this PR now so that we can get un-stuck. Thanks in advance!
—
Reply to this email directly, view it on GitHub <#2122 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABAF2QQ4XMYFEJOUPY4LLD4AB6D5AVCNFSM6AAAAACLJC25N6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMMJTHAZDGNZZGU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
@jordansissel |
This PR fixes the failing CI, solving issue #2121.
The reason the CI was failing is that Python
pyproject.tomlsupport was recently added to fpm, but the version of the Python wheel package that the Ubuntu 22.04 GitHub runner packaged was an older version that didn't have necessarypyproject.tomlsupport. This could have been solved by configuring the CI to use a Python venv then install the newer version ofwheelinto the venv. While I was already trying to fix the CI though, I thought we may as well update the runner to use the newer Ubuntu 24.04, which happens to also packages a newer version ofwheelthat haspyproject.tomlsupport.Updating to Ubuntu 24.04 caused a few more breakages though.
One breakage we got was that one of the deb tests creates a fake package with lsb-base as a dependency. The newer lintian version for Ubuntu 24.04 complains that this
lsb-basepackage is obsolete. I fixed this by changing the dependency to debconf as this package is unlikely to go obsolete any time soon.The other breakage was that Ubuntu 24.04 uses the PEP 668 feature of marking the Python system packages as
EXTERNALLY-MANAGED, and one of our test modules (click) was already installed into the system Python on the GitHub runner. When one of our tests went to installclickagain with pip we got the following failure:There were two solution I found for this. The first was to just use a different test package other than
clickthat wasn't already installed on the system. The other option (that I went with) was to setup a venv in the CI runner before running the test suite. I thought that using a venv was a more normal and correct solution that should continue to work moving forward regardless of changes to the CI runners Python environment. One side-effect of using a venv though is that the packaging package was not installed into the venv (tangentially related to issue #2118). This wasn't a problem before because the Ubuntu 22.04 runner happened to already have this installed. However,packagingisn't fpm's only Python package dependency, fpm also has a Python script lib/fpm/package/pyfpm/get_metadata.py that depends on simplejson unless we already have the core json package available. Further, fpm has a test Python script spec/fixtures/python/setup.py that depends on setuptools. This means that we have a test-specific Python dependency. There are two ways I thought of to solve this. The first is in the CI configuration after setting up the venv to just explicitly install these 3 packages:$ pip install setuptools packaging simplejson. The other solution that I went with is more complicated, and it is to add arequirements.txtfile to the root of the fpm repository, and arequirements.txtto thespec/directory for the test dependency. This makes it easy for fpm users to get their Python dependencies, while also making it easy to add new dependencies in the future. I do understand that this solution is more complicated and out of scope of simply fixing the CI, so I am very open to feedback. I added a short mention of this to the docs in the optional dependencies section of the installation manual.Let me know how everything looks and if you would like anything to be changed. Thanks!