-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build_meta does not include setup.py #1506
Comments
setup.py
Here is a minimal script that confirms the bug. Here is a script to create an MWE repo: #!/usr/bin/bash
# Make the directory
mkdir mypkg
cd mypkg
mkdir mypkg
touch mypkg/__init__.py
# Make setup.py
cat << EOF > setup.py
from setuptools import setup
setup(name="mypkg", packages=["mypkg"], version="0.0.1")
EOF After running it, python -c 'from setuptools.build_meta import build_sdist; build_sdist(".")' This will build the sdist, and you can confirm that $ tar -tf mypkg-0.0.1.tar.gz
mypkg-0.0.1/
mypkg-0.0.1/PKG-INFO
mypkg-0.0.1/mypkg/
mypkg-0.0.1/mypkg/__init__.py
mypkg-0.0.1/mypkg.egg-info/
mypkg-0.0.1/mypkg.egg-info/PKG-INFO
mypkg-0.0.1/mypkg.egg-info/SOURCES.txt
mypkg-0.0.1/mypkg.egg-info/dependency_links.txt
mypkg-0.0.1/mypkg.egg-info/top_level.txt
mypkg-0.0.1/setup.cfg A PR with a failing test that basically repeats those steps and asserts that |
Working on this based on the PyPA sprint : https://github.com/orgs/pypa/projects/1 |
Fixes GH issue pypa#1506
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) thesetup.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. Heredistribution.script_name
is set tosetup.py
when called viapython setup.py sdist
. This is not set though when calling it directly viabuild_meta
so packagingsetup.py
is safely ignored.Note the files to package is determined while running
egg_info
, and this is re-used across runs (by readingSOURCES.txt
). Therefore this bug is hidden when:python setup.py sdist
,MANIFEST.in
,setup.cfg
,setup.py
).The text was updated successfully, but these errors were encountered: