Skip to content

Commit b48f34d

Browse files
committed
📝 Add dependency cooldowns
1 parent b2776be commit b48f34d

2 files changed

Lines changed: 26 additions & 3 deletions

File tree

docs/libs/install.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ dependencies.
182182
updates. We only restrict the version numbers to be used in the event of
183183
problems. For apps, however, we specify the version numbers.
184184

185-
We use `PDM <https://pdm-project.org/en/latest>`_ to specify the versions for
186-
our applications and maintain cross-platform lock files. PDM also supports the
187-
management of virtual environments with ``pdm venv activate``.
185+
To pin versions for our applications and maintain cross-platform lock files, we
186+
use :ref:`uv`. ``uv`` also helps us maintain :ref:`reproducible Python
187+
environments <reproduce-virtual-env>`.
188188

189189
… of Python
190190
:::::::::::

docs/packs/apps.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,29 @@ With ``uv lock --upgrade`` you can upgrade all packages and with :samp:`uv lock
125125
--upgrade-package {PACKAGE}=={VERSION}` you can upgrade individual packages to a
126126
specific version.
127127

128+
.. _dependency-cooldowns:
129+
130+
.. tip::
131+
To prevent the installation of packages that have only recently been
132+
published on :term:`PyPI`, thereby giving PyPI administrators the opportunity
133+
to respond to malware, *dependency cooldowns* are recommended. These are best
134+
configured globally in :file:`~/.config/uv/uv.toml`:
135+
136+
.. code-block:: toml
137+
138+
exclude-newer = "P3D"
139+
140+
``P3D`` specifies that only packages that are three days old or older should
141+
be installed, with the date format conforming to :rfc:`3339`.
142+
143+
However, *dependency cooldowns* are not a panacea. If a package containing
144+
security vulnerabilities needs to be replaced with a more recent version as
145+
quickly as possible, the *dependency cooldowns* can be bypassed using
146+
147+
.. code-block:: console
148+
149+
$ uv sync --exclude-newer-package "{PACKAGE}=P0D"
150+
128151
.. tip::
129152
You can also use the
130153
:doc:`Python4DataScience:productive/git/advanced/hooks/pre-commit` to

0 commit comments

Comments
 (0)