Skip to content

Commit 7832ad4

Browse files
committed
📝 Switch from pip install to uv add
1 parent afa828f commit 7832ad4

15 files changed

Lines changed: 152 additions & 206 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: |
4848
uv venv
4949
echo "$PWD/.venv/bin" >> $GITHUB_PATH
50-
uv pip install --group=docs
50+
uv sync --group docs
5151
- name: Build HTML and check links
5252
run: |
5353
uv run make html

docs/document/shot-scraper.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Installation
99

1010
.. code-block:: console
1111
12-
$ python -m pip install shot-scraper
13-
$ shot-scraper install
12+
$ uv add --group docs shot-scraper
13+
$ uv run shot-scraper install
1414
1515
.. note::
1616
The second line installs the required browser.

docs/document/sphinx/intersphinx.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The error can be corrected with:
8282

8383
.. code-block:: console
8484
85-
$ python -m pip install sphobjinv
85+
$ uv add --group docs sphobjinv
8686
8787
#. Then the original file can be downloaded with:
8888

docs/document/sphinx/start.rst

Lines changed: 32 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -8,105 +8,46 @@ Installation and start
88

99
.. tab:: Linux/macOS
1010

11-
.. code-block:: console
12-
13-
$ mkdir docs_proj
14-
$ cd docs_proj
15-
$ python3 -m venv .venv
16-
17-
.. tab:: Windows
18-
19-
.. code-block:: ps1con
20-
21-
C:> mkdir docs_proj
22-
C:> cd docs_proj
23-
C:> py -m venv .venv
11+
$ uv init --package docs_proj
12+
$ cd docs_proj
2413

2514
#. Switch to the virtual environment and install Sphinx there:
2615

27-
.. tab:: Linux/macOS
28-
29-
.. code-block:: console
30-
31-
$ . .venv/bin/activate
32-
$ (.venv) python -m pip install sphinx
33-
Creating a virtualenv for this project…
34-
35-
36-
.. tab:: Windows
37-
38-
.. code-block:: ps1con
16+
.. code-block:: console
3917
40-
C:> .venv\Scripts\activate.bat
41-
C:> (.venv) python -m pip install sphinx
42-
Creating a virtualenv for this project…
43-
18+
$ uv add --group docs sphinx
4419
4520
#. Create your Sphinx documentation project:
4621

47-
.. tab:: Linux/macOS
22+
.. code-block:: console
4823
49-
.. code-block:: console
50-
51-
$ sphinx-quickstart docs
52-
Selected root path: docs
53-
> Separate source and build directories (y/n) [n]:
54-
> Name prefix for templates and static dir [_]:
55-
> Project name: my.package
56-
> Author name(s): Veit Schiele
57-
> Project release []: 1.0
58-
> Project language [en]:
59-
> Source file suffix [.rst]:
60-
> Name of your master document (without suffix) [index]:
61-
> autodoc: automatically insert docstrings from modules (y/n) [n]: y
62-
> doctest: automatically test code snippets in doctest blocks (y/n) [n]: y
63-
> intersphinx: link between Sphinx documentation of different projects (y/n) [n]: y
64-
> todo: write "todo" entries that can be shown or hidden on build (y/n) [n]: y
65-
> coverage: checks for documentation coverage (y/n) [n]:
66-
> imgmath: include math, rendered as PNG or SVG images (y/n) [n]:
67-
> mathjax: include math, rendered in the browser by MathJax (y/n) [n]:
68-
> ifconfig: conditional inclusion of content based on config values (y/n) [n]:
69-
> viewcode: include links to the source code of documented Python objects (y/n) [n]: y
70-
> githubpages: create .nojekyll file to publish the document on GitHub pages (y/n) [n]:
71-
> Create Makefile? (y/n) [y]:
72-
> Create Windows command file? (y/n) [y]:
73-
74-
Creating file docs/source/conf.py.
75-
Creating file docs/source/index.rst.
76-
Creating file docs/Makefile.
77-
Creating file docs/make.bat.
78-
79-
.. tab:: Windows
80-
81-
.. code-block:: ps1con
82-
83-
C:> sphinx-quickstart docs
84-
Selected root path: docs
85-
> Separate source and build directories (y/n) [n]:
86-
> Name prefix for templates and static dir [_]:
87-
> Project name: my.package
88-
> Author name(s): Veit Schiele
89-
> Project release []: 1.0
90-
> Project language [en]:
91-
> Source file suffix [.rst]:
92-
> Name of your master document (without suffix) [index]:
93-
> autodoc: automatically insert docstrings from modules (y/n) [n]: y
94-
> doctest: automatically test code snippets in doctest blocks (y/n) [n]: y
95-
> intersphinx: link between Sphinx documentation of different projects (y/n) [n]: y
96-
> todo: write "todo" entries that can be shown or hidden on build (y/n) [n]: y
97-
> coverage: checks for documentation coverage (y/n) [n]:
98-
> imgmath: include math, rendered as PNG or SVG images (y/n) [n]:
99-
> mathjax: include math, rendered in the browser by MathJax (y/n) [n]:
100-
> ifconfig: conditional inclusion of content based on config values (y/n) [n]:
101-
> viewcode: include links to the source code of documented Python objects (y/n) [n]: y
102-
> githubpages: create .nojekyll file to publish the document on GitHub pages (y/n) [n]:
103-
> Create Makefile? (y/n) [y]:
104-
> Create Windows command file? (y/n) [y]:
105-
106-
Creating file docs\conf.py.
107-
Creating file docs\index.rst.
108-
Creating file docs\Makefile.
109-
Creating file docs\make.bat.
24+
$ uv run sphinx-quickstart docs
25+
Selected root path: docs
26+
> Separate source and build directories (y/n) [n]:
27+
> Name prefix for templates and static dir [_]:
28+
> Project name: my.package
29+
> Author name(s): Veit Schiele
30+
> Project release []: 1.0
31+
> Project language [en]:
32+
> Source file suffix [.rst]:
33+
> Name of your master document (without suffix) [index]:
34+
> autodoc: automatically insert docstrings from modules (y/n) [n]: y
35+
> doctest: automatically test code snippets in doctest blocks (y/n) [n]: y
36+
> intersphinx: link between Sphinx documentation of different projects (y/n) [n]: y
37+
> todo: write "todo" entries that can be shown or hidden on build (y/n) [n]: y
38+
> coverage: checks for documentation coverage (y/n) [n]:
39+
> imgmath: include math, rendered as PNG or SVG images (y/n) [n]:
40+
> mathjax: include math, rendered in the browser by MathJax (y/n) [n]:
41+
> ifconfig: conditional inclusion of content based on config values (y/n) [n]:
42+
> viewcode: include links to the source code of documented Python objects (y/n) [n]: y
43+
> githubpages: create .nojekyll file to publish the document on GitHub pages (y/n) [n]:
44+
> Create Makefile? (y/n) [y]:
45+
> Create Windows command file? (y/n) [y]:
46+
47+
Creating file docs/source/conf.py.
48+
Creating file docs/source/index.rst.
49+
Creating file docs/Makefile.
50+
Creating file docs/make.bat.
11051
11152
Sphinx layout
11253
-------------

