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.0.tar.gz (16.1 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.0-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

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

Hashes for mxm_foundry-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a9d63487ebb604f3ea9194c679b84a3413ecb3b49053e8c60ac2eb0cdd1bb85a
MD5 d9e5ff6be143b9e019a1b88ab4d950f9
BLAKE2b-256 04970f99e5733954565340c81b659ba507c7c7519f2650d0ddd1afc62d1de327

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxm_foundry-0.1.0.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.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

Hashes for mxm_foundry-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43d5c9a85672061dfe5366910794353ae6f713de259f1e1ca95ff7e058d5d70b
MD5 8e1decb9f168e511eb7f03483a55dd81
BLAKE2b-256 a4970752a59a6f69ae731e51493ec14b352a87abbb9718cf1a886ec9496fb0ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for mxm_foundry-0.1.0-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