diff --git a/README.md b/README.md index 0370112..6cce19f 100644 --- a/README.md +++ b/README.md @@ -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 = ./.; } ``` diff --git a/default.nix b/default.nix index 4ef35a6..7332f7b 100644 --- a/default.nix +++ b/default.nix @@ -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; diff --git a/tests/trivial/default.nix b/tests/trivial/default.nix index 7941317..a0797b4 100644 --- a/tests/trivial/default.nix +++ b/tests/trivial/default.nix @@ -2,7 +2,5 @@ poetry2nix.mkPoetryApplication { python = python3; - pyproject = ./pyproject.toml; - poetrylock = ./poetry.lock; - src = lib.cleanSource ./.; + projectDir = ./.; }