Files
libretro/pyproject.toml
T
Abdessamad Derraz 6d7f81d010 fix: hold the 3.8 screen tests off build modules
The 3.8 run of tests.test_install_tui failed on 9ffbedbb1: installer_build
now caches with functools.cache, and test_install_offline imports
packs.parts, which reaches the core.cli floor exit. The card marker test
skips below 3.9 like the other build-script tests, and packs.parts loads
only above that floor.
2026-11-21 11:18:25 +01:00

120 lines
4.7 KiB
TOML

# Installing the project installs its dependencies and nothing else:
# `pip install -e ".[dev]"` gives a contributor every tool the tests use.
# scripts/ and tests/ run from the checkout, so no package is built from them.
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = []
py-modules = []
[project]
# Not the package PyPI serves (packaging/pypi/ builds that one, named
# retrobios): a contributor's `pip install -e ".[dev]"` and `pip install
# retrobios` in one environment would otherwise replace each other.
name = "retrobios-dev"
version = "1.0.0"
description = "BIOS collection manager for retrogaming platforms"
# install.py is the only entry point a user runs before cloning, and both
# bootstraps accept 3.8, so the floor stays where the bootstraps put it. That
# floor covers install.py and its installer/ source: the build scripts need 3.9
# (scripts/core/cli.py, which every build script imports, checks it), and CI runs the
# test suite on 3.12.
requires-python = ">=3.8"
dependencies = [
"pyyaml",
]
# jsonschema is tooling, not a runtime dependency: scripts/validate_schemas.py
# and the CI contract check are the only callers, and no user path imports it.
[project.optional-dependencies]
dev = [
"jsonschema[format-nongpl]>=4.23",
"markdown>=3.7",
# The installer's full-screen tests: pyte reads the screen back,
# hypothesis fuzzes the key decoder, vermin holds the installer to 3.8.
"pyte>=0.8.2",
"hypothesis>=6.100",
"vermin>=1.9",
# The packaging guard reads this file through setuptools, which pip
# installs only in its isolated build environment and 3.12 no longer
# bundles: without it the guard skipped on every CI run.
"setuptools>=61",
# scripts/build_pypi.py runs `uv build` for the PyPI package and its test.
"uv==0.13.4",
# The type check CI runs, pinned: another mypy reports other errors.
"mypy==2.4.1",
# The lint CI runs, pinned for the same reason.
"ruff==0.17.3",
]
# The site is built by Astro Starlight from website/package.json and its
# lockfile (npm ci --prefix website): no Python package builds it.
[project.urls]
Repository = "https://github.com/Abdess/retrobios"
# The annotations are checked, not only written. Third-party packages are left
# out (no_site_packages) so the result does not depend on what the machine
# has installed: yaml, jsonschema and the rest read as Any everywhere. The
# code carries no type error and CI fails on any.
[tool.mypy]
# installer/ is the source of install.py and both are checked: the modules one
# by one, and the file they are joined into, which is the one people run.
files = ["install.py", "installer", "scripts"]
# The oldest target mypy 2 checks against. The installer's own floor, 3.8, is
# held by vermin (pr_checks.py, validate.yml).
python_version = "3.10"
explicit_package_bases = true
ignore_missing_imports = true
no_site_packages = true
disable_error_code = ["import-untyped"]
cache_dir = "tmp/mypy_cache"
# CI runs this rule set over every Python file (validate.yml, pr_checks.py).
# C901 and the PLR limits hold function size: a function past them is split
# by stage, not exempted.
[tool.ruff]
target-version = "py39"
line-length = 120
extend-exclude = ["bios", "tmp", "website", ".cache", "dist", "data"]
[tool.ruff.lint]
select = ["E", "F", "W", "B", "C90", "SIM", "PERF", "UP", "RET", "PIE", "PLR09", "PLW1510", "RUF100"]
ignore = [
"E501", # long lines are wrapped by hand where it reads better
"UP006", "UP007", "UP035", "UP045", # the installer keeps 3.8 spellings
"UP036", # the runtime floor guards (sys.version_info < (3, 9)) are the point
"SIM300", # an ALL_CAPS name is not always a constant (_SYSTEM_ROOT)
"SIM108", # a ternary is not always clearer than an if block
"PERF203", # try in a loop is the per-item error report
"RET504", "RET505", "RET506", "RET508",
]
[tool.ruff.lint.pyflakes]
# Each test module imports the tests package first for its isolation (offline, scratch under tmp/).
allowed-unused-imports = ["tests"]
[tool.ruff.lint.mccabe]
max-complexity = 15
[tool.ruff.lint.pylint]
max-branches = 15
max-statements = 60
max-args = 8
max-returns = 10
[tool.ruff.lint.per-file-ignores]
"install.py" = ["UP"]
"installer/*.py" = ["UP"]
# The full-screen tests and the modules they import run under the 3.8 floor too.
"tests/__init__.py" = ["UP"]
"tests/sources.py" = ["UP"]
"tests/netguard/*.py" = ["UP"]
"tests/test_install_tui.py" = ["UP"]
"tests/test_install_app.py" = ["UP"]
"tests/test_install_selection.py" = ["UP"]
"tests/test_install_offline.py" = ["UP"]
# Shell fixtures inside string literals keep the tabs the real files have.
"tests/test_launchers_*.py" = ["E101"]