Skip to main content

Policy-driven validation and standardisation tool for MXM Python packages.

Project description

Version License Python Checked with pyright

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.toml semantics
  • 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 check as 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.toml
  • canonical/pyrightconfig.json
  • canonical/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 execution
  • check — aggregate of lint, type, test
  • ci — alias for check

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mxm_foundry-0.1.1.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mxm_foundry-0.1.1-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file mxm_foundry-0.1.1.tar.gz.

File metadata

  • Download URL: mxm_foundry-0.1.1.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mxm_foundry-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0d6f786bddadb7efe3876dbc75e15b95f57448dbc0a4d0193bbba7c214510dad
MD5 0f746b6e49ce477c495eb3e2a46536f5
BLAKE2b-256 ba1e3f5d0aecd51bc5009ae0b91808e4619ae7d72340502f254f9ac47570c267

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxm_foundry-0.1.1.tar.gz:

Publisher: release.yml on moneyexmachina/mxm-foundry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mxm_foundry-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mxm_foundry-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mxm_foundry-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c714d0daa16fe310558fd9fbb49022bd4c596d3782edbcdc3a8ff511b802ebe
MD5 3dca4646ecb2989500be94cfacaf38d9
BLAKE2b-256 9ca393000b4ed6d00ee74449ca8d2134e6a7eb502a1b69a512badbc518e540ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxm_foundry-0.1.1-py3-none-any.whl:

Publisher: release.yml on moneyexmachina/mxm-foundry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page