Skip to main content

codeality-py

Structural linter and config scaffolder for Python: atomic files, placement, size caps, no inline SQL. Brings the same discipline as @syntopica/eslint-config and cargo-baseline to Python projects.

Install

uv add --dev syntopica-codeality-py

Usage

codeality-py init [--check|--apply|--force]  # scaffold ruff, mypy, deptry,
                                            # pytest, coverage and CI config
codeality-py check [PATH...]                 # run the structural rules
codeality-py gate                            # run the whole quality chain
codeality-py baseline create|update|check    # track migration debt

init never overwrites: it merges into existing configuration, or reports a conflict. check never writes. gate fails when a required tool is absent rather than skipping it.

Rules

Code Rule Enforces
BPY000 parse-error A file that fails to parse is a finding, never a silent skip.
BPY001 one-primary-unit Exactly one primary declaration per ordinary module.
BPY002 file-matches-unit File name is the snake_case of its primary declaration.
BPY003 no-grab-bag-names No utils, helpers, misc or common in any path segment.
BPY004 max-file-lines Code-line cap per file; tests get their own, looser cap.
BPY005 barrel-only-init __init__.py holds imports, __all__ and nothing else.
BPY006 no-inline-sql SQL lives in resource files, not in string literals.

Suite time budget

# codeality-py.toml
test-budget-seconds = 300

Past the budget a passing suite is a finding: the pytest stage reports over-budget, exits 1, and its detail carries the slowest tests. The procedure - profile, make the unit under test cheaper, parallelise, serialise what must stay shared - is in docs/standards/testing.md.

The budget is tuned to the machine the suite is developed on. A slower environment, such as a CI runner, sets its own for the run instead of raising the committed number for everyone:

# .github/workflows/quality.yml
env:
  CODEALITY_PY_TEST_BUDGET_SECONDS: '600'

When CODEALITY_PY_TEST_BUDGET_SECONDS is set it replaces test-budget-seconds; unset or empty, it changes nothing. A value that is not a positive integer is a configuration error (exit 2), never silently ignored. The pytest stage names the budget it was held to and where it came from - budget 600s from CODEALITY_PY_TEST_BUDGET_SECONDS - in its text line, its detail, and the budget_seconds and budget_source fields of gate --json.

Exit codes

Code Meaning
0 All blocking checks passed.
1 Policy findings.
2 Invalid usage or invalid configuration.
3 Infrastructure failure: a required tool is missing or unusable.

License

MIT

Metadata

Release files for syntopica-codeality-py 0.2.5

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

Source distribution (sdist)

Source distribution for syntopica-codeality-py 0.2.5
File Size Uploaded
syntopica_codeality_py-0.2.5.tar.gz 140.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for syntopica-codeality-py 0.2.5
File Interpreter ABI Platform
syntopica_codeality_py-0.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 240.8 kB

Release files / syntopica_codeality_py-0.2.5.tar.gz

Download URL syntopica_codeality_py-0.2.5.tar.gz
Size 140.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a56fea49fafc32ff4107b5640504ff87953b4f252b5db10c334b740d27872260
BLAKE2b-256 checksum
How to use checksums
c9061ab4bbd60278641ca502439658ba629a403292535c4c08cb9529d70d8b02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / syntopica_codeality_py-0.2.5-py3-none-any.whl

Download URL syntopica_codeality_py-0.2.5-py3-none-any.whl
Size 100.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
634d14dbffcd4c81d5c17548b138c3d778a3ac571d3ef0df26bb1b587b471515
BLAKE2b-256 checksum
How to use checksums
a5a8e4b3ee0bbe60adcdba2c92b14c7dc7e0cddcaefefef0b114ffebb515a7f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.6

2 release files

This release

0.2.5 This release

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

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