Skip to content

Commit 86290a1

Browse files
committed
dependency-groups.dev and switch to uv in docs
1 parent 7b0643f commit 86290a1

File tree

5 files changed

+31
-48
lines changed

5 files changed

+31
-48
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/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: |

docs/contributing.rst

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,49 +13,41 @@ 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]'
37-
38-
To run the tests::
30+
Use `uv run` to run the tests:
3931

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::
39+
To build the documentation run this command::
4840

49-
pip install -e '.[docs]'
41+
uv run make livehtml --directory docs
5042

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::
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.
5244

5345
cd docs
5446
make livehtml
5547

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

58-
cog -r docs/*.rst
50+
uv run cog -r docs/*.rst
5951

6052
.. _contributing_linting:
6153

@@ -64,18 +56,12 @@ Linting and formatting
6456

6557
``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.
6658

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::
68-
69-
black .
70-
71-
To install ``mypy`` and ``flake8`` run the following::
72-
73-
pip install -e '.[flake8,mypy]'
59+
uv run black .
7460

75-
Both commands can then be run in the root of the project like this::
61+
Linting tools can be run like this::
7662

77-
flake8
78-
mypy sqlite_utils
63+
uv run flake8
64+
uv run mypy sqlite_utils
7965

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

pyproject.toml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,44 +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 = [
40+
# docs
5241
"beanbag-docutils>=2.0",
5342
"codespell",
5443
"furo",
5544
"pygments-csv-lexer",
5645
"sphinx-autobuild",
5746
"sphinx-copybutton",
58-
]
59-
mypy = [
47+
# mypy
6048
"data-science-types",
6149
"mypy",
6250
"types-click",
6351
"types-pluggy",
6452
"types-python-dateutil",
6553
"types-tabulate",
66-
]
67-
flake8 = [
54+
# flake8
6855
"flake8",
6956
"flake8-pyproject",
7057
]
7158

59+
[project.urls]
60+
Homepage = "https://github.com/simonw/sqlite-utils"
61+
Documentation = "https://sqlite-utils.datasette.io/en/stable/"
62+
Changelog = "https://sqlite-utils.datasette.io/en/stable/changelog.html"
63+
Issues = "https://github.com/simonw/sqlite-utils/issues"
64+
CI = "https://github.com/simonw/sqlite-utils/actions"
65+
66+
[project.scripts]
67+
sqlite-utils = "sqlite_utils.cli:cli"
68+
7269
[build-system]
7370
requires = ["setuptools"]
7471
build-backend = "setuptools.build_meta"

0 commit comments

Comments
 (0)