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
Migrate from Pipenv to Poetry #61
Comments
I think with the libs, poetry does make a lot more sense than using pipenv. We're still getting the benefits we want, the only prior concern was with cli entrypoint scripts, however considering you only really need to invoke a module for the existing ones ( |
Merged into #60 |
Using Python
Not sure if this is worth making its own issue for. Thought it was related, so I'm sharing here instead. Could potentially be related to #85 |
Can you please make a new issue? This isn't really related. |
I'd like to propose for discussion migrating the management of the developer environment from Pipenv to Poetry.
I've created a branch with a complete migration of the project for investigation here: https://github.com/python-discord/flake8-annotations/tree/poetry-adventures
I will state up front that there is no major advantage to making this switch, but rather a collection of minor differences that contribute to what I believe is an overall improvement for the developer. In the fairly recent past PyDis looked into migrating all of the repositories to Poetry, as at the time there was a mix between Pipenv and Poetry utilization. It was decided to unify on Pipenv, as it provides some functionality that's very useful for local development, like
pipenv run
scripts and support for local.env
files when executing these scripts. It also provides the useful check for an up-to-date lock file during deployment for the build to proceed. Poetry's advantages related to building & uploading to PyPI are not useful for most of our repositories since they do not live on PyPI.Pipenv's deployment-specific advantages
As
flake8-annotations
is a library, Pipenv's deployment-specific advantages &.env
file support are not relevant here.Poetry's lack of a
pipenv run
script equivalentWhile Poetry does have a
poetry run
command, it lacks Pipenv's capability for defining scripts in the project configuration and instead is limited to executing the project via defined entry points. While a disadvantage for some of our other repositories that utilize some fairly detailed scripts to reduce developmoent tasks to one-liners, development offlake8-annotations
has no need for this enhanced functionality. Both linting (poetry run flake8
) and testing (tox
) are similarly simply accomplished.poetry run flake8
is also insertable into thepre-commit
config, preventing us from having to sync linting dependencies in the config file; we're currently usingpipenv run lint
to accomplish the same.Simplification of dependency definition
Currently, project dependencies need to be synced between the
Pipfile
andsetup.py
. While we have a CI tool to check for synchronization (pipenv-check
), which helps, it only checks for version conflicts and not absolute synchronization. Migrating to Poetry allows us to utilize a singularpyproject.toml
file for dependency specifications. As it is a Python standard (ish?) format, it's supported bypip
for installation without requiring Poetry as well. As the support landscape expands, things liketox
andflake8
would also be able to be migrated into the file as well (tox
currently has support but it's as a giant string, which I feel is less readable). This is a pretty significant quality of life advantage over Pipenv.I have plans to declare
black
as an explicit dev dependency (it's already run locally), which requirespyproject.toml
anyway.Poetry's build tools
Poetry also provides built-in build tools, allowing for distributions to be built via the
poetry built
one-liner. While thepython setup.py sdist bdist_wheel
isn't super challenging, and is run by CI only anyway, it's still a nice simplifying one-liner to have.Pipenv's future?
With
pipenv
's transfer of ownership to PyPA, development publically seems to have stalled. While the developers have fairly recently stated that work is progressing & blocked by a myriad of issues, communication has been scarce. Poetry, on the other hand, has a very active development cycle, with a recent 1.0 release & impending addition of a plugin API to support OSS contributions of functionality that is lacking from the core tool.The text was updated successfully, but these errors were encountered: