Replicating is just "virtualenv --python=python3 venv && . ./venv/bin/activate && pip install -r requirements-frozen.txt". Am I missing something here? Yes, to be absolutely sure, you need to have the same versions of python, pip, setuptools, gcc (for C extensions), C library dependencies, etc. on both systems that do the build, but that's the case for pretty much any build system out there if you want repeatable builds.
And if you you just don't feel like dealing with that, you can just use Docker (aka "put my machine in a tarball and ship it").
Modern languages do pretty much the same, just have a nicer wrapper for it.
And yes, as I said, a nice wrapper for management of it is missing in python. The main ideas/approach is the same though.
edit: also, how do you manage dev dependencies with requirements.txt and setup.py?
Again, not as polished experience, but the model matches.
What?! Seriously? That is not how it's supposed to work. Requirements.txt is already meant to be the frozen dependencies (like the output of pip freeze). Why change that? I much prefer how pip-tools does it with a new file, requirements.in that contains the unpinned direct dependencies. I thought poetry did the same thing but with pyproject.toml?
The pip SAT-based solver was supposed to land in 2017 or 2018 after a GSoC, and nothing came of it. Is it finally going to use a different heuristic than "#yolo" for picking which version of dependencies to install?
- discover it
- install it properly
- run it properly
- make it create a venv with the proper python version
- potentially import data from existing setup.py/cfg
- make sure you are always in the right dir when you use it
- not be on windows (poetry shell doesn't work there)
- IDE integration is not great
- people have to chose between this, pip, pip-tools, flit, pipenv, dephell, conda...
And you cannot use it if you are not "in a project". But not all venv are project related.
Ok that's a bug, probably fixed soon. Otherwise, most of these are true of many popular packaging tools in other languages.
Is that like [tool.poetry.scripts] ?
I want something such that I can run `poetry run script_name` and it will run that command line in the poetry context. Right now I either rely on my bash history or use a bash script to mimic the behavior of npm / yarn scripts. I want to turn this `poetry run python project_name/main.py` into an alias like `poetry run main` or `poetry run dev`.
Ah yes: https://xkcd.com/927/
SNMP