[project] name = "anytree" dynamic = ["version"] description = "Powerful and Lightweight Python Tree Data Structure with various plugins" authors = [{ name = "c0fec0de", email = "c0fec0de@gmail.com" }] dependencies = [] requires-python = ">=3.9.2,<4.0" readme = "README.rst" license = "Apache-2.0" keywords = ["tree", "tree data", "treelib", "tree walk", "tree structure"] classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", "Development Status :: 5 - Production/Stable", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", ] [project.urls] "Homepage" = "https://github.com/c0fec0de/anytree" "Documentation" = "https://anytree.readthedocs.io/en/stable/" "Bug Tracker" = "https://github.com/c0fec0de/anytree/issues" [dependency-groups] dev = [ "coveralls>=3.3.1", "mypy>=1.9.0", "pytest-cov>=5.0.0", "ruff>=0.11.2", "pre-commit>=4.2.0", "sphinx>=5.3.0", "sphinx-rtd-theme>=2.0.0", "sphinxemoji>=0.3.1", "test2ref>=0.4.2", ] [build-system] requires = ["pdm-backend"] build-backend = "pdm.backend" [tool.pdm.build] includes = ["src/anytree"] [tool.pdm.version] source = "scm" fallback_version = "0.0.0" [tool.ruff] line-length = 120 fix = true target-version = "py37" [tool.ruff.lint] select = [ # isort "I", # pyflakes "F", # pycodestyle "E", "W", # pydocstyle "D", # pep8-naming "N", # flake8-2020 "YTT", # flake8-bugbear "B", # flake8-quotes "Q", # flake8-debugger "T10", # flake8-gettext "INT", # pylint "PL", # misc lints "PIE", # flake8-pyi # "PYI", # tidy imports "TID", # implicit string concatenation "ISC", # type-checking imports "TC", # comprehensions # "C", "C4", # pygrep-hooks "PGH", # Ruff-specific rules "RUF", # flake8-bandit: exec-builtin "S102", # numpy-legacy-random "NPY002", # Perflint # "PERF", # flynt "FLY", # flake8-logging-format "G", # pyupgrade "UP", # annotation # "ANN" # bandit # "S", # Argument # "ARG", # Pathlib # "PTH", # Simplify # "SIM", # Return "RET", # Raise "RSE", ] ignore = [ # too-many-arguments 'PLR0913', # Ambiguous doc "D100", "D101", 'D203', 'D212', 'D402', 'D406', # Multiline doc is ok. 'D200', # We use the class for constructor doc 'D107', # Magic Method Documentation is optional 'D105', # We use faster isinstance checks 'UP038', # Assert 'S101', # Type-Checking 'TC001', # Indent of doctest 'D412', # unused loop 'B007', ] [tool.ruff.lint.per-file-ignores] "tests/*" = [ # Magic Values "PLR2004", # Argument "ARG001", # doc "D100", "D101", "D102", "D103", # Unused variables "F841", # complexity 'PLR0915', ] [tool.ruff.lint.pydocstyle] convention = "google" [tool.pytest.ini_options] filterwarnings = [ "ignore::DeprecationWarning", ] addopts = """ --cov src/anytree --cov-report term --cov-report html --doctest-glob=docs/*.rst --doctest-modules --ignore-glob=tests/testdata/* --log-level=INFO """ [tool.coverage.report] exclude_lines = [ 'return NotImplemented', 'raise NotImplementedError', 'pragma: no cover', 'assert False', ] [tool.mypy] disable_error_code = "misc" ignore_missing_imports = true