Skip to main content

Unified Python packaging backend for wheels, sdist, and executables

Project description

Poexy-Core

Python Version License

Poexy-Core is an advanced Python build backend based on Poetry that extends the capabilities of Python packaging. It provides a unified solution for building traditional Python packages (wheels, sdist) and standalone executable applications using PyInstaller.

๐Ÿš€ Features

Multi-Format Package Support

  • Wheels: Standard Python packages (source and binary formats)
  • SDist: Source distributions (tar.gz archives)
  • Binary: Standalone executables via PyInstaller integration

Advanced Configuration

  • Extended pyproject.toml syntax with [tool.poexy] sections
  • Granular file inclusion/exclusion control
  • Flexible package format configuration
  • Type-safe configuration validation with Pydantic

PEP 517/518 Compliance

  • Standard build backend interface
  • Compatible with pip, build, and other packaging tools
  • Seamless integration with existing Python workflows

PyInstaller Integration

  • Automatic executable generation
  • Support for onefile and onedir modes
  • Automatic entry point detection
  • Configurable build options

Note: About PyInstaller

  • onedir mode not yet supported
  • Currently, there are no available options to customize the PyInstaller build process for your executable.

๐Ÿ“‹ Requirements

  • Python 3.9 or higher
  • Poetry Core 2.1.0+
  • Pydantic 2.11.7+
  • PyInstaller 6.14.2+
  • Rich 14.0.0+

๐Ÿ“– Usage

Basic Configuration

Add Poexy-Core as your build backend in pyproject.toml:

[build-system]
requires = ["poexy-core"]
build-backend = "poexy_core.api"

Standard Python Package

For a basic Python package with wheels and sdist:

[project]
name = "my-package"
version = "1.0.0"

[build-system]
requires = ["poexy-core"]
build-backend = "poexy_core.api"

[tool.poexy.package.my_package]
source = "src"

Binary Executable

To create a standalone executable:

[project]
name = "my-app"
version = "1.0.0"

[build-system]
requires = ["poexy-core"]
build-backend = "poexy_core.api"

[tool.poexy.package.my_app]
source = "src"

[tool.poexy.wheel]
format = ["binary"]

[tool.poexy.binary]
name = "my-app"
entry_point = "src.main:app"

Multi-Format Package

Create both source and binary formats:

[project]
name = "my-multi-package"
version = "1.0.0"

[build-system]
requires = ["poexy-core"]
build-backend = "poexy_core.api"

[tool.poexy.package.my_multi_package]
source = "src"

[tool.poexy.wheel]
format = ["source", "binary"]

[tool.poexy.binary]
name = "my-app"

With this configuration, Poexy will build a wheel that contains both your Python files and a standalone binary. When the package is installed, pip will place the Python files into site-packages and install the binary into the $prefix/bin/ directory.

Advanced File Management

Control which files are included in your packages:

[project]
name = "my-package"
version = "1.0.0"

[build-system]
requires = ["poexy-core"]
build-backend = "poexy_core.api"

[tool.poexy.package.my_package]
source = "src"

[tool.poexy.sdist]
includes = [
    "docs",
    "examples"
]

[tool.poexy.wheel]
includes = [
    { path = "docs", destination = "share/docs" }
]
excludes = [
    "tests",
]

Note: With the configuration below:

[tool.poexy.wheel]
includes = [
    { path = "docs", destination = "share/docs" }
]

the docs directory will be installed at:
$prefix/share/my-package/docs
where $prefix is the installation prefix (such as /usr/local or your virtual environment), and my-package is the value of the name field in your [project] section.

Limitation: At this time, there is no way to include a directory so that it is placed directly alongside your package at the root of the wheel. All included files must be mapped to a subdirectory under $prefix/.

Note: Defaults exclusions

The following directories are automatically excluded from all packages and do not need to be specified in excludes:

  • __pycache__
  • build
  • dist
  • .eggs
  • .mypy_cache
  • .pytest_cache
  • .venv
  • venv

These directories are considered build artifacts, cache files, or development environments and are filtered out by default.

