{"categories":[{"label":"Build Tools","url":"https://skillfed.io/packages/category/software-development-build-tools/3"}],"enrichment":{"capability":"A Hatch build hook that integrates Polylith architecture bricks into Python packages and optionally rewrites imports to add a custom namespace during packaging.","skillfed_tags":["monorepo","polylith-architecture","hatch-plugin"],"use_cases":["Publishing multiple Python libraries from a Polylith monorepo without namespace collisions when installed together.","Automatically including Polylith bricks in wheel and sdist distributions during Hatch builds.","Adding a custom namespace prefix to library code during packaging to isolate it from other monorepo libraries.","Simplifying build configuration for Polylith workspaces by automating brick discovery and inclusion.","Rewriting internal imports in source code to reflect a different namespace structure in the published package."],"what_it_does":"This package is a Hatch build hook that bridges Polylith architecture\u2014a modular monorepo pattern\u2014with Python packaging. It reads brick definitions from your pyproject.toml (paths to bases and components in your Polylith workspace) and ensures they are correctly included in built wheels and source distributions. The hook also solves a real packaging problem: when multiple libraries built from the same monorepo share the same top-level namespace, they collide when installed in the same environment. This hook can rewrite imports during packaging to add a custom namespace wrapper, preventing those collisions.\n\nThe rewriting uses Python's ast module to parse and modify source code, injecting a custom top namespace into all imports. Without a custom namespace configured, the hook simply includes bricks as-is. It's designed for teams using Polylith who need to publish multiple independent libraries from a single workspace without namespace conflicts.","worth_installing":"Yes, if you are using Hatch as your build backend and Polylith as your monorepo architecture. The hook solves the specific problem of packaging multiple libraries from one workspace without namespace conflicts. Install friction is low, maintenance is active, and there are no known vulnerabilities. Not relevant if you are not using Polylith or a different build system."},"id":"hatch-polylith-bricks","links":{"html":"https://skillfed.io/packages/hatch-polylith-bricks","md":"https://skillfed.io/packages/hatch-polylith-bricks.md","pypi":"https://pypi.org/project/hatch-polylith-bricks/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-07-03","license_spdx":null,"license_treatment":"permissive","name":"hatch-polylith-bricks","python_support":"supports_current","summary":"Hatch build hook plugin for Polylith"},"popularity":{"monthly_downloads":299580,"position":7857,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.5.7"}
