You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when testing a single package, we clone the package's code, then do pip install . --no-deps so as to not update its dependencies and to have a proper integration test. For additional packages, we have a requirements.txt file, that we pip install -r requirements.txt. This is an unavoidable evil as whatever packages we install for testing may depend on others and so we can't use --no-deps there.
The Python community prefers to use the extras_require field in setup.py to specify test/dev/doc dependencies that won't be installed during normal use. I'd love for us to drop requirements.txt and instead use extras_require. However, doing pip install .[test] --no-deps will only install . since the [test] part specifies the dependencies and we've explciitly said not to.
I propose to add the following functionailty to komodoenv':
Add a new executable module komodoenv.install_extras that will install only the dependencies specified in extras_require:
# 1. Install ERT but with no dependencies
pip install ./ert --no-deps
# 2. Install ert's "test" extras_require, without touching its other dependencies
python -m komodoenv.install_extras ert test
We can find the METADATA file in the current install, much the same way komodoenv does currently in order to figure out which version of komodoenv is installed in a komodo release. Then we parse it. Should be quite feasable as the file format is quite simple.
Currently, when testing a single package, we clone the package's code, then do
pip install . --no-deps
so as to not update its dependencies and to have a proper integration test. For additional packages, we have arequirements.txt
file, that wepip install -r requirements.txt
. This is an unavoidable evil as whatever packages we install for testing may depend on others and so we can't use--no-deps
there.The Python community prefers to use the
extras_require
field insetup.py
to specify test/dev/doc dependencies that won't be installed during normal use. I'd love for us to droprequirements.txt
and instead useextras_require
. However, doingpip install .[test] --no-deps
will only install.
since the[test]
part specifies the dependencies and we've explciitly said not to.I propose to add the following functionailty to
komodoenv
':Add a new executable module
komodoenv.install_extras
that will install only the dependencies specified inextras_require
:While
pip
doesn't have a way to figure out which packages are extras and which are not, nor can we install only the extra dependencies, we can make do ourselves by parsing theMETADATA
file required by Python package manager standard: https://packaging.python.org/specifications/core-metadata/#provides-extra-multiple-useWe can find the
METADATA
file in the current install, much the same waykomodoenv
does currently in order to figure out which version ofkomodoenv
is installed in a komodo release. Then we parse it. Should be quite feasable as the file format is quite simple.Usage: komodoenv.install_extras [Installed package] [Extras groups...]
The text was updated successfully, but these errors were encountered: