Skip to content

Commit 3a2b9a9

Browse files
committed
fundamental environment renovation - NO FUNCTIONAL CHANGES
1 parent 06e2f53 commit 3a2b9a9

File tree

73 files changed

+1321
-424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1321
-424
lines changed

.codespellignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
udo
2+
anchestors

.github/workflows/main.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ jobs:
88
os:
99
- "ubuntu-latest"
1010
- "macos-latest"
11-
- "windows-latest"
11+
# - "windows-latest"
1212
python-version:
13-
- "3.7"
14-
- "3.8"
1513
- "3.9"
1614
- "3.10"
1715
- "3.11"
@@ -26,6 +24,8 @@ jobs:
2624
python-version: ${{ matrix.python-version }}
2725
enable-cache: true
2826
cache-dependency-glob: "uv.lock"
27+
- name: Install graphviz
28+
run: sudo apt install -y graphviz || true
2929
- name: Run all
3030
run: make all
3131
- name: Upload coverage data to coveralls.io

.pre-commit-config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
exclude: ^tests/refdata/.*
12
repos:
23
- repo: https://github.com/astral-sh/ruff-pre-commit
34
# Ruff version.

CONTRIBUTING.md

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Please install these tools:
1212
* [`make`](https://www.gnu.org/software/make/)
1313
* [`git`](https://git-scm.com/)
1414
* [Visual Studio Code](https://code.visualstudio.com/)
15+
* [`graphviz`](https://graphviz.org/)
1516

1617

1718
### Editor
@@ -31,6 +32,8 @@ make all
3132

3233
See `make help` for any further details.
3334

35+
Please note that `tests/refdata` contains reference data from test runs.
36+
`make test2refdata` updates this directory.
3437

3538
## Project Structure
3639

@@ -63,6 +66,8 @@ Next to that, there are some temporary files ignored by version control system.
6366
* 2.x.x can be merged to 3.x.x
6467
* `main`
6568
* 2.x.x can be merged to main
69+
70+
6671
### Release
6772

6873
```bash

Makefile

+11-7
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,23 @@ test: .venv/.valid ## [ALL] Run Unittests via 'pytest' with {PYTEST_OPTIONS}
3131
@echo "See coverage report:\n\n file://${PWD}/htmlcov/index.html\n"
3232

3333

34+
.PHONY: test2refdata
35+
test2refdata: .venv/.valid ## Run Unittests via 'pytest' with {PYTEST_OPTIONS} and update tests/refdata
36+
rm -rf tests/refdata
37+
touch .test2ref
38+
${ENV} pytest -vv ${PYTEST_OPTIONS}
39+
@echo "See coverage report:\n\n file://${PWD}/htmlcov/index.html\n"
40+
rm .test2ref
41+
42+
3443
.PHONY: checktypes
3544
checktypes: .venv/.valid ## [ALL] Run Type-Checking via 'mypy'
36-
${ENV} mypy .
45+
${ENV} mypy src
3746

3847

3948
.PHONY: doc
4049
doc: .venv/.valid ## [ALL] Build Documentation via 'mkdocs'
41-
${ENV} mkdocs build --strict
42-
43-
44-
.PHONY: doc-serve
45-
doc-serve: .venv/.valid ## Start Local Documentation Server via 'mkdocs'
46-
${ENV} mkdocs serve --no-strict
50+
${ENV} make html -C docs
4751

4852

4953
.PHONY: code

README.rst

-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
.. image:: https://coveralls.io/repos/github/c0fec0de/anytree/badge.svg
1111
:target: https://coveralls.io/github/c0fec0de/anytree
1212

13-
.. image:: https://readthedocs.org/projects/anytree/badge/?version=stable
14-
:target: https://anytree.readthedocs.io/en/stable
15-
1613
.. image:: https://api.codeclimate.com/v1/badges/e6d325d6fd23a93aab20/maintainability
1714
:target: https://codeclimate.com/github/c0fec0de/anytree/maintainability
1815
:alt: Maintainability

conftest.py

-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55

66
@pytest.fixture(autouse=True)
77
def _docdir(request):
8-
98
# Trigger ONLY for the doctests.
109
doctest_plugin = request.config.pluginmanager.getplugin("doctest")
1110
if isinstance(request.node, doctest_plugin.DoctestItem):
12-
1311
# Get the fixture dynamically by its name.
1412
tmpdir = request.getfixturevalue("tmpdir")
1513

docs/dotexport.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This tree::
1919
Can be rendered to a tree by :any:`RenderTreeGraph`::
2020

2121
>>> from anytree.dotexport import RenderTreeGraph
22-
>>> RenderTreeGraph(root).to_picture("tree.png")
22+
>>> RenderTreeGraph(root).to_picture("tree.png") # doctest: +SKIP
2323

2424
.. image:: static/tree.png
2525

docs/index.rst

+3-19
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,9 @@ Any Python Tree Data
1717
.. image:: https://readthedocs.org/projects/anytree/badge/?version=stable
1818
:target: https://anytree.readthedocs.io/en/stable/
1919

20-
.. image:: https://api.codeclimate.com/v1/badges/e6d325d6fd23a93aab20/maintainability
21-
:target: https://codeclimate.com/github/c0fec0de/anytree/maintainability
22-
:alt: Maintainability
23-
2420
.. image:: https://img.shields.io/pypi/pyversions/anytree.svg
2521
:target: https://pypi.python.org/pypi/anytree
2622

27-
.. image:: https://img.shields.io/badge/code%20style-pep8-brightgreen.svg
28-
:target: https://www.python.org/dev/peps/pep-0008/
29-
30-
.. image:: https://img.shields.io/badge/code%20style-pep257-brightgreen.svg
31-
:target: https://www.python.org/dev/peps/pep-0257/
32-
33-
.. image:: https://img.shields.io/badge/linter-pylint-%231674b1?style=flat
34-
:target: https://www.pylint.org/
35-
36-
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
37-
:target: https://github.com/psf/black
38-
3923
.. image:: https://img.shields.io/github/contributors/c0fec0de/anytree.svg
4024
:target: https://github.com/c0fec0de/anytree/graphs/contributors/
4125

@@ -135,7 +119,7 @@ For details see :any:`Node` and :any:`RenderTree`.
135119

136120
>>> from anytree.exporter import UniqueDotExporter
137121
>>> # graphviz needs to be installed for the next line!
138-
>>> UniqueDotExporter(udo).to_picture("udo.png")
122+
>>> UniqueDotExporter(udo).to_picture("udo.png") # doctest: +SKIP
139123

140124
.. image:: static/udo.png
141125

@@ -144,7 +128,7 @@ The :any:`UniqueDotExporter` can be started at any node and has various formatti
144128
>>> UniqueDotExporter(dan,
145129
... nodeattrfunc=lambda node: "fixedsize=true, width=1, height=1, shape=diamond",
146130
... edgeattrfunc=lambda parent, child: "style=bold"
147-
... ).to_picture("dan.png")
131+
... ).to_picture("dan.png") # doctest: +SKIP
148132

149133
.. image:: static/dan.png
150134

@@ -204,7 +188,7 @@ Node('/Mary')
204188

205189
**Extending any python class to become a tree node**
206190

207-
The enitre tree magic is encapsulated by :any:`NodeMixin`,
191+
The entire tree magic is encapsulated by :any:`NodeMixin`,
208192
add it as base class and the class becomes a tree node:
209193

210194
>>> from anytree import NodeMixin, RenderTree

docs/tricks/consistencychecks.rst

-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ In case of any concerns about the internal data consistency or just for safety,
1010

1111
>>> import anytree
1212
>>> anytree.config.ASSERTIONS = True
13-

docs/tricks/readonly.rst

-1
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,3 @@ a
136136
│ └── a1a
137137
└── a2
138138
└── a0
139-

docs/tricks/weightededges.rst

-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,3 @@ a (0)
4242
... ).to_picture("weight.png") # doctest: +SKIP
4343

4444
.. image:: ../static/weight.png
45-

docs/tricks/yaml.rst

-1
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,3 @@ AnyNode(a='root')
9898
.. _YAML: https://en.wikipedia.org/wiki/YAML
9999

100100
.. _PYYAML: http://pyyaml.org/wiki/PyYAMLDocumentation
101-

0 commit comments

Comments
 (0)