-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use python-version-specific requirements.txt instead of single generic requirements.txt #150
Commits on Nov 30, 2020
-
... containing all top-level (*.in) and concrete requirements.txt, the latter parametrized by python version. We have a bunch of dependencies that are only needed on specific python versions (e.g. backports like dataclasses, importlib_resources, etc). We use conditional environment markers for those in the top-level requirements.in files. pip-compile does not yet support generating a combined requirements.txt file where differences across python versions/platforms/archs are reconciled using environmet markers: jazzband/pip-tools#826 They currently recommend running pip-compile on each targeted python environment generating as many concrete requirements.txt files jazzband/pip-tools#651 So this is what I have done here.
Configuration menu - View commit details
-
Copy full SHA for 958a2cb - Browse repository at this point
Copy the full SHA 958a2cbView commit details -
setup.py: read install_requires and extras_require from external requ…
…irements.in files pip-compile setup.py doesn't support environment markers ('; python_version < 3.7'), whereas it does when compiling from requirements.in files. So we read top-level dependencies from external *.in files and stick them in the setup.py install_requires and extras_require keywords. The 'dev' extra is new. One can now do `pip install -e .[dev]` and have all the development requirements installed alongside the current module. This is handy for developers bootstrapping a new venv to work on. It's a common practice among python developers.
Configuration menu - View commit details
-
Copy full SHA for a972b7d - Browse repository at this point
Copy the full SHA a972b7dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 96f9329 - Browse repository at this point
Copy the full SHA 96f9329View commit details -
add tox command to update all py*-requirements.txt files
This is handy when any top-level deps change. The shell script is just a shorthand for the longish tox command
Configuration menu - View commit details
-
Copy full SHA for dbc6dab - Browse repository at this point
Copy the full SHA dbc6dabView commit details -
tox.ini: usedevelop=true if tox env name contains '-dev' particle
tox -e py39-dev will install in editable mode (for when one is in a rush). One can also use this as a way to quickly bootstrap a development virtual environment. E.g. after running the above command, a new venv is created in .tox/py39-dev with all the pinned requirements installed and the current module installed in editable mode, ready for editing source files and running directly the pytest command therein
Configuration menu - View commit details
-
Copy full SHA for 989c1ee - Browse repository at this point
Copy the full SHA 989c1eeView commit details -
ci: export TOXENV variable to select current GH python
The generic invocation 'tox -e py' does not work any more, because we now install dependencies using python-version-specific requirements.txt files and we need to know the exact python major.minor version. Thus we set TOXENV environment variable such that invoking 'tox' without additional -e options will run only the specified python version.
Configuration menu - View commit details
-
Copy full SHA for 79ffc42 - Browse repository at this point
Copy the full SHA 79ffc42View commit details
Commits on Dec 1, 2020
-
read supported pythons from tox.ini envlist
Using tox -l command to list them, so we have a single source of truth for what are the versions that we support. And we only need to change one file when, e.g., python3.10 is out.
Configuration menu - View commit details
-
Copy full SHA for f0f97c3 - Browse repository at this point
Copy the full SHA f0f97c3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7ddf048 - Browse repository at this point
Copy the full SHA 7ddf048View commit details -
expect script to be run from root dir and use relative paths throughout
otherwise pip-compile will write full absolute paths in the generated requirements.txt..
Configuration menu - View commit details
-
Copy full SHA for 170a772 - Browse repository at this point
Copy the full SHA 170a772View commit details -
Configuration menu - View commit details
-
Copy full SHA for 85e1a69 - Browse repository at this point
Copy the full SHA 85e1a69View commit details