poetry2nix icon indicating copy to clipboard operation
poetry2nix copied to clipboard

mkPoetryEnv without development dependencies

Open yajo opened this issue 2 years ago • 1 comments

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"

yajo avatar May 10 '22 12:05 yajo

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.

andersk avatar May 11 '22 00:05 andersk

AFAIK, mkPoetryEnv has a groups parameter, which defaults to [ "dev" ], so, is it still an issue for you @yajo @andersk ?

RaitoBezarius avatar Nov 18 '22 16:11 RaitoBezarius

AFAIK this is fixed since poetry 1.2 support landed. I'll close, we can reopen later otherwise.

yajo avatar Nov 21 '22 08:11 yajo

This appears to still be broken, I have groups = [] but it still installs development dependencies.

(Edit: As mentioned below, the fix is using checkGroups = [];)

nikhiljha avatar Apr 09 '23 22:04 nikhiljha

Indeed, I just noticed the same. In my case, while using mkPoetryApplication

yajo avatar Apr 12 '23 12:04 yajo

I fixed it in my case adding checkGroups = []; to the call to mkPoetryApplication. This is not documented though, so it could be one fix.

yajo avatar Apr 12 '23 12:04 yajo

I also ran into this issue. I tried the same for mkPoetryEnv, but there it fails: called with unexpected argument 'checkGroups'.

bobvanderlinden avatar Apr 26 '23 09:04 bobvanderlinden

Closed by #1648

cpcloud avatar May 08 '24 15:05 cpcloud