-
-
Notifications
You must be signed in to change notification settings - Fork 295
Un-pin hatchling. #2408
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
Un-pin hatchling. #2408
Conversation
Although hatchling fixed a few issues that broke Pex packaging, it has since more strictly adhered to PEP-621 which breaks the existing project metadata customization scheme. Update the scheme to conform to PEP-621 strictures. Also update the tox configuration to work with modern hatchling.
[tool.hatch.metadata.hooks.pex-adjust-metadata.project] | ||
requires-python = ">=2.7,<3.13,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" | ||
|
||
[tool.hatch.metadata.hooks.pex-adjust-metadata.project.urls] | ||
Changelog = "https://github.com/pex-tool/pex/blob/v{pex_version}/CHANGES.md" | ||
Documentation = "https://docs.pex-tool.org/" | ||
Download = "https://github.com/pex-tool/pex/releases/download/v{pex_version}/pex" | ||
Homepage = "https://github.com/pex-tool/pex" | ||
Source = "https://github.com/pex-tool/pex/tree/v{pex_version}" | ||
|
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.
I think this effective move of the project metadata for requires-version and urls from below to here helps underline how the PEPs missed the boat here by not just saying dynamic trumps static, allowing the dynamic code to run; yet use standard static metadata as part of its inputs. This minor hoop I jumped through seems gratuitous on behalf of the spec. @ofek I know you're just doing your job implementing the spec.
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.
Although it is true that I'm trying to adhere to the spec, I was actually the first to implement it and was part of the design! I definitely understand your perspective and I can't go through the threads right now but there was a good reason for doing so. I think it had something to do with resolvers not being able to depend on data and thus being forever unable to use the metadata directly within source distributions and therefore require building during resolution in many cases.
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 is great, thanks for fixing the tox issue! I was thinking of somehow defining the environment variable conditionally outside of tox but your solution is much better. I asked the maintainer Bernát in Discord and it looks like there is a build step that happens first which all environments then use. Just a heads up, this would have worked out of the box with Hatch because builds happen with access to the environment variables of the individual environments 😄
Yeah, I find tools like pdm, poetry, hatch, etc do too much, which is exactly what most people like. I just want an sdist / wheel builder and I like the extreme simplicity of tox / nox / etc. Hatchling was attractive because of the clean means to plug in; that's why I switched to it after having some issues with setuptools leaking .egg-info cruft. |
I agree that Poetry does too much/hard to determine the behavior. Since I am currently finishing up the slides for my talk at PyCon, have you seen this comparison? I added the page a few months ago: https://hatch.pypa.io/latest/why/#environment-management Here is an example of the difference in config:
|
@ofek I haven't. That said, I really detest the current state of the PyPA. Good people, horrible system of doing business. There is a new tool and a new packaging PEP a few times a year. Until PyPA merges back into core Python and Python owns shipping a toolset and not just the cpython interprter (in other words one official tool set), I will not thrash. Hopefully someone with pull cries uncle and this merger of PyPA back into core python happens and the PSF strong-arms the platinum sponsors to fork over ~10 million or whatever it takes to dedicate the resources to kick out this sort of thing in a ~short time - say 5 years. |
Jotting down my thoughts while I have a few minutes, I really appreciate your openness for discussion!
edit: not really you, but generally speaking when people talk about the sorry state of Python packaging currently it reminds me of the paper Prevalence-induced concept change in human judgment |
I get the same impression. What I'm pointing out is the effort to work around the problem presented by CPython suffers from not confronting the problem head on and fixing that core problem. Forking off the PyPA has allowed (slow) forward progress, but at the cost of the necessary evil (in my opinion) of having to focus on standards generation instead of just implementing one. In other words, without the official backing of CPython you can't ship 1 toolset alongside CPython releases. You must, instead, try to cajole the organic ecosystem of tools onto a set of standards. You appear to accept the rules of that game. I question those rules as being the right ones. My personal number one rule though is you can't have an opinion unless you have skin in the game. Here I'm in an awkward spot. I have skin in the game being a middleman between the current state of PyPA and Python ecosystem users experiencing packaging problems, but I don't have skin in the game in terms of getting involved in the PyPA / CPython / PSF and trying to change what I see as a misguided direction. That would require many years of effort that I'm not willing to put in at this point in my life. At 52 with my priority being rock climbing, I only have time to help finish Wickman's original Pex vision started in 2010. So I'm definitely solidly in the bitching category by my own standards, and you shouldn't listen to people who are doing that!
Oh, I have no issue with the PEPs individually, and I don't see them as being backward incompatible. As mentioned above I disagree with the PEPs on a more basic level. They encourage many tools to be compatible and I don't want many tools. I just want one official toolset with the PEPs maybe serving as public design doc records, but not serving as the spring board for 1000 tools. |
Thank you! |
Although hatchling fixed a few issues that broke Pex packaging, it has
since more strictly adhered to PEP-621 which breaks the existing project
metadata customization scheme. Update the scheme to conform to PEP-621
strictures. Also update the tox configuration to work with modern
hatchling.
Picks up from #2403 by @ofek