Skip to content

build_meta does not include setup.py #1506

@gaborbernat

Description

@gaborbernat

When someone invokes the build operation via the build_meta (via https://github.com/pypa/setuptools/blob/master/setuptools/build_meta.py#L170 - https://www.python.org/dev/peps/pep-0517/#build-sdist) the setup.py is no longer automatically packaged.

In case of python setup.py sdist what ensured that this will happen is https://github.com/python/cpython/blob/master/Lib/distutils/command/sdist.py#L250. Here distribution.script_name is set to setup.py when called via python setup.py sdist. This is not set though when calling it directly via build_meta so packaging setup.py is safely ignored.

Note the files to package is determined while running egg_info, and this is re-used across runs (by reading SOURCES.txt). Therefore this bug is hidden when:

  • anyone beforehand calls python setup.py sdist,
  • when there's a distutils extension that automatically pulls in setup.py (such as setuptools-scm),
  • when some config value pulls in (one in MANIFEST.in, setup.cfg, setup.py).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions