Skip to main content

LuxForge Foundry

Foundry is the shared Python foundation for LuxForge applications.

It provides reusable capabilities that would otherwise be reimplemented across projects — logging, file handling, database utilities, terminal components, shared helpers, and other common application infrastructure.

The package is distributed publicly as luxforge while exposing the foundry Python namespace.

Documentation: see docs/ — how to use Foundry, how to use @luxforge/framework, and the LuxFilm demo app both are proven against.

Installation

Install the latest public release from PyPI:

pip install luxforge

Install the supported PostgreSQL and database-lifecycle facilities with:

pip install "luxforge[postgres]"

Then import only the capabilities you need:

from foundry.logger import logger

For local Foundry development:

git clone <repository-url>
cd Foundry
pip install -e .

What Foundry Provides

Foundry is intended to be a collection of independently reusable capabilities rather than a framework that applications must adopt wholesale.

Current areas include:

  • Logging — shared structured logging through foundry.logger
  • Files — common file reading, writing, and discovery utilities
  • PostgreSQL — connections, transactions, COPY, introspection, managers, durable SQL resources, dependency ordering, managed imports, checksums, validation, and guarded lifecycle operations
  • Colours — shared colour and terminal presentation utilities
  • Menu — reusable terminal menu and input handling
  • Utilities — common helpers used across LuxForge software

Applications can use a single Foundry capability without needing to initialise or depend on the rest of the library.

For example:

from foundry.logger import logger

logger.info("Application started")

Package Structure

Foundry uses a standard src-based Python package layout:

src/
└── foundry/
    ├── colours/
    ├── files/
    ├── logger/
    ├── menu/
    ├── postgres/
    │   └── lifecycle/
    └── utils/

See docs/builtin/foundry/postgres.md for the supported PostgreSQL API and complete lifecycle model.

The public import namespace is deliberately kept separate from the distribution name:

PyPI distribution:  luxforge
Python namespace:    foundry

This means consumers install:

pip install luxforge

and use:

from foundry.logger import logger

Development

Run the Foundry health check:

pwsh .\tooling\build\check.ps1

A successful check reports:

BUILD STATUS: GREEN

Build the package with:

pwsh .\tooling\build\build.ps1

The build process produces both a wheel and source distribution under dist/.

Release builds are verified by installing the generated wheel into a clean environment and testing the public Foundry imports before publication.

Running LuxFilm with Docker

LuxFilm (packages/framework/demo) — Foundry's own @luxforge/framework proving ground — can run as two containers: the Foundry Runtime API and the built frontend, served by nginx.

docker compose -f docker/compose.yaml build
docker compose -f docker/compose.yaml up -d
docker compose -f docker/compose.yaml down
  • Frontend: http://localhost:8080
  • API: http://localhost:8420 (/foundry/*)

Environment variables (set in docker/compose.yaml, or override via docker compose -f docker/compose.yaml run -e ... / a .env file compose picks up automatically):

  • FOUNDRY_RUNTIME_HOST / FOUNDRY_RUNTIME_PORT — what the API binds to inside its container. Defaults to 0.0.0.0:8420; a container needs this bind (unlike a bare-metal dev machine) since the port mapping, not the app's own bind address, is what controls real exposure.
  • FOUNDRY_ALLOWED_ORIGINS — CORS origins the API accepts, since the browser calls it directly from the frontend's own origin (a different port). Defaults to http://localhost:8080.
  • VITE_API_URL — a frontend build argument (docker/compose.yaml's frontend.build.args), baked into the static output at build time. Where the browser reaches the API; defaults to http://localhost:8420.

If you change host ports in docker/compose.yaml, update FOUNDRY_ALLOWED_ORIGINS and VITE_API_URL to match — otherwise the frontend and API can't talk to each other.

This is local/demo tooling, not a production deployment topology — see foundry.runtime's own docs for why Foundry Runtime is normally mounted into a host application rather than run as its own public service.

Releases

Foundry has a guided release process:

pwsh .\tooling\release.ps1

The release tooling validates the repository, version, package, tests, Git state, built artifacts, and installed wheel before creating and publishing a release.

Releases are distributed to:

  • PyPI — public distribution as luxforge
  • Azure Artifacts — LuxForge package feed

Public installation therefore requires no LuxForge-specific package configuration:

pip install luxforge

Direction

Foundry exists to make common LuxForge capabilities something that is built once, tested once, and reused everywhere.

As shared functionality matures, it belongs in Foundry rather than being independently recreated inside each application.

Download files

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

Source Distribution

luxforge-0.2.0.tar.gz (99.1 kB view details)

Uploaded Source

Built Distribution

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

luxforge-0.2.0-py3-none-any.whl (115.6 kB view details)

Uploaded Python 3

File details

Details for the file luxforge-0.2.0.tar.gz.

File metadata

  • Download URL: luxforge-0.2.0.tar.gz
  • Upload date:
  • Size: 99.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for luxforge-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1584055a0e1425871cd8a542eaa24a32a712c71c6675d4499c11703a96b8d34d
MD5 b66277e7b9241d8da72e5f0c36644964
BLAKE2b-256 b099319aedc87e4d3a62a061ed2064796fce38da47527b16f08fe9cb4b5c565d

See more details on using hashes here.

File details

Details for the file luxforge-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: luxforge-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 115.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for luxforge-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 20948096df7ebfd59a3dcafe0861de7ff24ea136485dbc277f9f14aa07e51a63
MD5 c32b6ef53c14681a3c85c93964d4e51b
BLAKE2b-256 b86f3048d72f0dec40a8cf61f074a9c4d52b25951bb8696b318bb37a40025e21

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.2

2 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