When building wheels, only files with the following extensions are included by default:

  • .py (Python source files)
  • .pyd (Python extension modules on Windows)
  • .so (Python extension modules on Linux/macOS)
  • .dll (Dynamic link libraries on Windows)
  • .dylib (Dynamic libraries on macOS)

๐Ÿ”ง Configuration Options

Package Configuration

[tool.poexy.package.my_package]
source = "src"  # Source directory

Note: Package name

Package name should be in form of a distribution name as defined here

Wheel Configuration

[tool.poexy.wheel]
format = ["source", "binary"]  # Available formats
includes = []  # Additional files to include
excludes = []  # Files to exclude

Binary Configuration

[tool.poexy.binary]
name = "my-app"  # Executable name
entry_point = "src.main:app"  # Entry point (optional, auto-detected if not specified)

SDist Configuration

[tool.poexy.sdist]
includes = []  # Additional files to include
excludes = []  # Files to exclude

๐Ÿ—๏ธ Building Packages

Using build directly

pip install build
python -m build

or

python -m build --wheel
python -m build --sdist

Using Poetry

poetry build

๐Ÿงช Testing

Test Structure

The test suite uses sample projects and comprehensive fixtures:

Sample Projects (tests/samples/)

Real project configurations used for testing different scenarios.

Test Fixtures (tests/conftests/)

Shared testing utilities:

  • project.py - Project setup and context management
  • assert_builds.py - Build assertion utilities
  • assert_manifests.py - Manifest validation
  • metadata.py - Metadata testing
  • paths.py - Path management
  • pip.py - Pip integration testing
  • logger.py - Logging utilities

Test Files

Each test file follows the same pattern:

  • Uses a sample project via sample_project() fixture
  • Tests both wheel and sdist builds
  • Validates installation and file contents if necessary

Note: See the test files for concrete examples

Pattern:

@pytest.fixture()
def project_path(sample_project):
    return sample_project("sample_name")

def test_wheel(project, project_path, assert_wheel_build, ...):
    with project(project_path):
        # Build wheel and validate contents
        assert_zip_file = assert_wheel_build(project_path)
        # Assert files in zip file and venv paths...

def test_sdist(project, project_path, assert_sdist_build, ...):
    with project(project_path):
        # Build sdist and validate contents
        assert_tar_file = assert_sdist_build(project_path)
        # Assert files in tar file and venv paths...

Running Tests

# Run all tests
poetry run pytest tests

# Run with coverage
poetry run pytest tests --cov=poexy_core

# Run tests in parallel
poetry run pytest tests --numprocesses=auto

๐Ÿ“ Project Structure

