-
-
Notifications
You must be signed in to change notification settings - Fork 360
Fix warning and tests with packaging 26.0 #2159
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: master
Are you sure you want to change the base?
Fix warning and tests with packaging 26.0 #2159
Conversation
|
IMO, partially due to the fact that pip's build isolation is actually a hack and doesn't work correctly, a range of packaging needs to be supported. Otherwise, system libraries can leak in even when you've installed something newer in the fake build env. |
|
I could loosen hatchling's requirements, as I don't think this code is ever called by the build process. Or could just rework into a different approach. |
081466e to
045f919
Compare
|
Okay I've made the following changes:
Once packaging 26.0 is out and tests pass again I may need to also fix coverage tests. Question, does hatch expect this function is internal only or other projects are depending on it? As now on packaging 26.0 it will not mutate the underlying Version object, which may break expectations if there are dependencies on it? I could make a new function that hatch depends on, and wrap the old function in a deprecation warning the same as was done in packaging: https://github.com/pypa/packaging/pull/1062/files |
|
Looks better! One downside is the spacing changes mean that you can't run tests against an older packaging. Not sure if that's a problem here; if it is the tests could be made to ignore whitespace or replacement could be used (table will be a little harder. CC @ofek or @cjames23, no real rush though as it will still work with 26.0, just tests will fail with spacing changes and maybe warnings. |
This should be internal only but I can check some of the known plugins to see if anyone was utilizing this function |
Happy to do this is requirements by maintainers, not going to start making changes like that to the test suite on my own. Some of the tests would be easy to fix by using And if tests are fine to run on just the latest packaging we can wait until 26.0 releases next week. |
Packaging 26.0 is coming out shortly. Here's a blog on some of the performance improvements: https://iscinumpy.dev/post/packaging-faster/.
As part of this release a lot of internal objects were changed or removed, @henryiii noticed that dropping
._versionin pypa/packaging#995 causes failures in hatch (specifically I found it breaks bumping viahatch version), and has added a compatibility layer with a deprecation warning in pypa/packaging#1062.This PR does the following:
Bumps packaging 26 to the minimum version of packagingreset_version_partswith calls to the new__replace__API: feat: support__replace__forVersionpackaging#1003I've raised this PR in draft to see if this is the direction maintainers want to go in, and waiting on packaging 26.0 final (expected Monday). Let me know any feedback or questions.