4 ms·
Do you think Poetry solves this package management mess?
by tiborsaas 7y ago
Do you think Poetry solves this package management mess?
- snypox 7y agoWell, I'd say it makes it so much smoother, almost 'not a pain' anymore.
- scrollaway 7y agoTo a point. Poetry still isn't fully in board with being a project manager, it focuses too much on packaging. For example it doesn't do project scripts like nom scripts.
- williamdclt 7y agoTo be fair, NPM really doesn't do a great job at project scripts
- xkcd-sucks 7y agoIt doesn't support shell scripts which kind of sucks, but could be reasonable if it is expected to run on windows as well as posix. This is the scripts section from one project I used Poetry in. It seems to be fine for most things, even though the focus on managing a python module for publication is a little bit annoying. Once or twice I've run into version resolution troubles, but generally it's stable and much more ergonomic+easier to explain than pip+venv. One can of course use `poetry run pip freeze` to generate the standard `requirements.txt` file [tool.poetry.scripts] # NB: Poetry won't run arbitrary callables, so these are wrapped in a python script. # Poetry needs the root dir to be a package (e.g. module `my_repo` must exist) in order to run scripts # So they are just shoved into a dummy "my_repo.py" instead of going in e.g. "scripts.py" # Adds Git hooks from `git_hooks` path (overwrites existing!) hookup = "my_repo:hookup" # Run formatter+linter, does not modify anything, errors if fail lint = "my_repo:lint" # runs `black` (formatter), modifies stuff format = "my_repo:format" # A list of files which failed linting. Most helpful with flake8 vim integration https://github.com/nvie/vim-flake8 lintyfiles = "my_repo:lintyfiles" # unit tests utest = "my_repo:utest" # unit + integration tests in container citest = "my_repo:citest" cutest = "my_repo:cutest"
- totalperspectiv 7y agoI feel like it might, if it replaced pip and gets full endorsement from the python org. It's a fantastic project, but untill it has complete backing it's just a technical risk to include in a project.
- peterwwillis 7y agoPython packaging is broken by convention. A million snowflake packages with no clear model for reuse and extension and a whole lot of unmaintained mess, very little of it organized or uniform. Regardless of what tooling you wrap around it, the ecosystem will always be a mess.
- gonational 7y agoPoetry is the solution, IMHO. I’m sure poetry has bugs and it could have other problems (not sure), but if you look into how it works, from a software design / philosophy perspective, it’s absolutely amazing. It might be worth waiting a bit longer before you use it in a large production project. Once Heroku adds native support to the Python buildpack, and some other mainstream avenues add support, Poetry usage will increase enough to create the necessary scrutiny that will bring it up to true production-grade quality. When you add a package in Poetry it will add the latest version of that package’s dependencies that also satisfy all the other packages (and their dependencies’ dependencies). If you remove a package, Poetry will remove any dependencies of that package (actually uninstall them, rather than just leaving junk behind like pipenv), and will reestablish the latest versions of any other dependencies who’s versions were held back by the package you just removed or any of its dependencies... Also, when you add a package with Poetry it doesn’t need to completely lock and install everything from scratch; only what you have just added and whatever its dependencies dictate; nothing more. Also, you can tell Poetry to list off all the versions of your packages and the latest versions available (in case you’re like me and you pin all of your top level packages, having to Google “pypi django”, “pypi requests”, etc., to see if there are any newer versionS worth upgrading to, is a pain in the ass.