Skip to content

Commit 204f246

Browse files
docs: Recommend globally installed tox instead of poetry installed tox (#223)
docs: Remove pydantic v1/v2 branch note from developer setup guide chore: Remove `dev` extras and `tox` from pyproject.toml
1 parent 5a21c2a commit 204f246

File tree

2 files changed

+30
-31
lines changed

2 files changed

+30
-31
lines changed

docs/source/developers/setup.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,13 @@ Cloning repository
2020
git clone https://github.com/mansenfranzen/autodoc_pydantic.git
2121
cd autodoc_pydantic
2222
23-
.. note::
24-
25-
In June 2023, **pydantic v2** was released. This introduced backwards
26-
incompatible API and behavioral changes in comparison to pydantic v1. Hence,
27-
**autodoc_pydantic** required substantial adjustments, too. In order to keep
28-
the codebase clean and concise, separate versions for v1 and v2 were
29-
created. The v2 branch will eventually become the new `main`_ branch while
30-
the code for v1 remains in the `main-1.x`_ branch.
31-
32-
In a nutshell, if you want to work on v1, please checkout the corresponding
33-
`main-1.x`_ branch. Otherwise, refer to the `main`_ branch.
3423
3524
Creating environment
3625
--------------------
3726

3827
.. code-block:: bash
3928
40-
poetry install -E dev -E erdantic
29+
poetry install --all-extras
4130
4231
-----------------------
4332
Running & writing tests
@@ -52,14 +41,24 @@ with pytest, run ``poetry run pytest``.
5241
tox
5342
---
5443

55-
For more sophisticated testing, you can use tox for different test
56-
environments. A test environment is characterized by varying versions of
57-
*autodoc_pydantic*'s dependencies like pydantic, sphinx and sphinx-tabs:
44+
For more sophisticated testing, use `tox <https://tox.wiki/en/latest>`_
45+
for different test environments. Test environments are characterized
46+
by varying versions of python and *autodoc_pydantic*'s dependencies
47+
like pydantic and sphinx. This is critical for ensuring library
48+
compatibility across different versions of python and pydantic and
49+
sphinx.
50+
51+
**Usage:**
52+
53+
First, make sure you have tox installed globally via ``pipx`` or ``pip``
54+
(see `here <https://tox.wiki/en/latest/installation.html>`_):
55+
56+
Second, to invoke the test suite with tox, run one of the following commands:
5857

59-
- Test a specific environment: ``poetry run tox -e py38-pydantic17-sphinx34``
60-
- Test the latest stable versions from pypi: ``poetry run tox -e latest``
61-
- Test the current developer versions from git repositories: ``poetry run tox -e development``
62-
- Test all available environments: ``poetry run tox`` (not recommended)
58+
- Test a specific environment: ``tox -e py311-pydantic26-sphinx71``
59+
- Test the latest stable versions from pypi: ``tox -e latest``
60+
- Test the current developer versions from git repositories: ``tox -e development``
61+
- Test all available environments: ``tox`` (not recommended)
6362

6463
Please visit the ``tox.ini`` for all available test environments.
6564

@@ -73,6 +72,7 @@ Please visit the ``tox.ini`` for all available test environments.
7372
4. run tests within virtual environment via pytest
7473
5. provide test coverage report
7574

75+
This approach is chosen in the corresponding CI/CD pipeline.
7676

7777
-----------------------
7878
Building & writing docs

pyproject.toml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,24 @@ python = ">=3.8,<4.0.0"
2424
Sphinx = ">=4.0"
2525
pydantic = ">=2.0,<3.0.0"
2626
pydantic-settings = ">=2.0,<3.0.0"
27-
2827
importlib-metadata = { version = ">1", markers = "python_version <= '3.8'" }
2928

29+
# poetry dependency groups are not used on purpose because they are not natively
30+
# supported with tox. Hence, test/doc dependencies are managed via extras.
31+
# See https://github.com/orgs/python-poetry/discussions/4307
32+
33+
# extras docs
3034
sphinx-rtd-theme = { version = "^1.0", optional = true }
3135
sphinx-tabs = { version = "^3", optional = true }
3236
sphinx-copybutton = { version = "^0.4", optional = true }
3337
sphinxcontrib-mermaid = { version = "^0.7", optional = true }
38+
39+
# extras tests
3440
pytest = {version = "^7", optional = true }
3541
coverage = { version ="^7", optional = true }
3642
flake8 = { version = "^3", optional = true }
37-
tox = { version ="^3", optional = true }
43+
44+
# extras erdantic
3845
erdantic = { version ="^0.6", optional = true }
3946

4047
[tool.pytest.ini_options]
@@ -47,16 +54,8 @@ docs = ["sphinx-rtd-theme",
4754
"sphinxcontrib-mermaid"]
4855

4956
test = ["pytest",
50-
"coverage"]
51-
52-
dev = ["pytest",
53-
"coverage",
54-
"sphinx-rtd-theme",
55-
"sphinx-tabs",
56-
"sphinx-copybutton",
57-
"sphinxcontrib-mermaid",
58-
"flake8",
59-
"tox"]
57+
"coverage",
58+
"flake8"]
6059

6160
erdantic = ["erdantic"]
6261

0 commit comments

Comments
 (0)