Unified Python packaging backend for wheels, sdist, and executables
Project description
Poexy-Core
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.tomlsyntax 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
onefileandonedirmodes - Automatic entry point detection
- Configurable build options
Note: About PyInstaller
onedirmode 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
docsdirectory will be installed at:
$prefix/share/my-package/docs
where$prefixis the installation prefix (such as/usr/localor your virtual environment), andmy-packageis the value of thenamefield 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__builddist.eggs.mypy_cache.pytest_cache.venvvenvThese 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 managementassert_builds.py- Build assertion utilitiesassert_manifests.py- Manifest validationmetadata.py- Metadata testingpaths.py- Path managementpip.py- Pip integration testinglogger.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
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90abbb23d49a443389266acd4e2e477c2c6b0ba0cadb4ed26b4d4b88cb48bc5a
|
|
| MD5 |
a9d0481ccfd7f8530b23aef8ada1df13
|
|
| BLAKE2b-256 |
aa7973291ad3b88cb5cf590b914f787d830c882649db074af5466f2fd27cbe79
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd003ac16ad0323de581f4a2d1834f503f7171a019b328dca14c6cfdf2cd0c34
|
|
| MD5 |
475e481ab0bc78bc322139640620fd0d
|
|
| BLAKE2b-256 |
efc5abdd394a2b9412ed21b61d40f995d2b6e20c4e65cfc6e4dd39acca43f331
|