Skip to content

Commit 29d84bc

Browse files
authored
dependency-groups.dev and uv in docs (#691)
* dependency-groups.dev and switch to uv in docs * Separate dependency group for docs
1 parent 5a7f522 commit 29d84bc

File tree

10 files changed

+59
-85
lines changed

10 files changed

+59
-85
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
cache-dependency-path: pyproject.toml
2222
- name: Install dependencies
2323
run: |
24-
pip install -e '.[test]'
24+
pip install --group dev
2525
- name: Run tests
2626
run: |
2727
pytest

.github/workflows/spellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
cache-dependency-path: pyproject.toml
1616
- name: Install dependencies
1717
run: |
18-
pip install -e '.[docs]'
18+
pip install . --group docs
1919
- name: Check spelling
2020
run: |
2121
codespell docs/*.rst --ignore-words docs/codespell-ignore-words.txt

.github/workflows/test-coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install Python dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
python -m pip install -e .[test]
27+
python -m pip install . --group dev
2828
python -m pip install pytest-cov
2929
- name: Run tests
3030
run: |-

.github/workflows/test-sqlite-support.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- run: python3 -c "import sqlite3; print(sqlite3.sqlite_version)"
3535
- name: Install dependencies
3636
run: |
37-
pip install -e '.[test]'
37+
pip install . --group dev
3838
pip freeze
3939
- name: Run tests
4040
run: |

.github/workflows/test.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ jobs:
2424
cache-dependency-path: pyproject.toml
2525
- name: Install dependencies
2626
run: |
27-
pip install -e '.[test,mypy,flake8]'
28-
- name: Optionally install tui dependencies
29-
run: pip install -e '.[tui]'
27+
pip install . --group dev
3028
- name: Optionally install numpy
3129
if: matrix.numpy == 1
3230
run: pip install numpy

.gitpod.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

.readthedocs.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ sphinx:
44
configuration: docs/conf.py
55

66
build:
7-
os: ubuntu-22.04
7+
os: ubuntu-24.04
88
tools:
9-
python: "3.11"
10-
11-
python:
12-
install:
13-
- method: pip
14-
path: .
15-
extra_requirements:
16-
- docs
9+
python: "3.13"
10+
jobs:
11+
install:
12+
- pip install --upgrade pip
13+
- pip install . --group docs
1714

1815
formats:
1916
- pdf

Justfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@
33

44
# Run pytest with supplied options
55
@test *options:
6-
just run pytest {{options}}
6+
uv run pytest {{options}}
77

88
@run *options:
9-
uv run --isolated --with-editable '.[test,mypy,flake8,docs]' -- {{options}}
9+
uv run -- {{options}}
1010

1111
# Run linters: black, flake8, mypy, cog
1212
@lint:
1313
just run black . --check
14-
just run flake8
15-
just run mypy sqlite_utils tests
16-
just run cog --check README.md docs/*.rst
17-
just run codespell docs/*.rst --ignore-words docs/codespell-ignore-words.txt
14+
uv run flake8
15+
uv run mypy sqlite_utils tests
16+
uv run cog --check README.md docs/*.rst
17+
uv run --group docs codespell docs/*.rst --ignore-words docs/codespell-ignore-words.txt
1818

1919
# Rebuild docs with cog
2020
@cog:
21-
just run cog -r README.md docs/*.rst
21+
uv run --group docs cog -r README.md docs/*.rst
2222

2323
# Serve live docs on localhost:8000
2424
@docs: cog
2525
#!/usr/bin/env bash
2626
cd docs
27-
uv run --isolated --with-editable '../.[test,docs]' make livehtml
27+
uv run --group docs make livehtml
2828

2929

3030
# Apply Black
3131
@black:
32-
just run black .
32+
uv run black .

docs/contributing.rst

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,78 +13,61 @@ All improvements to the software should start with an issue. Read `How I build a
1313
Obtaining the code
1414
==================
1515

16-
To work on this library locally, first checkout the code. Then create a new virtual environment::
16+
To work on this library locally, first checkout the code::
1717

1818
git clone [email protected]:simonw/sqlite-utils
1919
cd sqlite-utils
20-
python3 -mvenv venv
21-
source venv/bin/activate
2220

23-
Or if you are using ``pipenv``::
21+
Use ``uv run`` to run the development version of the tool::
2422

25-
pipenv shell
26-
27-
Within the virtual environment running ``sqlite-utils`` should run your locally editable version of the tool. You can use ``which sqlite-utils`` to confirm that you are running the version that lives in your virtual environment.
23+
uv run sqlite-utils --help
2824

2925
.. _contributing_tests:
3026

3127
Running the tests
3228
=================
3329

34-
To install the dependencies and test dependencies::
35-
36-
pip install -e '.[test]'
30+
Use ``uv run`` to run the tests::
3731

38-
To run the tests::
39-
40-
pytest
32+
uv run pytest
4133

4234
.. _contributing_docs:
4335

4436
Building the documentation
4537
==========================
4638

47-
To build the documentation, first install the documentation dependencies::
48-
49-
pip install -e '.[docs]'
39+
To build the documentation run this command::
5040

51-
Then run ``make livehtml`` from the ``docs/`` directory to start a server on port 8000 that will serve the documentation and live-reload any time you make an edit to a ``.rst`` file::
41+
uv run make livehtml --directory docs
5242

53-
cd docs
54-
make livehtml
43+
This will start a server on port 8000 that will serve the documentation and live-reload any time you make an edit to a ``.rst`` file.
5544

5645
The `cog <https://github.com/nedbat/cog>`__ tool is used to maintain portions of the documentation. You can run it like so::
5746

58-
cog -r docs/*.rst
47+
uv run cog -r docs/*.rst
5948

6049
.. _contributing_linting:
6150

6251
Linting and formatting
6352
======================
6453

65-
``sqlite-utils`` uses `Black <https://black.readthedocs.io/>`__ for code formatting, and `flake8 <https://flake8.pycqa.org/>`__ and `mypy <https://mypy.readthedocs.io/>`__ for linting and type checking.
54+
``sqlite-utils`` uses `Black <https://black.readthedocs.io/>`__ for code formatting, and `flake8 <https://flake8.pycqa.org/>`__ and `mypy <https://mypy.readthedocs.io/>`__ for linting and type checking::
6655

67-
Black is installed as part of ``pip install -e '.[test]'`` - you can then format your code by running it in the root of the project::
56+
uv run black .
6857

69-
black .
58+
Linting tools can be run like this::
7059

71-
To install ``mypy`` and ``flake8`` run the following::
72-
73-
pip install -e '.[flake8,mypy]'
74-
75-
Both commands can then be run in the root of the project like this::
76-
77-
flake8
78-
mypy sqlite_utils
60+
uv run flake8
61+
uv run mypy sqlite_utils
7962

8063
All three of these tools are run by our CI mechanism against every commit and pull request.
8164

8265
.. _contributing_just:
8366

84-
Using Just and uv
85-
=================
67+
Using Just
68+
==========
8669

87-
If you install `Just <https://github.com/casey/just>`__ and `uv <https://github.com/astral-sh/uv>`__ you can use them to manage your local development environment.
70+
If you install `Just <https://github.com/casey/just>`__ you can use it to manage your local development environment.
8871

8972
To run all of the tests and linters::
9073

pyproject.toml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,43 +31,41 @@ dependencies = [
3131
"pip",
3232
]
3333

34-
[project.urls]
35-
Homepage = "https://github.com/simonw/sqlite-utils"
36-
Documentation = "https://sqlite-utils.datasette.io/en/stable/"
37-
Changelog = "https://sqlite-utils.datasette.io/en/stable/changelog.html"
38-
Issues = "https://github.com/simonw/sqlite-utils/issues"
39-
CI = "https://github.com/simonw/sqlite-utils/actions"
40-
41-
[project.scripts]
42-
sqlite-utils = "sqlite_utils.cli:cli"
43-
44-
[project.optional-dependencies]
45-
test = [
34+
[dependency-groups]
35+
dev = [
4636
"black>=24.1.1",
4737
"cogapp",
4838
"hypothesis",
4939
"pytest",
50-
]
51-
docs = [
52-
"beanbag-docutils>=2.0",
53-
"codespell",
54-
"furo",
55-
"pygments-csv-lexer",
56-
"sphinx-autobuild",
57-
"sphinx-copybutton",
58-
]
59-
mypy = [
40+
# mypy
6041
"data-science-types",
6142
"mypy",
6243
"types-click",
6344
"types-pluggy",
6445
"types-python-dateutil",
6546
"types-tabulate",
66-
]
67-
flake8 = [
47+
# flake8
6848
"flake8",
6949
"flake8-pyproject",
7050
]
51+
docs = [
52+
"beanbag-docutils>=2.0",
53+
"codespell",
54+
"furo",
55+
"pygments-csv-lexer",
56+
"sphinx-autobuild",
57+
"sphinx-copybutton",
58+
]
59+
60+
[project.urls]
61+
Homepage = "https://github.com/simonw/sqlite-utils"
62+
Documentation = "https://sqlite-utils.datasette.io/en/stable/"
63+
Changelog = "https://sqlite-utils.datasette.io/en/stable/changelog.html"
64+
Issues = "https://github.com/simonw/sqlite-utils/issues"
65+
CI = "https://github.com/simonw/sqlite-utils/actions"
66+
67+
[project.scripts]
68+
sqlite-utils = "sqlite_utils.cli:cli"
7169

7270
[build-system]
7371
requires = ["setuptools"]

0 commit comments

Comments
 (0)