poetry2nix icon indicating copy to clipboard operation
poetry2nix copied to clipboard

Extras functionality

Open cpcloud opened this issue 3 years ago • 4 comments

poetry supports the notion of an optional library/application dependency through the use of the extras feature. It would be swell if poetry2nix supported the ability to create an environment using something analogous to this feature to control what extras are in the environment.

Maybe this already exists and I'm just not seeing it!

cpcloud avatar Sep 23 '21 10:09 cpcloud

Extras are already supported implicitly since they are resolved in the lock file.

We even have a test case covering it: https://github.com/nix-community/poetry2nix/tree/master/tests/extras.

Did you encounter any problems using extras as-is?

adisbladis avatar Sep 30 '21 02:09 adisbladis

What I am looking for is a way to generate a poetry dev environment from a subset of my project's extras. It looks like the test you linked is testing extras from dependencies.

Does poetry support specifying extras for the project when generating an environment?

cpcloud avatar Sep 30 '21 03:09 cpcloud

What I am looking for is a way to generate a poetry dev environment from a subset of my project's extras. It looks like the test you linked is testing extras from dependencies.

I believe we currently treat optional dependencies as mandatory, so right now this isn't well supported. I would imagine extras being an argument accepted by mkPoetryPackages/mkPoetryEnv/mkPoetryApplication.

Does poetry support specifying extras for the project when generating an environment?

https://python-poetry.org/docs/pyproject/#extras

adisbladis avatar Sep 30 '21 03:09 adisbladis

What I am looking for is a way to generate a poetry dev environment from a subset of my project's extras. It looks like the test you linked is testing extras from dependencies.

I believe we currently treat optional dependencies as mandatory, so right now this isn't well supported. I would imagine extras being an argument accepted by mkPoetryPackages/mkPoetryEnv/mkPoetryApplication.

Does poetry support specifying extras for the project when generating an environment? Cool. https://python-poetry.org/docs/pyproject/#extras

Definitely aware of this already, I don't think I could have used this project successfully without being aware of extras :) this question was really just a restatement of my first question.

cpcloud avatar Sep 30 '21 03:09 cpcloud