isee.pip_utils¶
Utilities for reading a project’s declared dependencies and installing them.
These functions back the isee install-requires and isee tests-require
CLI commands (and therefore the install-packages action). They understand
both modern pyproject.toml (PEP 621 [project]) and legacy setup.cfg
projects, preferring pyproject.toml whenever it declares a [project]
table.
Functions:
install_requires: Install the project’s runtime dependencies.
tests_require: Install the project’s test dependencies.
resolve_install_requires: Resolve (without installing) the runtime deps.
resolve_tests_require: Resolve (without installing) the test deps.
read_setup_config: (legacy) Read the setup.cfg file in the project directory.
build_dependency_wheels: Build dependency wheels for the project.
extras_require / install_extras: (legacy) setup.cfg extras_require helpers.
Module Attributes
|
Functions
|
|
|
Return a list of packages for the given extras_require key (e.g. 'testing'). |
|
Install packages listed under extras_require[name] in setup.cfg. |
|
|
|
Install the project's runtime dependencies. |
|
(legacy) Read and return the |
|
Return the project's runtime dependencies as a list of requirement strings. |
|
Return the project's test dependencies as a list of requirement strings. |
|
Install the project's test dependencies. |
- isee.pip_utils.SETUP_CFG_ENCODING = 'utf-8'¶
setup.cfgis read as UTF-8, whatever the locale says – the same reasoning as_update_file’s explicit encoding: otherwise a non-ASCII byte crashes the read under a C/POSIX locale, or (e.g. U+0141 in cp1252) on a Windows runner.
- isee.pip_utils.extras_require(name='testing', *, project_dir=None)[source]¶
Return a list of packages for the given extras_require key (e.g. ‘testing’).
If setup.cfg or the section/key is missing return an empty list instead of raising so callers can safely act on the result.
- isee.pip_utils.install_extras(name='testing', *, project_dir=None)[source]¶
Install packages listed under extras_require[name] in setup.cfg.
This is a convenience wrapper used by CI when present. If no packages are found the function prints a message and does nothing.
- isee.pip_utils.install_requires(*, project_dir=None)[source]¶
Install the project’s runtime dependencies.
Reads them from
pyproject.toml[project].dependencieswhen present, otherwisesetup.cfg[options] install_requires.
- isee.pip_utils.read_setup_config(project_dir=None)[source]¶
(legacy) Read and return the
setup.cfgConfigParser for the project.Prefer
resolve_install_requires()/resolve_tests_require(), which also understandpyproject.toml.
- isee.pip_utils.resolve_install_requires(*, project_dir=None)[source]¶
Return the project’s runtime dependencies as a list of requirement strings.
Reads
[project].dependenciesfrompyproject.tomlwhen present, otherwise[options] install_requiresfromsetup.cfg. Raises aRuntimeErroronly when neither metadata file exists.
- isee.pip_utils.resolve_tests_require(*, project_dir=None, test_extras=('testing', 'test', 'tests', 'dev'))[source]¶
Return the project’s test dependencies as a list of requirement strings.
Reads
[project.optional-dependencies]frompyproject.toml(the first oftest_extrasthat is present) when a[project]table exists, otherwise[options] tests_requirefromsetup.cfg. Raises aRuntimeErroronly when neither metadata file exists.
- isee.pip_utils.tests_require(*, project_dir=None, test_extras=('testing', 'test', 'tests', 'dev'))[source]¶
Install the project’s test dependencies.
Reads them from
pyproject.toml[project.optional-dependencies](the first present oftest_extras) when present, otherwisesetup.cfg[options] tests_require.