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;
|
isSource = source != null;
|
||||||
isGit = isSource && source.type == "git";
|
isGit = isSource && source.type == "git";
|
||||||
isUrl = isSource && source.type == "url";
|
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";
|
isLegacy = isSource && source.type == "legacy";
|
||||||
localDepPath = toPath source.url;
|
localDepPath = toPath source.url;
|
||||||
|
|
||||||
|
@ -97,7 +98,7 @@ pythonPackages.callPackage
|
||||||
"toml" # Toml is an extra for setuptools-scm
|
"toml" # Toml is an extra for setuptools-scm
|
||||||
];
|
];
|
||||||
baseBuildInputs = lib.optional (! lib.elem name skipSetupToolsSCM) pythonPackages.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
|
in
|
||||||
buildPythonPackage {
|
buildPythonPackage {
|
||||||
pname = moduleName name;
|
pname = moduleName name;
|
||||||
|
@ -121,7 +122,7 @@ pythonPackages.callPackage
|
||||||
baseBuildInputs
|
baseBuildInputs
|
||||||
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) pythonPackages.setuptools
|
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) pythonPackages.setuptools
|
||||||
++ lib.optional (!isSource) (getManyLinuxDeps fileInfo.name).pkg
|
++ lib.optional (!isSource) (getManyLinuxDeps fileInfo.name).pkg
|
||||||
++ lib.optional isLocal buildSystemPkgs
|
++ lib.optional isDirectory buildSystemPkgs
|
||||||
++ lib.optional (!__isBootstrap) pythonPackages.poetry
|
++ lib.optional (!__isBootstrap) pythonPackages.poetry
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -173,8 +174,10 @@ pythonPackages.callPackage
|
||||||
{
|
{
|
||||||
inherit (source) url;
|
inherit (source) url;
|
||||||
}
|
}
|
||||||
else if isLocal then
|
else if isDirectory then
|
||||||
(poetryLib.cleanPythonSources { src = localDepPath; })
|
(poetryLib.cleanPythonSources { src = localDepPath; })
|
||||||
|
else if isFile then
|
||||||
|
localDepPath
|
||||||
else if isLegacy then
|
else if isLegacy then
|
||||||
fetchFromLegacy
|
fetchFromLegacy
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue