Skip to content

Publish pure Python wheel to PyPI or pin a build backend version #173

@edgarrmondragon

Description

@edgarrmondragon

With the recent ecosystem-side breakage (now reverted) caused by setuptools, which affected this package (see #171), I found that there are no wheels published to PyPI1:

Image

This is a problem, because it means dependents need to install the package from a source distribution (i.e. a .tar.gz file), which invokes the build backend. Since this projects uses setup.py, that build backend is detected by installers like pip to be the latest setuptools, which led to the above mentioned issues for this package and others.

I offer two, not mutually exclusive, improvements.

Publishing wheels2

Publishing wheels means that installers will use that and no calls to setuptools will need to be made.

Building wheels is really easy:

  • Invoking setup.py (which is now deprecated3):

    python setup.py sdist bdist_wheel
  • Using pypa/build in the project root

    python -m build

Use static metadata and pin setuptools

Another option is to use a pyproject.toml4 with a build-system table to pin a version of setuptools known to work with the project's configuration:

[build-system]
requires = ["setuptools==77.0.0"]
build-backend = "setuptools.build_meta"

Cheers!

Footnotes

  1. https://pypi.org/project/singer-python/#files

  2. https://pythonwheels.com/

  3. https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html

  4. https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#configuring-setuptools-using-pyproject-toml-files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions