Skip to content

Commit f43a5ac

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

File tree

72 files changed

+1310
-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.

72 files changed

+1310
-424
lines changed

.codespellignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
udo
2+
anchestors

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ jobs:
77
matrix:
88
os:
99
- "ubuntu-latest"
10-
- "macos-latest"
11-
- "windows-latest"
10+
# - "macos-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-get install -y graphviz
2929
- name: Run all
3030
run: make all
3131
- name: Upload coverage data to coveralls.io

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
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

Lines changed: 5 additions & 0 deletions
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

Lines changed: 11 additions & 7 deletions
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

conftest.py

Lines changed: 0 additions & 2 deletions
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/index.rst

Lines changed: 1 addition & 17 deletions
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

@@ -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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,3 @@ a
136136
│ └── a1a
137137
└── a2
138138
└── a0
139-

docs/tricks/weightededges.rst

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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-

pyproject.toml

Lines changed: 85 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,18 @@
33
name = "anytree"
44
dynamic = ["version"]
55
description = "Powerful and Lightweight Python Tree Data Structure with various plugins"
6-
authors = [
7-
"c0fec0de <[email protected]>"
6+
authors = [{ name = "c0fec0de", email = "[email protected]" }]
7+
dependencies = [
8+
"six>=1.17.0",
89
]
10+
requires-python = ">=3.9.2,<4.0"
911
readme = "README.rst"
1012
license = "Apache-2.0"
11-
keywords = [
12-
"tree",
13-
"tree data",
14-
"treelib",
15-
"tree walk",
16-
"tree structure",
17-
]
13+
keywords = ["tree", "tree data", "treelib", "tree walk", "tree structure"]
1814

1915
classifiers = [
2016
"Topic :: Software Development :: Libraries :: Python Modules",
2117
"Development Status :: 5 - Production/Stable",
22-
"Programming Language :: Python :: 3.7",
23-
"Programming Language :: Python :: 3.8",
2418
"Programming Language :: Python :: 3.9",
2519
"Programming Language :: Python :: 3.10",
2620
"Programming Language :: Python :: 3.11",
@@ -38,12 +32,13 @@ dev = [
3832
"coveralls>=3.3.1",
3933
"mypy>=1.9.0",
4034
"pytest-cov>=5.0.0",
41-
"pytest-xdist>=3.6.1",
4235
"ruff>=0.11.2",
4336
"pre-commit>=4.2.0",
4437
"sphinx>=5.3.0",
4538
"sphinx-rtd-theme>=2.0.0",
4639
"sphinxemoji>=0.3.1",
40+
"test2ref>=0.4.2",
41+
"types-six>=1.17.0.20250403",
4742
]
4843

4944
[build-system]
@@ -69,72 +64,78 @@ select = [
6964
# pyflakes
7065
"F",
7166
# pycodestyle
72-
"E", "W",
67+
"E",
68+
"W",
7369
# pydocstyle
7470
"D",
75-
# pep8-naming
76-
"N",
77-
# flake8-2020
78-
"YTT",
79-
# flake8-bugbear
80-
"B",
81-
# flake8-quotes
82-
"Q",
83-
# flake8-debugger
84-
"T10",
85-
# flake8-gettext
86-
"INT",
87-
# pylint
88-
"PL",
89-
# misc lints
90-
"PIE",
91-
# flake8-pyi
92-
"PYI",
93-
# tidy imports
94-
"TID",
95-
# implicit string concatenation
96-
"ISC",
97-
# type-checking imports
98-
"TC",
99-
# comprehensions
100-
"C",
101-
"C4",
102-
# pygrep-hooks
103-
"PGH",
104-
# Ruff-specific rules
105-
"RUF",
106-
# flake8-bandit: exec-builtin
107-
"S102",
108-
# numpy-legacy-random
109-
"NPY002",
110-
# Perflint
111-
"PERF",
112-
# flynt
113-
"FLY",
114-
# flake8-logging-format
115-
"G",
116-
# pyupgrade
117-
"UP",
118-
# annotation
119-
# "ANN"
120-
# bandit
121-
"S",
122-
# Argument
123-
# "ARG",
124-
# Pathlib
125-
"PTH",
126-
# Simplify
127-
# "SIM",
128-
# Return
129-
"RET",
130-
# Raise
131-
"RSE",
71+
# # pep8-naming
72+
# "N",
73+
# # flake8-2020
74+
# "YTT",
75+
# # flake8-bugbear
76+
# "B",
77+
# # flake8-quotes
78+
# "Q",
79+
# # flake8-debugger
80+
# "T10",
81+
# # flake8-gettext
82+
# "INT",
83+
# # pylint
84+
# "PL",
85+
# # misc lints
86+
# "PIE",
87+
# # flake8-pyi
88+
# "PYI",
89+
# # tidy imports
90+
# "TID",
91+
# # implicit string concatenation
92+
# "ISC",
93+
# # type-checking imports
94+
# "TC",
95+
# # comprehensions
96+
# "C",
97+
# "C4",
98+
# # pygrep-hooks
99+
# "PGH",
100+
# # Ruff-specific rules
101+
# "RUF",
102+
# # flake8-bandit: exec-builtin
103+
# "S102",
104+
# # numpy-legacy-random
105+
# "NPY002",
106+
# # Perflint
107+
# "PERF",
108+
# # flynt
109+
# "FLY",
110+
# # flake8-logging-format
111+
# "G",
112+
# # pyupgrade
113+
# "UP",
114+
# # annotation
115+
# # "ANN"
116+
# # bandit
117+
# "S",
118+
# # Argument
119+
# # "ARG",
120+
# # Pathlib
121+
# "PTH",
122+
# # Simplify
123+
# # "SIM",
124+
# # Return
125+
# "RET",
126+
# # Raise
127+
# "RSE",
132128
]
133129
ignore = [
134130
# too-many-arguments
135131
'PLR0913',
136132
# Ambiguous doc
137-
'D203', 'D212', 'D402', 'D406',
133+
"D100",
134+
"D101",
135+
'D203',
136+
'D212',
137+
'D402',
138+
'D406',
138139
# Multiline doc is ok.
139140
'D200',
140141
# We use the class for constructor doc
@@ -156,30 +157,37 @@ ignore = [
156157
"PLR2004",
157158
# Argument
158159
"ARG001",
160+
# doc
161+
"D100",
162+
"D101",
163+
"D102",
164+
"D103",
165+
# Unused variables
166+
"F841",
159167
]
160168

161169
[tool.ruff.lint.pydocstyle]
162170
convention = "google"
163171

164172
[tool.pytest.ini_options]
165-
addopts ="""
173+
filterwarnings = [
174+
"ignore::DeprecationWarning",
175+
]
176+
addopts = """
166177
--cov src/anytree
167178
--cov-report term
168179
--cov-report html
169-
--doctest-glob=docs/*
180+
--doctest-glob=docs/*.rst
170181
--doctest-modules
171182
--ignore-glob=tests/testdata/*
172183
--log-level=INFO
173184
--junitxml=report.xml
174185
"""
175-
filterwarnings = [
176-
"error",
177-
]
178186

179187
[tool.coverage.report]
180188
exclude_lines = [
181189
'return NotImplemented',
182-
'raise NotImplementedError()',
190+
'raise NotImplementedError',
183191
'pragma: no cover',
184192
'assert False',
185193
]

0 commit comments

Comments
 (0)