The packaging story seems less, uh, put together. Is any consensus forming on that?
The packaging story seems less, uh, put together. Is any consensus forming on that?
Edited to add: both Poetry and PDM do generate cross-platform locks.
That shouldn't happen. I wonder what could cause it.
I never looked them up too closely, but same versions of Python should result in same version of packages regardless of platform.
¹but note that Debian & Debian derivatives shove several standard library modules into individual packages, so you might need to apt-get install more than just python3.
Vanilla pip works well with the venv module. I still manually manage the majority of my virtual environments, with the virtualenvwrapper libary, although `source path/to/myvenv/bin/activate` also works.
Pipx is great for installing executable tools.
I don't treat Python packaging tools as my religion. If one doesn't fulfill its purpose, I use another solution. Whether that's a positive or negative for the tool isn't my concern.
Non-PEP440 compliant libraries are also a pain in the ass.
Put both those facts together and you are playing with fire. In all likelihood you will eventually footgun yourself and end up with a python env superfund.
Just use virtual envs for everything.
I say this coming from over a decade of python experience and lots of time spent installing python in exotic environments.
Edit: Notably, not in other tools such as pip.
Without going into all the available solutions for all possible cases, here's a list of use cases that Python packaging needs to cover:
- dependency management and packaging:
- abstract for libraries, concrete for applications [0]
- pure Python dependencies
- dependencies with binaries included
- packaging format: sdist, wheel, conda
- library repositories: public (PyPI), private, mirrors etc
- installing the Python executable
- multiple Python executables
- management of (multiple) virtual environments
Multiple standards have been adopted to deal with many of those cases, but many existing projects still haven't been updated and still need to be supported. Although we currently don't have a single tool that will cover every single possible use case, things are slowly but surely moving in the right direction.for real work I use conda because it manages multiple versions of python well. Then I mainly use pip to install stuff, occasionally falling back to conda or conda-forge.
This has been the most reliable for me. I often have to trash my whole environment and start over after installing a few binary packaes like tensorflow.
I'd advise against this habit, even for "light" development work. I've been bitten too many times by some library installing into the wrong env or picking up the wrong path of a library.
Conda's generally a good move if you don't want to manually manage virtualenvs.