Skip to content

Commit 6290cac

Browse files
authored
Fix tox docs job (#550)
* Fix tox docs job * Clean up tox.ini * Remove browser invocation from `make docs`
1 parent f97018e commit 6290cac

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,12 @@ coverage: ## check code coverage quickly with the default Python
6666
$(BROWSER) htmlcov/index.html
6767

6868
docs: ## generate Sphinx HTML documentation, including API docs
69-
rm -f docs/cattr.rst
70-
rm -f docs/modules.rst
71-
sphinx-apidoc -o docs/ src/cattr
7269
$(MAKE) -C docs clean
7370
$(MAKE) -C docs doctest
7471
$(MAKE) -C docs html
75-
$(BROWSER) docs/_build/html/index.html
7672

77-
servedocs: docs ## compile the docs watching for changes
78-
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
73+
htmllive: docs ## compile the docs watching for changes
74+
$(MAKE) -C docs htmllive
7975

8076
bench-cmp:
8177
pytest bench --benchmark-compare

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
<em>Great software needs great data structures.</em>
55
</p>
66

7-
<a href="https://pypi.python.org/pypi/cattrs"><img src="https://img.shields.io/pypi/v/cattrs.svg"/></a>
8-
<a href="https://github.com/python-attrs/cattrs/actions?workflow=CI"><img src="https://github.com/python-attrs/cattrs/workflows/CI/badge.svg"/></a>
9-
<a href="https://catt.rs/en/latest/?badge=latest"><img src="https://readthedocs.org/projects/cattrs/badge/?version=latest" alt="Documentation Status"/></a>
10-
<a href="https://github.com/python-attrs/cattrs"><img src="https://img.shields.io/pypi/pyversions/cattrs.svg" alt="Supported Python versions"/></a>
11-
<a href="https://github.com/python-attrs/cattrs/actions/workflows/main.yml"><img src="https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/Tinche/22405310d6a663164d894a2beab4d44d/raw/covbadge.json"/></a>
12-
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg"/></a>
7+
[![PyPI](https://img.shields.io/pypi/v/cattrs.svg)](https://pypi.python.org/pypi/cattrs)
8+
[![Build](https://github.com/python-attrs/cattrs/workflows/CI/badge.svg)](https://github.com/python-attrs/cattrs/actions?workflow=CI)
9+
[![Documentation Status](https://readthedocs.org/projects/cattrs/badge/?version=latest)](https://catt.rs/)
10+
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/cattrs.svg)](https://github.com/python-attrs/cattrs)
11+
[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/Tinche/22405310d6a663164d894a2beab4d44d/raw/covbadge.json)](https://github.com/python-attrs/cattrs/actions/workflows/main.yml)
12+
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
13+
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
1314

1415
---
1516

16-
**cattrs** is an open source Python library for structuring and unstructuring
17-
data. _cattrs_ works best with _attrs_ classes, dataclasses and the usual
17+
**cattrs** is an open source Python library for structuring and unstructuring data.
18+
_cattrs_ works best with _attrs_ classes, dataclasses and the usual
1819
Python collections, but other kinds of classes are supported by manually
1920
registering converters.
2021

docs/customizing.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,13 @@ To only un/structure _some_ named tuples into dictionaries,
255255
change the predicate function when registering the hook factory:
256256

257257
```{doctest} namedtuples
258+
:options: +ELLIPSIS
259+
258260
>>> c.register_unstructure_hook_factory(
259261
... lambda t: t is MyNamedTuple,
260262
... namedtuple_dict_unstructure_factory,
261263
... )
264+
<function namedtuple_dict_unstructure_factory at ...>
262265
```
263266

264267
## Using `cattrs.gen` Generators

tox.ini

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ python =
44
3.8: py38
55
3.9: py39
66
3.10: py310
7-
3.11: py311
7+
3.11: py311, docs
88
3.12: py312, lint
99
pypy-3: pypy38
1010

1111
[tox]
12-
envlist = pypy38, py38, py39, py310, py311, py312, lint
12+
envlist = pypy38, py38, py39, py310, py311, py312, lint, docs
1313
isolated_build = true
1414
skipsdist = true
1515

@@ -55,9 +55,10 @@ commands_pre =
5555
basepython = python3.11
5656
setenv =
5757
PYTHONHASHSEED = 0
58-
deps =
59-
sphinx
60-
zope.interface
58+
commands_pre =
59+
pdm sync -G :all,docs
6160
commands =
6261
make docs
63-
allowlist_externals = make
62+
allowlist_externals =
63+
make
64+
pdm

0 commit comments

Comments
 (0)