mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 16:51:40 -05:00
Add support for local files
This commit is contained in:
parent
e40e8ed0e8
commit
2eb8329319
1 changed files with 7 additions and 4 deletions
|
@ -47,7 +47,8 @@ pythonPackages.callPackage
|
|||
isSource = source != null;
|
||||
isGit = isSource && source.type == "git";
|
||||
isUrl = isSource && source.type == "url";
|
||||
isLocal = isSource && source.type == "directory";
|
||||
isDirectory = isSource && source.type == "directory";
|
||||
isFile = isSource && source.type == "file";
|
||||
isLegacy = isSource && source.type == "legacy";
|
||||
localDepPath = toPath source.url;
|
||||
|
||||
|
@ -97,7 +98,7 @@ pythonPackages.callPackage
|
|||
"toml" # Toml is an extra for setuptools-scm
|
||||
];
|
||||
baseBuildInputs = lib.optional (! lib.elem name skipSetupToolsSCM) pythonPackages.setuptools-scm;
|
||||
format = if isLocal || isGit || isUrl then "pyproject" else fileInfo.format;
|
||||
format = if isDirectory || isGit || isUrl then "pyproject" else fileInfo.format;
|
||||
in
|
||||
buildPythonPackage {
|
||||
pname = moduleName name;
|
||||
|
@ -121,7 +122,7 @@ pythonPackages.callPackage
|
|||
baseBuildInputs
|
||||
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) pythonPackages.setuptools
|
||||
++ lib.optional (!isSource) (getManyLinuxDeps fileInfo.name).pkg
|
||||
++ lib.optional isLocal buildSystemPkgs
|
||||
++ lib.optional isDirectory buildSystemPkgs
|
||||
++ lib.optional (!__isBootstrap) pythonPackages.poetry
|
||||
);
|
||||
|
||||
|
@ -173,8 +174,10 @@ pythonPackages.callPackage
|
|||
{
|
||||
inherit (source) url;
|
||||
}
|
||||
else if isLocal then
|
||||
else if isDirectory then
|
||||
(poetryLib.cleanPythonSources { src = localDepPath; })
|
||||
else if isFile then
|
||||
localDepPath
|
||||
else if isLegacy then
|
||||
fetchFromLegacy
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue