Skip to content

Modernize dev tooling: uv + Ruff + Pyrefly, Python 3.13+, pydantic v2, click 8 - #1

Open
giancarlosisasi wants to merge 9 commits into
masterfrom
tooling-improvement
Open

Modernize dev tooling: uv + Ruff + Pyrefly, Python 3.13+, pydantic v2, click 8#1
giancarlosisasi wants to merge 9 commits into
masterfrom
tooling-improvement

Conversation

@giancarlosisasi

Copy link
Copy Markdown
Owner

Summary

Modernizes the danger-python dev toolchain and runtime baseline (OpenSpec change modernize-dev-tooling). One tool per job — uv (env/deps), Ruff (lint + format), Pyrefly (types) — with all tool config consolidated into pyproject.toml.

Toolchain changes

Concern Now Was
Env / deps / lockfile uv (uv.lock, uv_build) Poetry
Lint + format Ruff black + isort + flake8 + pylint
Type checking Pyrefly (0 errors) mypy
Python baseline >=3.13 (CI matrix 3.13 / 3.14) 3.7
Runtime deps pydantic v2, click 8 pydantic v1, click 7
CI GitHub Actions (ci.yml) Travis
Config home pyproject.toml only setup.cfg

BREAKING

  • Requires Python 3.13+ (dropped 3.7–3.12).
  • Runtime migrated to pydantic v2 and click 8 — implementation-only; the Danger DSL, the danger-js invocation contract, and the model JSON shapes are unchanged.

Preserved

  • 100% test-coverage gate (moved to [tool.coverage.report]).
  • The danger-js input/output JSON contract (covered by tests/fixtures/).

Verification

  • Full local gate green on Python 3.13 and 3.14: ruff format --check, ruff check, pyrefly check (0 errors), pytest100% coverage, 56 tests.
  • uv build produces a wheel + sdist (danger_python-0.2.0).
  • openspec validate modernize-dev-tooling --strict passes.

Ships as 0.2.0 (pre-1.0: the package is still Alpha and its public surface is unchanged).

Also consolidate tooling config by moving from setup.cfg to pyproject.toml
- README: uv/ruff/pyrefly dev workflow, GitHub Actions CI badge + static Python 3.13|3.14 badge, Python 3.13+ requirements, GHA CI-step example (replacing Travis), checkout@v4
- CHANGELOG: 0.2.0 entry documenting the toolchain modernization and BREAKING Python/pydantic/click bumps
- pyproject/uv.lock: bump version 0.1.0 -> 0.2.0
Resolve the 50 pyrefly errors in tests/ that were downstream of the pydantic v2 Optional fields (closes task 4.6):
- builder.py: widen build_types param list[SchemaItem] -> Sequence[SchemaItem] (covariant, read-only) to accept list[SchemaObject]/list[SchemaEnum]
- fixtures/danger.py: fix **kwargs annotation (dict[str, Any] -> list[str])
- conftest.py: narrow patcher.fs; pass b'' instead of None to MockPopen stdout
- test_danger/test_models/test_plugins: assert-is-not-None narrowing guards for Optional model fields
- test_plugins: add explicit danger-property cache test (preserves plugins.py branch coverage)

Full gate green on Python 3.13 and 3.14: ruff format/check, pyrefly (0 errors), pytest (100% coverage).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant