7 ms·
I’ve heard good things about pip-tools: https://github.com/jazzband/pip-tools https://github.com/jazzband/pip-tools
by yingw787 7y ago
I’ve heard good things about pip-tools: https://github.com/jazzband/pip-tools https://github.com/jazzband/pip-tools
- aequitas 7y agoI recently switched from Poetry (to which I switched after pipenv) to pip-tools for some projects, because Poetry was not able to work properly with some dependencies. Pip-tools has been a dream. It is just a thin layer of tools on top of Pip that separates your 'abstract' requirements (eg: django<3) from your 'release' requirements (eg: django==2.2.5) and managing running pip to have your virtualenv reflect your exact requirements. No new standard like pyproject that is partially supported (by 3rd party that is), no intention to (but failing at) being the all dominating way to do python packaging. Just a tool that is there to help you. edit: it also automates updating the release requirements file (within the constraints of the abstract requirements).
- yingw787 7y agoI’ve heard good things wrt determinism and packaging for different environments (dev/test/prod) on top of the simplicity!
- aequitas 7y agoHave a look at https://github.com/jazzband/pip-tools#workflow-for-layered-requirements https://github.com/jazzband/pip-tools#workflow-for-layered-r... Both the 'input' and 'output' requirements are pip compatible files (just with different extensions). It uses pip features like '-c' to include other contraints in your requirements. For me, if they would merge Pip-tools into Pip and call it a day, my package management issues for Python are solved.
- cik 7y agoThanks for this. I've been a poetry fan since... the first release and pipenv really just fails for me. I'm going to check out pip-tools today.
- takeda 7y agoNever used poetry, but pip tools is especially easy to integrate with CI/CD, because they are CLI commands that do specific simple tasks and don't hide things from the caller. I personally use setup.py (my setup.py only calls setup() and all configuration is declaratively defined in setup.cfg) the pip-compile generates a version lock (requirements.txt) and that is passed between environments, so we are ensuring that the exact same dependencies are installed during deployment.
- wyclif 7y agoI like that poetry uses pyproject.toml to replace setup.py, requirements.txt, setup.cfg, MANIFEST.in and the newly added Pipfile. Simplifying it to one file seems smart.
- Keats 7y agoI've tried pip-tools, pipenv and poetry and pip-tools has been the easiest to use by far. I wrote a small comparison last year: <https://www.vincentprouillet.com/blog/overview-package-management-python/> https://www.vincentprouillet.com/blog/overview-package-manag...
- macintux 7y agoHN absorbed the trailing greater-than sign into your URL. https://www.vincentprouillet.com/blog/overview-package-management-python/ https://www.vincentprouillet.com/blog/overview-package-manag...
- dwaltrip 7y agoWe also recently switched from Pipenv to pip-tools and so far it has been very pleasant. Our workflow: - Use pyenv to manage python versions (mostly works pretty well) - In the beginning, use builtin python 3 tooling to create virtual env for the project: "python3 -m venv venv" - Whenever needed, add new libs to "requirements.in" - Run the "pip-compile" command to generate a new "requirements.txt" with the dependency and its sub-dependencies pinned by default to the exact version - Run "pip install -r requirements.txt" to install the new package and its sub dependencies - Check both requirements.in and requirements.txt into version control The big advantage is that requirements.in specifies just the packages you care about, while requirements.txt has your packages and all of the sub dependencies pinned to the exact version.
- wyclif 7y agoI also switched to using pyenv to manage versioning. So far it's been painless. You should never mess with the system Python if you're on a Mac.
- acemarke 7y agoThe `pip-tools` portion of that is basically what I came up with myself and described in another thread at https://news.ycombinator.com/item?id=21779929 https://news.ycombinator.com/item?id=21779929 , except that I'm trying to use `pythonloc` to install things in a local `__pypackages__` folder per PEP-582 instead of using venvs.