mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 16:51:40 -05:00
Fix determining sourceSpec for git dependencies in pyproject.toml
Fixes #702
This commit is contained in:
parent
539423bbf9
commit
5ae5d85e56
2 changed files with 10 additions and 5 deletions
10
default.nix
10
default.nix
|
@ -182,7 +182,15 @@ lib.makeScope pkgs.newScope (self: {
|
|||
source = pkgMeta.source or null;
|
||||
files = lockFiles.${name};
|
||||
pythonPackages = self;
|
||||
sourceSpec = pyProject.tool.poetry.dependencies.${underscorify pkgMeta.name} or pyProject.tool.poetry.dev-dependencies.${underscorify pkgMeta.name} or { };
|
||||
# Packages can be specified with underscores in pyproject.toml; check for
|
||||
# both possibilities.
|
||||
sourceSpec = with pyProject.tool.poetry; (
|
||||
dependencies.${pkgMeta.name} or
|
||||
dependencies.${underscorify pkgMeta.name} or
|
||||
dev-dependencies.${pkgMeta.name} or
|
||||
dev-dependencies.${underscorify pkgMeta.name} or
|
||||
{ }
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -172,10 +172,7 @@ pythonPackages.callPackage
|
|||
rev = source.resolved_reference or source.reference;
|
||||
ref = sourceSpec.branch or (if sourceSpec ? tag then "refs/tags/${sourceSpec.tag}" else "HEAD");
|
||||
} // (
|
||||
let
|
||||
nixVersion = builtins.substring 0 3 builtins.nixVersion;
|
||||
in
|
||||
lib.optionalAttrs ((sourceSpec ? rev) && (lib.versionAtLeast nixVersion "2.4")) {
|
||||
lib.optionalAttrs ((sourceSpec ? rev) && (lib.versionAtLeast builtins.nixVersion "2.4")) {
|
||||
allRefs = true;
|
||||
}
|
||||
))
|
||||
|
|
Loading…
Add table
Reference in a new issue