Repository navigation
python3Packages.pythonMetadataCheckHook: init - #532778
Conversation
Sigmanificient
left a comment
There was a problem hiding this comment.
i did not know this could be checked. interesting!
|
Enabled by default with a knob to disable. These things are important and too easy to miss. |
|
|
I'm super annoyed by the number of |
|
What would you prefer? |
|
e.g. and you get an error, if no such hook exists. And the hooks point to that option to disable them, when it fails. |
|
Sounds good to me, but is this the right place to start such a thing? EDIT: Though making |
|
Nah, it's not. This is just my aversion to these lengthy env vars. |
6b60bee to
001e7bd
Compare
001e7bd to
130558d
Compare
|
Should this apply to |
|
Yeah, makes only really sense for libraries to enforce it. |
130558d to
a550a30
Compare
Which means |
|
Should the hook be skipped if |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
This change fixes `nix build .#sage`. The regression is due to a new check, pythonMetadataCheckHook, introduced in NixOS#532778; the check enforces that pname matches the metadata name of the underlying Python project being built, typically in pyproject.toml; in this case the underlying name is "sagemath".
This change fixes `nix build .#sage`. The regression is due to a new check, pythonMetadataCheckHook, introduced in NixOS#532778; the check enforces that pname matches the metadata name of the underlying Python project being built, typically in pyproject.toml; in this case the underlying name is "sagemath".
nixpkgs added validation to check the specified vs built version some ~20 days ago: [NixOS/nixpkgs#532778](NixOS/nixpkgs#532778) This change make our version work with it
|
Hi @dotlambda
I believe this is due to a wrong pname but the error does not happen when building only |
|
@vncsb python3Packages.bloodhound-py should be called python3Packages.bloodhound and its pname needs to be fixed |
…cript Since #532778 we enforce the correct pname.
…cript Since #532778 we enforce the correct pname.
…cript Since #532778 we enforce the correct pname.
PR NixOS#532778 added `pythonMetadataCheckPhase`, which [raised][1] the mismatch between upstream's GitHub repository name and the `project.name` they use in their `pyproject.toml`. They started using `parsnip-cif` [long ago][2], before the package was [added to nixpkgs][3]. [1]: https://hydra.nixos.org/build/350404512/step/1/log [2]: glotzerlab/parsnip@6eb4017 [3]: NixOS@f1f6b55
PR NixOS#532778 added `pythonMetadataCheckPhase`, which would have raised the mismatch between upstream's GitHub repository name and the `project.name` they use in their `pyproject.toml`. They started using `freud-analysis` first in [3.2.0], so this rename should have been part of the [3.1.0 -> 3.3.1 version bump][2]. [1]: glotzerlab/freud@486a82c [2]: NixOS@4c8c77b
PR NixOS#532778 added `pythonMetadataCheckPhase`, which [raised][1] the mismatch between upstream's GitHub repository name and the `project.name` they use in their `pyproject.toml`. They started using `parsnip-cif` [long ago][2], before the package was [added to nixpkgs][3]. [1]: https://hydra.nixos.org/build/350404512/step/1/log [2]: glotzerlab/parsnip@6eb4017 [3]: NixOS@f1f6b55
PR NixOS#532778 added `pythonMetadataCheckPhase`, which would have raised the mismatch between upstream's GitHub repository name and the `project.name` they use in their `pyproject.toml`. They started using `freud-analysis` first in [3.2.0], so this rename should have been part of the [3.1.0 -> 3.3.1 version bump][2]. [1]: glotzerlab/freud@486a82c [2]: NixOS@4c8c77b
This hook is supposed to check (for now) that the version in
*.dist-info/METADATAis the same as what's specified in the derivation.The rationale for this is that a
pyproject.tomloften specifiesdynamic = ["version"]which leads to a version of0.0.0unless patched manually.Since the hook uses
importlib.metadata.version("$pname")it also checks that the pname is plausible (it could belong to a dependency instead). But doesn't check whether it's correctly normalized.In the future the hook can compare even more metadata.
Note that e.g.
importlib.metadata.version('flit-core')works because the function normalizes the distribution name toflit_core.Questions to answer:
pythonRuntimeDepsCheckHookwhich parsesMETADATAmanually?Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.