pip’s requirements.txt best practice

I believe using pip-compile from pip-tools is a good practice when constructing your requirements.txt. This will make sure that builds are predictable and deterministic. The pip-compile command lets you compile a requirements.txt file from your dependencies, specified in either setup.py or requirements.in Here’s my recommended steps in constructing your requirements.txt (if using requirements.in): Create a … Read more

How to install from requirements.txt [duplicate]

First, freeze all of your pip packages in the requirements.txt file using the command pip freeze > requirements.txt This should create the requirements.txt file in the correct format. Then try installing using the command pip install -r requirements.txt Make sure you’re in the same folder as the file when running this command. If you get … Read more

Install local wheel file with requirements.txt

This is called a direct reference. Since version 19.3, pip support this in both command line and requirement files. Check out an example from the official documentation. As to OP’s question, simply put the local wheel’s relative path, i.e., ./<my_wheel_dir>/<my_wheel.whl>, in requirement.txt, e.g., ./local_wheels/ABC-0.0.2-py3-none-any.whl Flask==1.1.2 flask-restplus==0.13.0 gunicorn==20.0.4

Travis special requirements for each python version

Travis CI adds an environment variable called $TRAVIS_PYTHON_VERSION that can be referenced in your .travis.yml: python: – 2.6 – 2.7 – 3.2 – 3.3 – pypy install: – if [[ $TRAVIS_PYTHON_VERSION == 2.6 ]]; then pip install importlib unittest2; fi – pip install -r requirements.txt This would cause unittest2 and importlib to be installed only … Read more

Is requirements.txt still needed when using pyproject.toml?

Quoting myself from here My current assumption is: […] you put your (mostly unpinned) dependencies to pyproject.toml instead of setup.py, so you library can be installed as a dependency of something else without causing much troubles because of issues resolving version constraints. On top of that, for “deployable applications” (for lack of a better term), … Read more

tech