poexy-core/
โ”œโ”€โ”€ poexy_core/
โ”‚  โ”œโ”€โ”€ api.py                    # PEP 517/518 build backend interface
โ”‚  โ”œโ”€โ”€ builders/                 # Package builders (wheel, sdist, binary)
โ”‚  โ”‚  โ”œโ”€โ”€ builder.py             # Base builder implementation
โ”‚  โ”‚  โ”œโ”€โ”€ wheel.py               # Wheel package builder
โ”‚  โ”‚  โ”œโ”€โ”€ sdist.py               # Source distribution builder
โ”‚  โ”‚  โ”œโ”€โ”€ binary.py              # Binary executable builder
โ”‚  โ”‚  โ”œโ”€โ”€ types.py               # Builder type definitions
โ”‚  โ”‚  โ””โ”€โ”€ hooks/                 # Build hooks for file processing
โ”‚  โ”‚      โ”œโ”€โ”€ hook.py            # Base hook builder class
โ”‚  โ”‚      โ”œโ”€โ”€ readme.py          # README file processing hook
โ”‚  โ”‚      โ”œโ”€โ”€ license.py         # License file processing hook
โ”‚  โ”‚      โ”œโ”€โ”€ include_files.py   # File inclusion/exclusion hook
โ”‚  โ”‚      โ”œโ”€โ”€ package_files.py   # Package file processing hook
โ”‚  โ”‚      โ””โ”€โ”€ binary.py          # Binary-specific file processing hook
โ”‚  โ”œโ”€โ”€ packages/                 # Package format definitions and file management
โ”‚  โ”‚  โ”œโ”€โ”€ package.py             # Package format definitions
โ”‚  โ”‚  โ”œโ”€โ”€ files.py               # File management utilities
โ”‚  โ”‚  โ”œโ”€โ”€ inclusions.py          # File inclusion/exclusion logic
โ”‚  โ”‚  โ”œโ”€โ”€ validators.py          # Package validation
โ”‚  โ”‚  โ””โ”€โ”€ format.py              # Format type definitions
โ”‚  โ”œโ”€โ”€ pyproject/                # pyproject.toml parsing and validation
โ”‚  โ”‚  โ”œโ”€โ”€ toml.py                # TOML configuration parser
โ”‚  โ”‚  โ”œโ”€โ”€ types.py               # Configuration type definitions
โ”‚  โ”‚  โ”œโ”€โ”€ exceptions.py          # Configuration exceptions
โ”‚  โ”‚  โ””โ”€โ”€ tables/                # Pydantic table definitions
โ”‚  โ”œโ”€โ”€ pyinstaller/              # PyInstaller integration
โ”‚  โ”‚  โ””โ”€โ”€ builder.py             # PyInstaller builder implementation
โ”‚  โ”œโ”€โ”€ metadata/                 # Package metadata handling
โ”‚  โ”‚  โ”œโ”€โ”€ builder.py             # Metadata builder
โ”‚  โ”‚  โ””โ”€โ”€ fields.py              # Metadata field definitions
โ”‚  โ”œโ”€โ”€ manifest/                 # File manifest management
โ”‚  โ”‚  โ”œโ”€โ”€ manifest.py            # Manifest implementation
โ”‚  โ”‚  โ”œโ”€โ”€ parser.py              # Manifest parser
โ”‚  โ”‚  โ””โ”€โ”€ types.py               # Manifest type definitions
โ”‚  โ””โ”€โ”€ utils/                    # Utility functions
โ”‚     โ”œโ”€โ”€ python_impl.py         # Python implementation utilities
โ”‚     โ””โ”€โ”€ subprocess_rt.py       # Subprocess utilities
โ”œโ”€โ”€ tests/                       # Comprehensive test suite
โ”œโ”€โ”€ pyproject.toml               # Project configuration
โ””โ”€โ”€ README.md                    # This file

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Submit a pull request

๐Ÿ“„ License

This project is licensed under the MIT License

๐Ÿ™ Acknowledgments

  • Built on top of Poetry for Python packaging
  • Uses PyInstaller for binary executable creation
  • Leverages Pydantic for configuration validation
  • Enhanced with Rich for beautiful console output

๐Ÿ“ž Support

For questions, issues, or contributions, please open an issue on the project repository.

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

poexy_core-2025.7.2.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

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

poexy_core-2025.7.2-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file poexy_core-2025.7.2.tar.gz.

File metadata

  • Download URL: poexy_core-2025.7.2.tar.gz
  • Upload date:
  • Size: 38.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Linux/6.11.0-1018-azure

File hashes

Hashes for poexy_core-2025.7.2.tar.gz
Algorithm Hash digest
SHA256 90abbb23d49a443389266acd4e2e477c2c6b0ba0cadb4ed26b4d4b88cb48bc5a
MD5 a9d0481ccfd7f8530b23aef8ada1df13
BLAKE2b-256 aa7973291ad3b88cb5cf590b914f787d830c882649db074af5466f2fd27cbe79

See more details on using hashes here.

File details

Details for the file poexy_core-2025.7.2-py3-none-any.whl.

File metadata

  • Download URL: poexy_core-2025.7.2-py3-none-any.whl
  • Upload date:
  • Size: 41.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Linux/6.11.0-1018-azure

File hashes

Hashes for poexy_core-2025.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dd003ac16ad0323de581f4a2d1834f503f7171a019b328dca14c6cfdf2cd0c34
MD5 475e481ab0bc78bc322139640620fd0d
BLAKE2b-256 efc5abdd394a2b9412ed21b61d40f995d2b6e20c4e65cfc6e4dd39acca43f331

See more details on using hashes here.

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