docs/document/sphinx/test.rst

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,26 @@ You can then define the following jobs for GitHub, for example:
117117
118118
docs:
119119
name: Build docs and run doctests
120-
needs: build-package
121120
runs-on: ubuntu-latest
121+
needs: build-package
122+
122123
steps:
123-
- name: Download pre-built packages
124-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
125-
with:
126-
name: Packages
127-
path: dist
128-
- run: tar xf dist/*.tar.gz --strip-components=1
129-
130-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
131-
with:
132-
# Keep in sync with tox.ini/docs and .readthedocs.yaml
133-
python-version: "3.14"
134-
cache: pip
135-
- run: python -m pip install tox
136-
- run: python -m tox run -e docs
124+
- name: Download pre-built packages
125+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
126+
with:
127+
name: Packages
128+
path: dist
129+
- run: tar xf dist/*.tar.gz --strip-components=1
130+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
131+
with:
132+
# Keep in sync with tox.ini/docs & .readthedocs.yaml
133+
python-version: "3.14"
134+
- uses: hynek/setup-cached-uv@4300ec2180bc77d705e626a34e381b81a4772c51 # v2.5.0
135+
136+
- run: >
137+
uvx --with=tox-uv
138+
tox run
139+
-e docs
137140
138141
reST formatting
139142
---------------
@@ -148,7 +151,7 @@ format can be checked with `sphinx-lint
148151
:caption: .pre-commit-config.yaml
149152
150153
- repo: https://github.com/sphinx-contrib/sphinx-lint
151-
rev: v1.0.0
154+
rev: c883505f64b59c3c5c9375191e4ad9f98e727ccd # v1.0.2
152155
hooks:
153156
- id: sphinx-lint
154157
types: [rst]
@@ -197,7 +200,7 @@ via the :doc:`pre-commit
197200
.. code-block:: yaml
198201
199202
- repo: https://github.com/adamchainz/blacken-docs
200-
rev: "v1.12.1"
203+
rev: 7ae9389351f4090e3993de28015a05a18ca6b8a7 # v1.12.1
201204
hooks:
202205
- id: blacken-docs
203206
additional_dependencies:

docs/document/sphinx/uml/index.rst

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,9 @@ Installation
2727
#. Install `sphinxcontrib-plantuml
2828
<https://pypi.org/project/sphinxcontrib-plantuml/>`_:
2929

30-
.. tab:: Linux
31-
32-
.. code-block:: console
33-
34-
$ python -m pip install sphinxcontrib-plantuml
35-
36-
.. tab:: macOS
37-
38-
.. code-block:: console
39-
40-
$ python -m pip install sphinxcontrib-plantuml
41-
42-
.. tab:: Windows
43-
44-
.. code-block:: ps1con
30+
.. code-block:: console
4531
46-
C:> python -m pip install sphinxcontrib-plantuml
32+
$ uv add --grpup docs sphinxcontrib-plantuml
4733
4834
#. Configure Sphinx in the ``conf.py`` file:
4935

docs/packs/binary-extensions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ Alternatively, you can install our ``dataprep`` package and use ``mean``:
260260

261261
.. code-block:: console
262262
263-
$ python -m pip install dataprep/dist/dataprep-0.1.0-cp39-cp39-macosx_10_9_x86_64.whl
264-
$ python
263+
$ uv add dataprep/dist/dataprep-0.1.0-cp39-cp39-macosx_10_9_x86_64.whl
264+
$ uv run python
265265
266266
.. code-block:: pycon
267267

docs/packs/dataprep/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Quickstart
1919

2020
.. code-block:: console
2121
22-
$ python3 -m pip install datagrep
22+
$ uv add datagrep
2323
2424
#. Import the datagrep modules, for example with:
2525

docs/packs/distribution.rst

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -326,25 +326,10 @@ take over all dependencies from ``docs`` and ``test`` in addition to
326326

327327
You can install these dependency groups, for example with:
328328

329-
.. tab:: Linux/macOS
330-
331-
.. code-block:: console
332-
333-
$ cd /PATH/TO/YOUR/DISTRIBUTION_PACKAGE
334-
$ python3 -m venv .venv
335-
$ . .venv/bin/activate
336-
$ python -m pip install --upgrade pip
337-
$ python -m pip install --group dev
338-
339-
.. tab:: Windows
340-
341-
.. code-block:: ps1
329+
.. code-block:: console
342330
343-
> cd C:\PATH\TO\YOUR\DISTRIBUTION_PACKAGE
344-
> python3 -m venv .venv
345-
> .venv\Scripts\activate.bat
346-
> python -m pip install --upgrade pip
347-
> python -m pip install --group dev
331+
$ cd /PATH/TO/YOUR/DISTRIBUTION_PACKAGE
332+
$ uv sync --group dev
348333
349334
.. seealso::
350335
* :pep:`735`

docs/packs/templating/cruft.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Installation
1919

2020
.. code-block:: console
2121
22-
$ python -m pip install cruft
22+
$ uv add --group dev cruft
2323
2424
Create a new project
2525
--------------------

0 commit comments

Comments
 (0)