-
Notifications
You must be signed in to change notification settings - Fork 13
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
Rework of build system to use more modern standards #153
Conversation
Copr build succeeds on fedora now but fails for RHELs. It seems that it fails to parse Although based on the log, the build dependency should be there correctly and it actually does install later:
But very obviously the build system fails to parse the
Eventually this is the reason why the build inevitably fails because: Is this error on my side in configuring the spec file, or possibly an error somewhere else or a bug? |
Wow, that's a huge pile of good work, thank you! 🎉 I barely can concentrate enough - some of those changes would be better in separate PRs, but it doesn't make sense to overcomplicate this contribution now. Just pardon my rather quick or maybe wrong review notes (the context is too big). This is a low-prio note, as I do not maintain this anymore: it's a pity we are losing support for EPEL8+ with the new format of the upstream spec file. And if we drop the support here upstream, we drop CI for it, and it probably never gets updated in real EPEL in the future. |
# The full version, including alpha/beta/rc tags. | ||
release = dg_version | ||
release = get_version("distgen") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will provide invalid versions from git-head
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair, but so would the previous approach, right? When it was hardcoded to the file.
Using the https://pypi.org/project/setuptools-scm/ I mentioned above might help with this, right? Also, might make the custom version generation for push/PR builds in the copr script also redundant, as if the build is made from a commit that is not being tagged with version it will be based on commit hash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From git-head it worked fine, if the cwd is on python's path.
I totally agree, but splitting it at this point would just be extra work, I feel like. Originally it wasn't meant to be such a huge PR, but since the change of build system meant, so many linked changes in spec file, copr etc. it kinda just slowly got huge.
This wasn't my goal, tho. I actually didn't know it wouldn't work, and it seems like it kinda should? Since the spec file tries to build, see my comment above #153 (comment), but possibly fails due to missing I just went based on current Fedora docs and how are other python packages packaged. Anyway, I would love to keep the support for EPEL, but I will very probably need help. Or we can rethink whether the support for EPEL is required and whether |
The dynamic build dependencies is a relatively new thing in RPM ecosystem; you have to keep the good-old static buildrequires list. |
7a8665a
to
a4b4aa9
Compare
I'd be curious to see what the Python maintainers think about this approach :) have you tried to consult this? It seems that Python on RHEL 8 is not prepared for projects that moved to |
After further discussion with @phracek and mhroncok we came to a conclusion that due to a very outdated nature of EPELs and missing dependencies in EPEL built for python3.12 it would be too difficult to set it up with no additional benefit for us. We are not using Despite EPEL build being possible with the patches, they are not a clean solution and could create more complications down the road. EPEL build would also be possible using up-to-date version of python in RHEL8 and RHEL9, but this comes with a problem of missing dependencies ( Since there is no reason to support EPEL from DB team point of view, we will be dropping the support. Last commit of this PR reverts the EPEL support changes, resulting in a clean spec file only working on Fedora for now and no patches. |
And nobody else will be in the future 🤷 and that's what I think is a pity! Spoiler: /me is a distribution developer who always tries to integrate against the distributions we support (EPEL 7 is not in the equation, that's why I proposed #150). However many users care about EPEL 8+. And the support is cheaper than doing the move. Note that this tool has "distribution" in its name, yet we are opting-in to a development model that disallows us to ship "natively" into the distributions we support. "Doing nothing" for now (because there's no solution) is just as easy as #154, and while seemingly lame (but if there's no better python solution?) that's what I think is a reasonable compromise. But /me hides now. |
It is not, the move is already done via this PR, there is nothing to be done. On the other way, not doing the move will require us to revisit this again and again once more parts will be deprecated or removed. Using
It will require us to do more maintenance on a project down the road, which we are not prioritizing.
That's not entirely true. Only thing blocking If someone needs the EPEL support, it is possible to include it, and we can revisit this when such time comes. It is as easy as opening bugzilla ticket on |
My approach, or from my point of view, I would release version to PyPi and not to EPEL8,9 and let's use standard Python mechanism, in case customers would like to install distgen, then let's use directly PyPi works properly in all hosts, like RHEL9, RHEL8, CentOS 10 where python3.12 is already present. Let's support only up2date python versions. Lower versions are a bit outdated. |
While my vote is probably not important, I'm -1 for this PR as is, because it brings a distro drop for no real benefits, sorry. Yes, it is nice to use modern tooling, but it simply doesn't match the philosophy of this project (poor author's thought). This was a tool for distro developers, trying to make the distro differences smaller. Now we claim the distro differences are so big that it is impossible to package it, 🤷
I'm not in the same camp here; I prefer dogfooding RPMs wherever possible. |
Can you elaborate? I can't offer much more than what I gave to this project in the last years (= hobby time).
There's nothing blocking from it being packaged, it is already packaged :-)
What you describe is moving EPEL 8+ against Python 3.12, which seems not worth it (negatives: it brings non-standard python stack with itself when installed). |
The way
I'll paraphrase myself, those 3 things are blocking It is packaged in EPEL and what I am proposing is that it will stay in the EPEL in the same version it is now. And if someone actually uses the EPEL version and will be in the need of a newer version, they can file bugzilla and request the update, and we can revisit this. This is standard process with EPEL and there are a lot of packages that aren't updated in EPEL automatically.
I don't think It's unreasonable to want to use up-to-date python. Installing 'full new python stack' just doesn't seem as dramatic for me, it is 65 Mb installed size for python, pip and setuptools. And if I base this on our use case, they will have the newer python installed anyway for other packages, like we do for up to date PyTest. What I mean by this is that from my point of view, there is a high possibility that those users already have python3.12 installed if they already work with python or use other python libraries/tools. And if you really needed up to date How I see this migration is that we do it once and correctly to prevent the need to revisit this once deprecated features get removed and/or legacy features get deprecated. What I feel from any other approach to this is that it is just bandaging the app instead of moving it forward. None of those changes are bleeding edge either, the blog post informing about From how I see this, the way |
This is so ineffective, and this is not a "battle" I want/need to win! So I There's no need to hurry with this, there's no immediate problem (#154 is |
After further discussion within the team, a new This will allow EPEL to build using the older practices while keeping the main branch and 'default' up to date. Since the code of By doing this we can still push updates for EPEL, while not having to deal with potentially more breaking changes in Legacy will continue to be versioned '1.x', main will follow new major version '2.x'. This will allow us to also still do releases for both branches as PyPi should be able to pick the highest compatible version - so in case user installs |
I don't think this is needed. Nobody will ever update it, because it will be legacy. I think there's no need to waste the effort because of me, at least.
Ok, merged then. |
As I promised, /me disappears now. So taking back this "wait" suggestion. Feel free to go. |
This commit will break copr builds for now. Also removes support for automatically generating man pages, since it is broken.
Change copr scripts and templated spec file
Also inform about module API change - removed version file
Some of the new functionalities that are present in Fedora and are needed for distgen to build using the refreshed build system are not present in EPEL. This means that we have to rollback some changes to allow build on EPEL. This shouldn't impact functionality of the application, but keeping it in the main repository would create mess in the codebase. For that reason the rollbacks are handled by patches in spec file.
This reverts commit a4b4aa9.
Fixes: #152
Fixes: #149
This PR will probably not work on first try and there will need to be modifications here and there.
I tried to modify as little as possible while also cleaning parts of the app. Some things that are not needed anymore are removed. This also includes changes to COPR configuration which should already be applied and cleanup of GitHub webhooks.
Documentation wasn't built since 2023, so the webhook was refreshed and
.readthedocs.yaml
file added. I think this should fix the automatic documentation build, as the absence of the configuration file was why the last build failed a year ago. (https://readthedocs.org/projects/distgen/builds/21386423/)Due to this modification, the spec file template for COPR had to be changed and spec file on https://src.fedoraproject.org/rpms/distgen will have to be changed as well.
Overview of changes:
pyproject.toml
fromsetup.py
setup.py
file as it is not needed and relying onpyproject.toml
for build onlypyproject.toml
fromsetup.cfg
flake8
not yet possible due to it being a bit flaky implementing support forpyproject.toml
configuration (see pyproject.toml (PEP 518) support PyCQA/flake8#234)__main__.py
is the CLI interface now,cli_parser.py
contains theArgumentParser
object onlydistgen
module importArgumentParser
object and gets all the information needed for manual page from that objectdistgen
CLI interface (which containsfrom distgen.X import X
), the process of loading the file in manpage generator triggers the import, which is not possible due todistgen
not being available during the build ofdistgen
bin/dg
todistgen/__main__.py
(Thanks for help @duzda)python -m distgen
to invoke the CLI interface and provides overall more standardized approach to modulesdistgen.__main__:main
as an entry point for scriptdg
inpyproject.toml
so preparingdg
as an executable and placing it in/bin
is done for us by the build systempyproject.toml
everywherecli_parser
usesversion()
function fromimportlib.metadata
, but also catches possible exceptiondistgen
module not being presentdg --version
, thedistgen
module is (obviously) present, so we use the version directly from the module metadatadistgen
if not this will have to be resolveddistgen
that is being built is also installed as a module, so the version is fetched bypython3 -m distgen --version | grep -o '[0-9]*\.[0-9]*'
setup.py sdist
can not be used anymore, and setup.py doesn't even exist now, the building process had to be reworked for fedora toodistgen
package is not installed when building and due to the more streamlined approach to the CLI interface, it is not possible to calldg
without the package being installed now.distgen
now and will use the currently built version of distgen to prepare the specfilepyproject.toml
)