Closed jherland closed 4 months ago
Thank you @jherland 🫶
I started checking the PR by looking at all usages of "pip". There are some places where we can consider updating the text or a name:
pip install
" -> "This will use uv pip install
and fall back to pip install
if uv
is not available"uv
instructions? Or should we only apply it in the developer context?uv
?I started checking the PR by looking at all usages of "pip". There are some places where we can consider updating the text or a name:
Agreed. Look at f2d359c for my rewordings.
monkeypatch.setenv("PIP_NO_INDEX", "True")
does this still hold foruv
?
Actually it does not! 🙀
Furthermore, although uv
supports some UV_*
environment variables that mirror the PIP_*
equivalents, these settings/variables cannot yet be set via the environment. I found a workaround instead that relies on setting up a (temporary) config file for uv
. Take a look at 2795898 for the details.
uv
is much faster thanpip
for installing package (it is also faster thenpython -m venv
for creating virtualenvs). This PR switches fromvenv
/pip
touv
in three separate parts of our project:uv
instead ofpip
to manage the virtualenv associated with each Nox session (first commit).uv
instead ofvenv
/pip
(when available) to manage virtualenvs for oursample_project
andreal_projects
tests (next three commits).uv
instead ofvenv
/pip
(when available) to create and populate the temporary virtualenv managed by the--install-deps
option (next two commits).The first two points above only concern our tests and has no effect on the FawltyDeps program itself. The last one changes the behavior of the
--install-deps
option to useuv
when available (otherwise fall back tovenv
/pip
).The last commit in this PR adds a small convenience for our users: If they want to ensure that
uv
is available for FawltyDeps to use, they can now installfawltydeps[uv]
. Thisuv
extra will bring inuv
as a dependency in much the same way that we currently depend onnox[uv]
in our own developement environment.Commits:
uv
instead ofpip
to manage nox virtualenvstests/project_helpers
: Useuv
(if available) to prepare virtualenvs.github/workflows/tests.yaml
: Preserveuv
cache across test runsprojectq
with 'uv pip install'--install-deps
frompip
TemporaryAutoInstallResolver
: Useuv
if availablepyproject.toml
: Adduv
as an "extra" dependency for FawltyDeps