Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for poetry as an optional, alternative packaging backend #287

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

max-moser
Copy link
Contributor

@max-moser max-moser commented Apr 4, 2022

pipenv has a history of... being difficult at times.poetry is the newish kid on the block, and looks quite promising.
I've had scenarios where poetry was able to lock the dependencies within seconds or minutes, while pipenv couldn't come up with any results in an hour.
As such, it would be nice to have the option to work with poetry rather than pipenv (if you know what you're doing).

This PR adds support for poetry for most of the operations as an alternative packaging tool.
One known issue in invenio-cli is that poetry show --outdated will always exit with a status code of 0, and thus invenio-cli will always report that all packages are up to date (even though the previous output clearly suggested the opposite).
Further, the handling of pre-release package versions is different between pipenv and poetry: It seems that poetry only accepts an --allow-prereleases flag when installing additional packages, but neither on locking nor installing dependencies from the lock file (which I feel makes sense).
Another notable difference is that poetry does not, by itself, read the environment variables from a .env file. This would have to be done in code, likely via python-dotenv before executing poetry commands.

Note: By default, invenio-cli will still use pipenv.
The configuration ([cookiecutter]) has to request packaging_backend = poetry specifically to switch to poetry.

@max-moser max-moser force-pushed the mm/poetry branch 2 times, most recently from 6fbc42b to 58a2196 Compare April 4, 2022 13:51
* the tool to be used can be changed in the cli configuration file
  (.invenio), in [cookiecutter] packaging_backend
* unless explicitly configured to use 'poetry', the fallback is still
  always 'pipenv'
@apirogov
Copy link

Just dropping by to say yes, please!

We're using poetry for our stuff, if there would be a way to get pipenv out of the equation and stick with one build tool, it would be great!

@max-moser
Copy link
Contributor Author

max-moser commented Mar 23, 2023

funny, i was thinking about closing this PR just a few days back 😄
but if there's still interest in this, i can have a further look

@apirogov
Copy link

We'd be quite happy to beta-test the "experimental" poetry-based instance setup once this is merged :)

At least I have some more experience dealing with the quirks of poetry, while all of us don't have experience with pipenv, adding up to the layers of abstraction Invenio introduces and we are just learning to navigate... 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants