-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[FR] Suggestion for 2 phase deprecation system from community #4915
Comments
If the problem is that deprecation warnings are ignored1 (by tools, humans, or both), I'm unsure how this is an improvement. The deprecations in the first phase would continue to be ignored in CI logs until errors are raised. When errors are raised in the second "phase", carve-outs for behavior would need to be shimmed in for an undetermined amount of time, likely just pushing the pain into the future. What about errors that can't simply be quieted down to warnings? How many versions would this Footnotes
|
When switching over to the second phase, we should ensure that the libraries helper functions are prepared for the change. One of the challenges of the #4910 issue today, was libraries without an explicit setup.cfg files failed, even though they use the libraries provided setup function from |
Hi @david-engelmann could you please name which projects without Is this because a dependency had the problem? I want to understand this other scenario. If they failed because a dependency failed I would still consider a problem exclusive to Please note that setuptools does not have control of the installation of dependencies. |
@abravalheri here is the repos issue related to #4910 -> olirice/alembic_utils#153 (comment). basically, the repo uses just a setup.py file, which calls the |
Imo, this is more of a sin of the build system standard implicitly installing the latest version of setuptools. I don't really mind there was a breaking change in abstract. I do mind that the transitive dependency of setuptools that I have zero control over (and not in my |
Yeah, the fact that poetry can't pickup a setuptools version with a simple pyproject.toml change is a major part of the resolution issue, and I was just lucky I could include the below commands before my main poetry install command
I still think regardless, if a breaking change is pushed, the helper functions should be able to handle it, or depreciate those functions |
@david-engelmann yep, which leads to the implication that reproducible builds aren't possible... I'm honestly shocked that build systems exist "outside" a package rather than being part of it. I'm not sure how setuptools can have any sort of deprecation without some sort of agreement that starting today, we all put constraints on our |
This comment has been minimized.
This comment has been minimized.
IMO, the specifics of todays changes are irrelevant for this issue |
This comment has been minimized.
This comment has been minimized.
Reproducible builds are possible, linux distros have been doing them for a while. Pip is not involved, and build isolation is explicitly shunned. Constraints don't help, by the way. New versions of setuptools are sometimes mandatory in order to support new versions of CPython. Keeping software usable over the course of years and decades is a challenging job. Linux distros have managed for a long time, including by reserving the right to apply patches to software in order to keep it building. Sometimes those patches are to remove constraints ;) and other times it is to fix deprecated and removed API usage. |
It seems like the current state of the art in deprecations for setuptools development is to have no errors, just deprecations, for a very long period of time until the setuptools developers eventually decide they have "had enough", on the scale of a few years. The problem is apparently that nobody notices them until the very end. Switching over to a SETUPTOOLS_DEPRECATIONS variable, as the suggestion was given, doesn't affect the several years long timeframe at all... it would mean that you'd start getting errors after only a few months, but still have several years to band-aid the problem in order to get things working. I don't really see how that adds any more "wildly complex" maintenance, or makes the problem worse from a perspective of these deprecations being overall desirable. |
My "wildly complex" wording refers only to the scenario that these backdoors for old behavior exist forever for all removals or breaking changes. That seems obviously bad, or at very least underspecified. |
It is approximately as bad / underspecified as any software that periodically adds additional features but doesn't tend to drop features. Software becomes more complex and also more capable. It's just yet another software development philosophy. But that's irrelevant either way. You're the first person in this ticket to suggest that this ticket may entail keeping it forever, so maybe the answer to your question about scenarios is to simply recant that entire line of thought and instead talk about the actual proposal of the ticket. For the record I do apologize for initially being confused, and thinking that you had a question about the proposal, and seeking to explain it. |
I have an utmost respect for As for the deprecation process: I think that the proposed process is helpful. Especially the second phase, where you raise an error (which causes people to notice the change), but also provide an easy way to silence it before it's resolved. This is important because people can continue with their work and resolve the problem when they have more time for it. If they just set the silencer and don't fix it, well, than that's on them when the feature is finally removed. However, I think people can already implement this with appropriately aggressive setting of |
Thank you @stinovlas for both the kind words towards the Presumably something along the lines of 'error:::setuptools' or similar. I am not a |
To put numbers on it: support for PEP 517 started in version 40.8.0, but in my testing, 41.1.0 is required for Python 3.11. Python 3.12 made much more disruptive changes (both the removal of distutils and the reform of the (Honestly, I don't think that legacy projects - the kind that never even had a |
v68.1.0 is the first version of setuptools that had non-experimental support for pyproject.toml as a replacement for setup.cfg This is a considerably more pessimized timeframe than your reference to 40.8.0 PEP 517 means very little here as no meaningful changes need or needed be made by projects for it. The specification itself already mandates that the absence of PEP 517 metadata means to invoke the setuptools PEP 517 backend, explicitly spelling it out does nearly nothing. (If you think it does something, I invite you to look at the setuptools source code and see the actual difference between the legacy and regular build_meta APIs.) |
@maxfenv: I'd personally go for |
FWIW I am pushing to have pip output warnings, I am hoping to get this done in time for pip 24.2 (~July release). However, as you have mentioned, users will then need to read those warnings, but it's at least a step forward. There will need to be further improvement in tooling, and best practices will need to be formed, for users of sdists using build backends that make backwards incompatible changes. |
I was just looking into another deprecation and realized that I was using the And so I verified that the following surfaces the warnings just fine: I think that the problem is that it is not recommended by the docs loudly enough. And so I also wanted to suggest having a How-to guide-style document in the docs. I think that such a document should demonstrate a combination of two or three things:
The last point could feature pip-tools' This would show This could explain how to react to deprecations in a transactional manner. P.S. OTOH, a better place for such a guide might be PyPUG as it could be generic enough. And setuptools could link that external guide. |
Thank you @webknjaz. It is early stages, but I have been considering writing something like (it should expand, this is a very very early draft): I imagine that https://packaging.python.org/guides/sdist-drawbacks-and-reproducibility would be a nice place to include it? (then we can link it elsewhere). Just for the clarification: Setuptools try to be as responsive as possible, but it cannot guarantee disruptions will not happen and most importantly it cannot guarantee patches will be applied immediately ("zero-downtime" is not possible). If a project cannot afford waiting for setuptools patches, it is highly recommended to revise the use of (Sorry for the other participants in the thread. I have not able to go through all the comments yet. So far, what I have been thinking is that a 2-phase deprecation may be beneficial as it allows the users to "temporarily revert" a removal themselves, while making sure the acknowledge the long term risk). |
... and if you have automated your builds with CI/CD, then the deprecation warnings got lost in noise and CI logs that nobody reads.
#4892 and #4910 are a clear indication that setuptool's current deprecation system and policy is not working for the community. Even your own CI detected a problem with this deprecation. You disabled the failing test in #4909 instead of reconsidering the root cause for the failing test.
I suggest that you adopt a multi-phase deprecation system. In the first phase you issue a warning and document the deprecation. In the second phase you turn the deprecation warning into an error, but have a setting (environment variable) that turns the exception back into a warning. The setting is bound to a version number, e.g.
SETUPTOOLS_DEPRECATIONS=77.0.0
.Originally posted by @tiran in #4911 (comment)
The text was updated successfully, but these errors were encountered: