mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
update-python-libraries: migrate git revs to tag (#362222)
This commit is contained in:
commit
f9175022d6
3 changed files with 4 additions and 3 deletions
|
@ -157,6 +157,7 @@ nixos/modules/installer/tools/nix-fallback-paths.nix @NixOS/nix-team @raitobeza
|
||||||
# Python-related code and docs
|
# Python-related code and docs
|
||||||
/doc/languages-frameworks/python.section.md @mweinelt @natsukium
|
/doc/languages-frameworks/python.section.md @mweinelt @natsukium
|
||||||
/maintainers/scripts/update-python-libraries @mweinelt @natsukium
|
/maintainers/scripts/update-python-libraries @mweinelt @natsukium
|
||||||
|
/pkgs/by-name/up/update-python-libraries @mweinelt @natsukium
|
||||||
/pkgs/development/interpreters/python @mweinelt @natsukium
|
/pkgs/development/interpreters/python @mweinelt @natsukium
|
||||||
/pkgs/top-level/python-packages.nix @natsukium
|
/pkgs/top-level/python-packages.nix @natsukium
|
||||||
/pkgs/top-level/release-python.nix @natsukium
|
/pkgs/top-level/release-python.nix @natsukium
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -I nixpkgs=channel:nixpkgs-unstable -i bash -p "python3.withPackages (ps: with ps; [ packaging requests ])" -p nix-prefetch-git
|
#!nix-shell -I nixpkgs=channel:nixpkgs-unstable -i bash -p "python3.withPackages (ps: with ps; [ packaging requests ])" -p nix-prefetch-git
|
||||||
exec python3 pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py $@
|
exec python3 pkgs/by-name/up/update-python-libraries/update-python-libraries.py $@
|
||||||
|
|
|
@ -486,7 +486,7 @@ def _update_package(path, target):
|
||||||
if fetcher == "fetchFromGitHub":
|
if fetcher == "fetchFromGitHub":
|
||||||
# in the case of fetchFromGitHub, it's common to see `rev = version;` or `rev = "v${version}";`
|
# in the case of fetchFromGitHub, it's common to see `rev = version;` or `rev = "v${version}";`
|
||||||
# in which no string value is meant to be substituted. However, we can just overwrite the previous value.
|
# in which no string value is meant to be substituted. However, we can just overwrite the previous value.
|
||||||
regex = r"(rev\s+=\s+[^;]*;)"
|
regex = r"((?:rev|tag)\s+=\s+[^;]*;)"
|
||||||
regex = re.compile(regex)
|
regex = re.compile(regex)
|
||||||
matches = regex.findall(text)
|
matches = regex.findall(text)
|
||||||
n = len(matches)
|
n = len(matches)
|
||||||
|
@ -496,7 +496,7 @@ def _update_package(path, target):
|
||||||
else:
|
else:
|
||||||
# forcefully rewrite rev, incase tagging conventions changed for a release
|
# forcefully rewrite rev, incase tagging conventions changed for a release
|
||||||
match = matches[0]
|
match = matches[0]
|
||||||
text = text.replace(match, f'rev = "refs/tags/{prefix}${{version}}";')
|
text = text.replace(match, f'tag = "{prefix}${{version}}";')
|
||||||
# incase there's no prefix, just rewrite without interpolation
|
# incase there's no prefix, just rewrite without interpolation
|
||||||
text = text.replace('"${version}";', "version;")
|
text = text.replace('"${version}";', "version;")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue