poetry2nix
poetry2nix copied to clipboard
mkPoetryEnv without development dependencies
Describe the issue
While packaging an Env for further reuse, the development dependencies end up in the final package, but are not needed for production.
There should be a flag to avoid including them.
Additional context
I don't think this is strictly required because it happens on any project that has any development dependencies. Just putting here some samples:
-
default.nix
/shell.nix
/flake.nix
poetry2nix.mkPoetryEnv {
src = ./.;
};
-
pyproject.toml
# ...
[tool.poetry.dev-dependencies]
black = "^22.3.0"
Poetry 1.2.0a2 generalizes the dependencies
vs. dev-dependencies
split to arbitrary groups (so you might have prod
, dev
, test
, docs
, for example). It’d be nice for poetry2nix to provide ways to install a specific set of groups.
AFAIK, mkPoetryEnv
has a groups
parameter, which defaults to [ "dev" ]
, so, is it still an issue for you @yajo @andersk ?
AFAIK this is fixed since poetry 1.2 support landed. I'll close, we can reopen later otherwise.
This appears to still be broken, I have groups = []
but it still installs development dependencies.
(Edit: As mentioned below, the fix is using checkGroups = [];
)
Indeed, I just noticed the same. In my case, while using mkPoetryApplication
I fixed it in my case adding checkGroups = [];
to the call to mkPoetryApplication
. This is not documented though, so it could be one fix.
I also ran into this issue. I tried the same for mkPoetryEnv
, but there it fails: called with unexpected argument 'checkGroups'
.
Closed by #1648