Add support for poetry
as an optional, alternative packaging backend
#287
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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, whilepipenv
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 thanpipenv
(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 thatpoetry show --outdated
will always exit with a status code of0
, and thusinvenio-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
andpoetry
: It seems thatpoetry
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 viapython-dotenv
before executingpoetry
commands.Note: By default,
invenio-cli
will still usepipenv
.The configuration (
[cookiecutter]
) has to requestpackaging_backend = poetry
specifically to switch topoetry
.