Different behavior between pyproject-build and pyproject-build -w
pawamoy opened this issue · 1 comments
pawamoy commented
I'm using pdm-backend to build my project. I noticed that when I run pyproject-build
, the data files are not added to the wheel. But if I run pyproject-build -w
or pyproject-build -w -s
, then the data files are correctly added to the wheel 🤔
pyproject.toml
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[project]
name = "pawamoy-testing"
description = "Testing this great template"
authors = [{name = "Timothee Mazzucotelli", email = "dev@pawamoy.fr"}]
license = {text = "ISC"}
readme = "README.md"
requires-python = ">=3.8"
dynamic = ["version"]
[project.scripts]
pawamoy-testing = "pawamoy_testing.cli:main"
[tool.pdm]
version = {source = "scm"}
[tool.pdm.build]
package-dir = "src"
editable-backend = "editables"
[tool.pdm.build.wheel-data]
data = [
{path = "share/**/*", relative-to = "."},
]
Reproduction:
git clone https://github.com/pawamoy/repro-pyproject-build
cd repro-pyproject-build
% pyproject-build
* Creating venv isolated environment...
* Installing packages in isolated environment... (pdm-backend)
* Getting build dependencies for sdist...
* Building sdist...
- Adding LICENSE -> LICENSE
- Adding README.md -> README.md
- Adding .pdm-build/pyproject.toml -> pyproject.toml
- Adding src/pawamoy_testing/__init__.py -> src/pawamoy_testing/__init__.py
- Adding src/pawamoy_testing/__main__.py -> src/pawamoy_testing/__main__.py
- Adding src/pawamoy_testing/cli.py -> src/pawamoy_testing/cli.py
- Adding src/pawamoy_testing/py.typed -> src/pawamoy_testing/py.typed
- Adding PKG-INFO -> PKG-INFO
* Building wheel from sdist
* Creating venv isolated environment...
* Installing packages in isolated environment... (pdm-backend)
* Getting build dependencies for wheel...
* Building wheel...
- Adding .pdm-build/pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/METADATA -> pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/METADATA
- Adding .pdm-build/pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/WHEEL -> pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/WHEEL
- Adding .pdm-build/pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/entry_points.txt -> pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/entry_points.txt
- Adding .pdm-build/pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/licenses/LICENSE -> pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/licenses/LICENSE
- Adding src/pawamoy_testing/__init__.py -> pawamoy_testing/__init__.py
- Adding src/pawamoy_testing/__main__.py -> pawamoy_testing/__main__.py
- Adding src/pawamoy_testing/cli.py -> pawamoy_testing/cli.py
- Adding src/pawamoy_testing/py.typed -> pawamoy_testing/py.typed
- Adding pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/RECORD -> pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/RECORD
Successfully built pawamoy_testing-0.1.1.dev1+g7770c66.tar.gz and pawamoy_testing-0.1.1.dev1+g7770c66-py3-none-any.whl
(no data files included in wheel)
% pyproject-build -w
* Creating venv isolated environment...
* Installing packages in isolated environment... (pdm-backend)
* Getting build dependencies for wheel...
* Building wheel...
- Adding share/man/man1/pawamoy-testing.1 -> pawamoy_testing-0.1.1.dev1+g7770c66.data/data/share/man/man1/pawamoy-testing.1
- Adding share/man/man3/pawamoy_testing.3 -> pawamoy_testing-0.1.1.dev1+g7770c66.data/data/share/man/man3/pawamoy_testing.3
- Adding .pdm-build/pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/METADATA -> pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/METADATA
- Adding .pdm-build/pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/WHEEL -> pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/WHEEL
- Adding .pdm-build/pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/entry_points.txt -> pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/entry_points.txt
- Adding .pdm-build/pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/licenses/LICENSE -> pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/licenses/LICENSE
- Adding src/pawamoy_testing/__init__.py -> pawamoy_testing/__init__.py
- Adding src/pawamoy_testing/__main__.py -> pawamoy_testing/__main__.py
- Adding src/pawamoy_testing/cli.py -> pawamoy_testing/cli.py
- Adding src/pawamoy_testing/py.typed -> pawamoy_testing/py.typed
- Adding pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/RECORD -> pawamoy_testing-0.1.1.dev1+g7770c66.dist-info/RECORD
Successfully built pawamoy_testing-0.1.1.dev1+g7770c66-py3-none-any.whl
(data files correctly included: share/...)
pawamoy commented
Ah, sorry, the answer in the CLI help:
By default, a source distribution (sdist) is built from {srcdir} and a binary distribution (wheel) is built from the sdist.
Since the data files are not added to the sdist, they're not added to the wheel either.
Feel free to close!