mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 16:51:40 -05:00
Set src
to lib.cleanSource projectDir
by default
Ideally we'd use `nix-gitignore` but that one fails when there is no `.gitignore` file so it's not a sensible default.
This commit is contained in:
parent
fbb246c77a
commit
b85e2a6733
3 changed files with 6 additions and 7 deletions
|
@ -18,8 +18,8 @@ The _poetry2nix_ public API consists of the following attributes:
|
|||
|
||||
Creates a Python application using the Python interpreter specified based on the designated poetry project and lock files. `mkPoetryApplication` takes an attribute set with the following attributes (attributes without default are mandatory):
|
||||
|
||||
- **src**: project source.
|
||||
- **projectDir**: path to the root of the project.
|
||||
- **src**: project source (_default_: `lib.cleanSource projectDir`).
|
||||
- **pyproject**: path to `pyproject.toml` (_default_: `projectDir + "/pyproject.toml"`).
|
||||
- **poetrylock**: `poetry.lock` file path (_default_: `projectDir + "/poetry.lock"`).
|
||||
- **overrides**: Python overrides to apply (_default_: `[defaultPoetryOverrides]`).
|
||||
|
@ -29,7 +29,6 @@ Creates a Python application using the Python interpreter specified based on the
|
|||
#### Example
|
||||
```nix
|
||||
poetry2nix.mkPoetryApplication {
|
||||
src = lib.cleanSource ./.;
|
||||
projectDir = ./.;
|
||||
}
|
||||
```
|
||||
|
|
|
@ -145,8 +145,8 @@ let
|
|||
|
||||
/* Creates a Python application from pyproject.toml and poetry.lock */
|
||||
mkPoetryApplication =
|
||||
{ src
|
||||
, projectDir ? null
|
||||
{ projectDir ? null
|
||||
, src ? lib.cleanSource projectDir
|
||||
, pyproject ? projectDir + "/pyproject.toml"
|
||||
, poetrylock ? projectDir + "/poetry.lock"
|
||||
, overrides ? [ defaultPoetryOverrides ]
|
||||
|
@ -199,6 +199,8 @@ let
|
|||
pname = pyProject.tool.poetry.name;
|
||||
version = pyProject.tool.poetry.version;
|
||||
|
||||
inherit src;
|
||||
|
||||
format = "pyproject";
|
||||
|
||||
buildInputs = mkInput "buildInputs" buildSystemPkgs;
|
||||
|
|
|
@ -2,7 +2,5 @@
|
|||
|
||||
poetry2nix.mkPoetryApplication {
|
||||
python = python3;
|
||||
pyproject = ./pyproject.toml;
|
||||
poetrylock = ./poetry.lock;
|
||||
src = lib.cleanSource ./.;
|
||||
projectDir = ./.;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue