Someone needs to standardize a single Python environment at least annually. As these tools are just turning Python into a perpetual Alpha build.
Best of luck, =)
181–190 of 341 posts
Someone needs to standardize a single Python environment at least annually. As these tools are just turning Python into a perpetual Alpha build.
Best of luck, =)
allpy --std=py3.4
and have it "just work", in the same sort of way that you can currently do gcc -std=c90
(And also therefore `#!/usr/bin/allpy --std=py3.4`)I mean, imagine if C compilers required that you have a separate compiler binary and copy of the standard headers (or even worse, all of stdlib!) for each version of the C standard?!? Instead of just putting new language features on version flags, and make stdlib functions available/marked as deprecated based on version checks?
Tools you can use to make sure the Python program you wrote keeps working: requirements.txt, pip, pipenv, pyenv, virtualenv, pyenv-virtualenv, virtualenvwrapper, pyenv-virtualenvwrapper, venv, pyvenv, conda, miniconda, poetry, docker, nix. Which ones did I miss? Which of them actually ensure your program always works the same as when you first wrote it, without asterisks?
None. The software container image is the best bet but you need to keep the image and not only the building scripts.
Of course this doesn't come free: packaging with Nix may involve nontrivial effort for some projects.
Earlier quoted context omitted.
Yeah, ASDF is fantastic, I'm glad stuff like pyenv and rvm existed and paved the way for it but ASDF is the way to go nowadays.
asdf for python is a wrapper around pyenv, it didn't "pave the way", it's an important part of asdf. (Also I like mise better currently: https://github.com/jdx/mise )
I long for the day when python is mature enough for an implementation to arise where one binary can run as all previous versions of the language and stdlib, so you can do allpy --std=py3.4 and have it "just work", in the same sort of way that you can currently do gcc -std=c90 (And also therefore `#!/usr/bin/allpy --std=py3.4`) I mean, imagine if C compilers required that you have a separate compiler binary and copy o…
I used pyenv in my previous company. At first it was fine, but after a while with multiple versions of Python installed, things stopped working. The right virtual env was not activated, etc. (It could have also been because our software updates like OS and security upgrades were pushed by desktop support). I removed all of it, and just resorted to installing multiple versions of Python the old way (downloading from p…
Works fine for me on macOS. I am using venv the same way you do except some global ones for certain tools.
unrelated rant -
Why is the "requirements.txt" file a stupid flat listing of all transitive dependencies with pinned versions? It makes it harder to change library versions even if there are no true conflicts. I've resorted to making an "actual_requirements.txt" file manually listing only direct dependencies and whatever version constraints make sense. I wish pip would fix this.
I don't recall ever needing anything other than virtualenvwrapper and pip—and even some of the annoyances these tools had early on have been solved by now...
https://virtualenvwrapper.readthedocs.io/en/latest/
If you really need different versions of python, you can just `mkvirtualenv -p python3 venvname`
I feel like every other tool out there has to explain what problem they solve that virtualenvwrapper doesn't
Don't install anything globally, creates lots of envs, and feel free to have different versions of python installed side-by-side with some "main" version preferably symlinked as `python` and `python3`
The end
Tools you can use to make sure the Python program you wrote keeps working: requirements.txt, pip, pipenv, pyenv, virtualenv, pyenv-virtualenv, virtualenvwrapper, pyenv-virtualenvwrapper, venv, pyvenv, conda, miniconda, poetry, docker, nix. Which ones did I miss? Which of them actually ensure your program always works the same as when you first wrote it, without asterisks?
requirements.txt is a text file, not a separate tool...
if you want your program to work exactly as intended in the future, there are tools like py2exe and py2app for that.
I used pyenv in my previous company. At first it was fine, but after a while with multiple versions of Python installed, things stopped working. The right virtual env was not activated, etc. (It could have also been because our software updates like OS and security upgrades were pushed by desktop support). I removed all of it, and just resorted to installing multiple versions of Python the old way (downloading from p…
Works fine for me on macOS. I am using venv the same way you do except some global ones for certain tools.