Skip to content
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

[BUG] autodiscovery for single-module layout causes build_wheel(".") to produce an empty wheel #3692

Closed
mgorny opened this issue Nov 18, 2022 · 3 comments · Fixed by #3704
Closed
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.

Comments

@mgorny
Copy link
Contributor

mgorny commented Nov 18, 2022

setuptools version

65.5.1

Python version

3.11.0

OS

Gentoo Linux

Additional environment information

No response

Description

When the package is using a flat distribution layout for a single Python module with autodiscovery, the build-backend produces an empty wheel if wheel_dir is .. It seems to work correctly if a subdirectory is used as wheel_dir.

I've noticed this with bitstring package.

Expected behavior

Correct package or an explicit error.

How to Reproduce

cat > pyproject.toml <<EOF
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"

[project]
name = "test"
version = "1"
EOF

> foo.py
python -c 'import setuptools.build_meta; setuptools.build_meta.build_wheel(".")'

Output

running bdist_wheel
running build
running build_py
running egg_info
creating test.egg-info
writing test.egg-info/PKG-INFO
writing dependency_links to test.egg-info/dependency_links.txt
writing top-level names to test.egg-info/top_level.txt
writing manifest file 'test.egg-info/SOURCES.txt'
listing git files failed - pretending there aren't any
reading manifest file 'test.egg-info/SOURCES.txt'
writing manifest file 'test.egg-info/SOURCES.txt'
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
warning: install_lib: 'build/lib' does not exist -- no Python modules to install

running install_egg_info
Copying test.egg-info to build/bdist.linux-x86_64/wheel/test-1-py3.11.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/test-1.dist-info/WHEEL
creating '/tmp/test/tmpygf6hdpg/test-1-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'test-1.dist-info/METADATA'
adding 'test-1.dist-info/WHEEL'
adding 'test-1.dist-info/top_level.txt'
adding 'test-1.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel

$ unzip -l test-1-py3-none-any.whl 
Archive:  test-1-py3-none-any.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
       45  11-18-2022 17:32   test-1.dist-info/METADATA
       92  11-18-2022 17:32   test-1.dist-info/WHEEL
       12  11-18-2022 17:32   test-1.dist-info/top_level.txt
      268  11-18-2022 17:32   test-1.dist-info/RECORD
---------                     -------
      417                     4 files
@mgorny
Copy link
Contributor Author

mgorny commented Nov 23, 2022

Thanks!

@abravalheri
Copy link
Contributor

Thank you very much for reporting @mgorny.

@mgorny
Copy link
Contributor Author

mgorny commented Nov 23, 2022

I've confirmed that it builds the wheel for bitstring correctly now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants