mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-05 09:11:39 -05:00
Fall back to old behaviour for git references, prefer resolved_reference
This commit is contained in:
parent
ef9935c98c
commit
74d3b4ff1c
2 changed files with 7 additions and 2 deletions
|
@ -23,6 +23,11 @@ parser_lock.add_argument(
|
||||||
|
|
||||||
|
|
||||||
def fetch_git(pkg):
|
def fetch_git(pkg):
|
||||||
|
try:
|
||||||
|
reference = pkg["source"]["resolved_reference"]
|
||||||
|
except KeyError:
|
||||||
|
reference = pkg["source"]["reference"]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
pkg["name"],
|
pkg["name"],
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
|
@ -32,7 +37,7 @@ def fetch_git(pkg):
|
||||||
"--url",
|
"--url",
|
||||||
pkg["source"]["url"],
|
pkg["source"]["url"],
|
||||||
"--rev",
|
"--rev",
|
||||||
pkg["source"]["resolved_reference"],
|
reference,
|
||||||
],
|
],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
|
|
|
@ -157,7 +157,7 @@ pythonPackages.callPackage
|
||||||
(
|
(
|
||||||
builtins.fetchGit {
|
builtins.fetchGit {
|
||||||
inherit (source) url;
|
inherit (source) url;
|
||||||
rev = source.resolved_reference;
|
rev = source.resolved_reference or source.reference;
|
||||||
ref = sourceSpec.branch or sourceSpec.rev or sourceSpec.tag or "HEAD";
|
ref = sourceSpec.branch or sourceSpec.rev or sourceSpec.tag or "HEAD";
|
||||||
}
|
}
|
||||||
) else if isLocal then (poetryLib.cleanPythonSources { src = localDepPath; }) else
|
) else if isLocal then (poetryLib.cleanPythonSources { src = localDepPath; }) else
|
||||||
|
|
Loading…
Add table
Reference in a new issue