EEST Dependency Management and Packaging¶
EEST uses uv
to manage and pin its dependencies.
Please use uv>=0.7.0
to ensure uv
writes uv.lock
files with consistent fields and formatting (see [#1597]#1597).
Managing Dependencies¶
We aim to provide specific version specifiers for each of our direct and extra dependencies.
Packages should be managed via uv
Dependencies should be managed using uv
on the command-line to ensure that version compatibility is ensured across all dependencies and that uv.lock
is updated as required.
The docs below cover common operations, see the uv
documentation on managing dependencies for more information.
Separate PRs are preferred when managing dependencies
An upgrade of all pinned dependencies in uv.lock
must be performed in a dedicated PR!
For other dependency changes, they can be included in the PR that removed use of the library, for example. But if a version bump is made, without related source code changes, it should be done in a dedicated PR. This makes the change:
- Easier to track.
- Trivial to revert.
Adding/modifying direct dependencies¶
These are packages listed in the project's direct dependencies, i.e., in pyproject.toml
[project]
section:
[project]
...
dependencies = [
"click>=8.1.0,<9",
...
"pytest-regex>=0.2.0,<0.3",
]
or, for source package dependencies (directly installed via a git+
specifier from Github), in the [tool.uv.sources]
section:
[tool.uv.sources]
ethereum-spec-evm-resolver = { git = "https://github.com/petertdavies/ethereum-spec-evm-resolver", rev = \
...
Example: Updating direct dependencies
Example of a package dependency update:
uv add "requests>=2.31,<2.33"
Example of a source dependency update:
uv add "ethereum-spec-evm-resolver @ git+https://github.com/petertdavies/ethereum-spec-evm-resolver@623ac4565025e72b65f45b926da2a3552041b469"
Adding/modifying optional dependencies¶
The package versions in the optional "extra" groups should also be managed via uv on the command-line These are the: lint
, docs
, test
optional groups defined in the pyproject.toml
:
[project.optional-dependencies]
test = ["pytest-cov>=4.1.0,<5"]
lint = [
"ruff==0.9.4",
"mypy>=1.15.0,<1.16",
"types-requests>=2.31,<2.33",
]
docs = [
...
]
Example: Updating an optional dependency
uv add --optional lint "types-requests>=2.31,<2.33"
Upgrading Pinned Dependencies in uv.lock
¶
To upgrade all pinned dependencies in uv.lock
to the latest version permitted by EEST's project.toml
version specifiers run:
uv lock --upgrade
Project-wide dependency upgrades must be made via a dedicated PR!
To upgrade a single package run:
uv lock --upgrade-package <package>
See Locking and Syncing in the uv
docs for more information.