Policy-driven validation and standardisation tool for MXM Python packages.
Project description
Policy-driven validation and standardisation tool for Money Ex Machina Python packages.
mxm-foundry defines what constitutes a valid MXM package and provides a single interface (mxm-foundry check) to enforce that contract.
Purpose
MXM packages are designed to be:
- structurally consistent
- fully typed
- reproducibly configured
- CI-ready by construction
- easy to reason about across repositories
mxm-foundry enforces this through a set of checks and policies covering:
- filesystem structure
pyproject.tomlsemantics- typing configuration (Pyright)
- formatting configuration (Black, Ruff, Isort)
- Makefile orchestration (
lint,type,test,check) - testing conventions (pytest)
- documentation structure (
README.md,CHANGELOG.md) - license compliance
A package that passes all checks satisfies the MXM publish contract.
Installation
pip install mxm-foundry
Usage
Run the validation tool against a project:
mxm-foundry check <project-root>
Example:
mxm-foundry check .
Output is grouped by policy and reports:
- individual check results
- policy-level pass/fail status
- summary counts
- non-zero exit code on failure (CI-compatible)
Policy Model
mxm-foundry organises validation into policies:
- License policy — LICENSE presence and canonical content
- Typing policy — Pyright configuration, absence of
[tool.pyright], typing markers - Formatting policy — canonical Black, Ruff, Isort configuration and Makefile integration
- Pyproject policy — structural correctness of
pyproject.toml - Testing policy — pytest usage and Makefile integration
- Check-gate policy — enforcement of
make checkas integration point - Documentation policy — README structure and CHANGELOG presence/format
- Misc policy — remaining structural checks
Each policy aggregates multiple checks and fails atomically if any check fails.
Canonical Configuration
MXM packages are standardised against canonical definitions shipped with mxm-foundry:
canonical/pyproject.tomlcanonical/pyrightconfig.jsoncanonical/Makefile
Checks compare project configuration exactly against these canonical sources.
This ensures:
- zero configuration drift across packages
- predictable tooling behaviour
- uniform developer experience
Makefile Contract
The Makefile is a first-class interface in MXM packages.
Required targets:
fmt— formatting (ruff --fix, black, isort)lint— static checks (ruff, black --check, isort --check)type— type checking (pyright)test— pytest executioncheck— aggregate oflint,type,testci— alias forcheck
make check is the canonical publish gate.
Design Principles
-
Single validation interface
One command (mxm-foundry check) defines package validity. -
Policy-driven architecture
Checks are grouped into semantic domains rather than treated independently. -
Canonical configuration
Tooling configuration is not inferred or approximated; it is enforced. -
Deterministic results
Checks run in a fixed order with stable output. -
Strict typing
Fully Pyright-clean and PEP 561 compliant. -
Minimal implicit behaviour
All structure and configuration is explicit and inspectable.
Development
poetry install
make check
poetry run mxm-foundry --help
License
MIT License. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mxm_foundry-0.1.0.tar.gz.
File metadata
- Download URL: mxm_foundry-0.1.0.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9d63487ebb604f3ea9194c679b84a3413ecb3b49053e8c60ac2eb0cdd1bb85a
|
|
| MD5 |
d9e5ff6be143b9e019a1b88ab4d950f9
|
|
| BLAKE2b-256 |
04970f99e5733954565340c81b659ba507c7c7519f2650d0ddd1afc62d1de327
|
Provenance
The following attestation bundles were made for mxm_foundry-0.1.0.tar.gz:
Publisher:
release.yml on moneyexmachina/mxm-foundry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mxm_foundry-0.1.0.tar.gz -
Subject digest:
a9d63487ebb604f3ea9194c679b84a3413ecb3b49053e8c60ac2eb0cdd1bb85a - Sigstore transparency entry: 1440110871
- Sigstore integration time:
-
Permalink:
moneyexmachina/mxm-foundry@a28c6038b6fd36e3bdb543b2c3a8e6075fd494ac -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/moneyexmachina
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a28c6038b6fd36e3bdb543b2c3a8e6075fd494ac -
Trigger Event:
push
-
Statement type:
File details
Details for the file mxm_foundry-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mxm_foundry-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43d5c9a85672061dfe5366910794353ae6f713de259f1e1ca95ff7e058d5d70b
|
|
| MD5 |
8e1decb9f168e511eb7f03483a55dd81
|
|
| BLAKE2b-256 |
a4970752a59a6f69ae731e51493ec14b352a87abbb9718cf1a886ec9496fb0ea
|
Provenance
The following attestation bundles were made for mxm_foundry-0.1.0-py3-none-any.whl:
Publisher:
release.yml on moneyexmachina/mxm-foundry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mxm_foundry-0.1.0-py3-none-any.whl -
Subject digest:
43d5c9a85672061dfe5366910794353ae6f713de259f1e1ca95ff7e058d5d70b - Sigstore transparency entry: 1440110873
- Sigstore integration time:
-
Permalink:
moneyexmachina/mxm-foundry@a28c6038b6fd36e3bdb543b2c3a8e6075fd494ac -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/moneyexmachina
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a28c6038b6fd36e3bdb543b2c3a8e6075fd494ac -
Trigger Event:
push
-
Statement type: