Skip to main content

Poetry plugin that adds support for building non platform wheels by ignoring build scripts.

Project description

poetry-plugin-ignore-build-script

Description

poetry-plugin-ignore-build-script is a plugin for poetry, the Python packaging and dependency manager. It enables creating either plaform specific or pure python wheels.

Installation

Follow poetry's plugin installation instructions, replacing poetry-plugin with poetry-plugin-ignore-build-script.

Usage

If you set up a build script in your pyproject.toml files as follows:

...

[tool.poetry.build]
script = "build.py"
generate-setup-file = true

...

and corrresponding build script which uses mypycify or cythonize:

from mypyc.build import mypycify

modules = [
    "my_package/submod1/foo.py",
    ...
    "my_package/submodn/bar.py",
]
extensions = mypycify(modules)

# from Cython.Build import cythonize
#extensions = cythonize("my_package/*.pyx", include_path=[...])

def build(setup_kwargs):
    setup_kwargs.update(
        {
            "ext_modules": extensions,
        }
    )

To build a non platform specific wheel (e.g. "my-package-0.1.1-py3-none-any.whl") then use the following command:

poetry build --ignore-build-script

To build a platform specific wheel (e.g. "my-package-0.1.1-cp310-cp310-manylinux_2_35_x86_64.whl") then use the standard poetry command:

poetry build

Notes

This plugin is a way to workaround poetry limitation #8039.

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

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page