Skip to main content

Valkyrja Ruff

Shared Ruff configuration and the copyright header injector for Valkyrja Python repositories.

Ruff enforces the copyright header through CPY001, and it reports a file that does not match. It corrects nothing. Every other language in the organization has a formatter that writes the header: PHP CS Fixer, Spotless, goheader, and the ESLint rule all replace a wrong header. Python had no such tool, so a person added each header by hand.

This package supplies that tool. valkyrja-ruff-header writes the header into every Python file, and it replaces a header that names the wrong package.

The header text lives in this package and nowhere else. A repository supplies only its own package identifier, which it already declares in .github/ci/copyright-header/config. COPYRIGHT_HEADER.md in the .github repository maps every repository to its identifier.

Latest Version on PyPI Supported Python Version License CI Status

Usage

Write the header into every Python file

valkyrja-ruff-header

The command reads src and tests by default. Give it a path to read another one. It reads the identifier from .github/ci/copyright-header/config, so the repository declares its name once.

Report a file that needs the header, and write nothing

valkyrja-ruff-header --check

The command reports a failure when a file needs the header, so a gate can run it.

Options

Option Effect
--check report a file that needs the header, and write nothing
--identifier name the package, instead of reading the repository config
--root name the repository root
--print-ruff-config print the Ruff --config override, and write nothing

What the command does not touch

The command puts the header at the top of the file, below a shebang and below a PEP 263 coding declaration. A shebang that moves off the first line stops working, and a coding declaration that moves below the second line stops being read.

Warning: the command replaces a license header, and it replaces nothing else. A tool that replaces the first comment block removes a comment that explains the code, and the gate then passes because the file carries a correct header. This command reads the leading comment block and requires every marker of a license header in it. A file whose first comment explains the code keeps that comment, and the header goes above it.

What's Included

  • Full CI pipeline — the same Ruff, mypy, Bandit, import-linter, and pytest configuration used across every Valkyrjaio Python repo, each isolated under .github/ci/<tool>/ with its own pyproject.toml + uv.lock
  • uv configuration — a root pyproject.toml whose [tool.poe.tasks] expose a shortcut for each CI tool, matching the org convention
  • Repository conventions — aligned with REPOSITORY_NAMING.md and VOCABULARY.md

Running the CI Tools

Every tool is isolated under .github/ci/<tool>/ with its own pyproject.toml and uv.lock. Drive them through the root poe tasks — each runs the tool from its isolated environment (uv run --project …) against the repo root:

uv run poe ci                # run the full CI gate
uv run poe ruff-format       # auto-format
uv run poe ruff              # lint
uv run poe mypy              # type-check
uv run poe import-linter     # architecture / import boundaries
uv run poe bandit            # security
uv run poe pytest-coverage   # tests + 100% coverage

Versioning and Release Process

This package follows semantic versioning with a major release every year, and support for each major version for 2 years from the date of release.

For more information see our Versioning and Release Process documentation.

Supported Versions

Bug fixes are provided until 3 months after the next major release. Security fixes are provided for 2 years after the initial release.

Version Python Release Bug Fixes Until Security Fixes Until
26 3.14+ March 31, 2026 Q2 2027 Q1 2028

Contributing

This package is an open-source, community-driven project. Improvements to this package itself — refinements to the included CI configuration, uv setup, or documentation — are welcome.

See CONTRIBUTING.md for the submission process and VOCABULARY.md for the terminology used across Valkyrja.

Security Issues

If you discover a security vulnerability, please follow our disclosure procedure.

License

This package is open-source software licensed under the MIT license. See LICENSE.md.

Release files for valkyrja-ci-ruff 26.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for valkyrja-ci-ruff 26.0.2
File Size Uploaded
valkyrja_ci_ruff-26.0.2.tar.gz 46.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for valkyrja-ci-ruff 26.0.2
File Interpreter ABI Platform
valkyrja_ci_ruff-26.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 61.5 kB

Release files / valkyrja_ci_ruff-26.0.2.tar.gz

Download URL valkyrja_ci_ruff-26.0.2.tar.gz
Size 46.5 kB
Tags Source
SHA-256 checksum
How to use checksums
737caaabbdbf08307d25e5349ccff73ce23151cf85d3686c94a80fd713d198b7
BLAKE2b-256 checksum
How to use checksums
973f3de9cdc474ae92b6673b69de7e11b30d126c2338e99ffc93de7d77b06bf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / valkyrja_ci_ruff-26.0.2-py3-none-any.whl

Download URL valkyrja_ci_ruff-26.0.2-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7060ee5cdded786507494117ef9c823a4c853cffcacede3562096045d48e894
BLAKE2b-256 checksum
How to use checksums
52f0fc6e95b5f014467ed583a6b4d8bb60805f1f49a05e6e1f2407d68f569e02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page