bayesflow-packaging

Configure BayesFlow extension packages with src layout and pyproject.toml.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/matthiaskloft/claude-skills --skill bayesflow-packaging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bayesflow-packaging
Source: https://github.com/matthiaskloft/claude-skills/tree/main/bayesflow/skills/bayesflow-packaging
Command: npx skills add https://github.com/matthiaskloft/claude-skills --skill bayesflow-packaging

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexities of structuring, versioning, and configuring Python packages, specifically for the BayesFlow ecosystem, ensuring consistency and adherence to best practices.

Core Features & Use Cases

  • Package Structure: Enforces the src/ layout convention for cleaner project organization.
  • API Management: Guides on managing __all__ for public symbol visibility and version detection.
  • Dependency Handling: Provides templates for pyproject.toml, including optional dependencies and CI configuration.
  • Use Case: When adding a new feature that requires an optional dependency like calibration, this skill helps correctly define it in pyproject.toml and implement guarded imports in your code.

Quick Start

Use the bayesflow-packaging skill to set up a new BayesFlow extension package with a standard src-layout and pyproject.toml.

Frequently Asked Questions about bayesflow-packaging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Python package using a src layout and pyproject.toml?

To structure a Python package using a src layout, place your code in a src/ directory and configure build settings in pyproject.toml. This separation enforces cleaner project organization, prevents local import errors during testing, and separates source files from configuration.

How do I define optional dependencies in pyproject.toml for a Python package?

You define optional dependencies in pyproject.toml under the project section using the optional-dependencies field. This manages feature availability like calibration, allowing users to install extras only when needed and implementing guarded imports in code.

What is the best way to manage API exports with __all__ in a Python package?

Managing API exports with __all__ involves defining a list of public symbols in your module's __init__.py. This explicitly controls public visibility, ensuring only intended classes and functions are exposed to users importing your Python package.

How do I implement version detection patterns for Python extension packages?

Implement version detection patterns by reading from package metadata or a dedicated version file. This enables dynamic versioning in pyproject.toml, ensuring your Python extension package reports its version accurately without hardcoding or duplication.

Can I use pyproject.toml to configure CI for Python package development?

Yes, you can use pyproject.toml to configure CI for Python package development. It centralizes dependency declarations and optional features, ensuring CI environments install the correct packages for testing and building your project.

Why use a src layout instead of a flat layout for Python package development?

Use a src layout instead of a flat layout to prevent local import errors during testing. This structure ensures tests run against the installed package rather than the local directory, improving packaging reliability and consistency.