Skip to content
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

update-python-libraries: migrate git revs to tag #362222

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

mweinelt
Copy link
Member

@mweinelt mweinelt commented Dec 5, 2024

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@nix-owners nix-owners bot requested a review from natsukium December 5, 2024 22:29
@github-actions github-actions bot added the 6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions label Dec 5, 2024
@nix-owners nix-owners bot requested review from infinisil and philiptaron December 5, 2024 22:32
@philiptaron philiptaron requested a review from Atemu December 5, 2024 22:47
Copy link
Member

@Atemu Atemu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very familiar with this part of Nixpkgs but it looks sane to me at a glance.

Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the Python. 🐍

@wegank wegank added the 12.approvals: 2 This PR was reviewed and approved by two reputable people label Dec 5, 2024
@philiptaron philiptaron merged commit f917502 into NixOS:master Dec 6, 2024
22 of 23 checks passed
@mweinelt
Copy link
Member Author

mweinelt commented Dec 6, 2024

Hey, can we please give codeowners time to review and merge? Thank you.

@mweinelt mweinelt deleted the python-updater-git-tags branch December 6, 2024 16:31
@philiptaron
Copy link
Contributor

Hey, can we please give codeowners time to review and merge? Thank you.

My apologies for jumping the metaphorical gun.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/statistics-on-nixpkgs-prs-over-time/55916/14

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/statistics-on-nixpkgs-prs-over-time/55916/17

@natsukium
Copy link
Member

Thanks for working on and reviewing this change!
I just found the context for this PR. I think it's fine.

@@ -496,7 +496,7 @@ def _update_package(path, target):
else:
# forcefully rewrite rev, incase tagging conventions changed for a release
match = matches[0]
text = text.replace(match, f'rev = "refs/tags/{prefix}${{version}}";')
text = text.replace(match, f'tag = "{prefix}${{version}}";')
Copy link
Member Author

@mweinelt mweinelt Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing this now, we should unquote and then not interpolate the version, when the prefix is empty.

@zowoq
Copy link
Contributor

zowoq commented Dec 24, 2024

@mweinelt Seems this is blocking a lot of nixpkgs-update python packages updates, migrating the src to tag works but it then fails trying to eval src.rev in meta.changelog.

@Atemu
Copy link
Member

Atemu commented Dec 24, 2024

That's a good time to stop doing that; you shouldn't assume anything about src other than that it's a path.

You might need to switch between rev and tag on updates or users may override src with anything they like.

Depending on src's internals feels like a layer violation to me.

@zowoq
Copy link
Contributor

zowoq commented Dec 24, 2024

That's a good time to stop doing that; you shouldn't assume anything about src other than that it's a path.

The assumption is that meta evaluates, using the same method that is enforced by nixpkgs CI.

@Atemu
Copy link
Member

Atemu commented Dec 24, 2024

Sorry, I what I wrote was ambiguous: To stop depending on src.tag in meta; specifically depending on any internal state of src at all.

You'd necessarily need to pass the tag to the "constructor" of src anyways, so simply re-use that same declaration for changelog instead.

@zowoq
Copy link
Contributor

zowoq commented Dec 24, 2024

Perhaps what I wrote was also ambiguous or maybe we're just talking past each other: nixpkgs-update doesn't depend on src for meta. The issue is that sometimes the migration of a python package from rev to tag is incomplete.

@Atemu
Copy link
Member

Atemu commented Dec 24, 2024

Yes and the cause of that is the layer violation I talked about; depending on an internal property of src. If that property changes, breakage occurs. Therefore, you should not depend on the internal property.

@zowoq
Copy link
Contributor

zowoq commented Dec 24, 2024

Yeah, I think we're just talking past each other.

@mweinelt
Copy link
Member Author

@mweinelt Seems this is blocking a lot of nixpkgs-update python packages updates, migrating the src to tag works but it then fails trying to eval src.rev in meta.changelog.

Thanks, I'll have a look in the next few days.

@mweinelt
Copy link
Member Author

Not forgotten, but not so straightforward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 12.approvals: 2 This PR was reviewed and approved by two reputable people
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants