pdm-project / pdm-backend

The build backend used by PDM that supports latest packaging standards.
https://backend.pdm-project.org
MIT License
70 stars 39 forks source link

pdm_build.py added twice in sdist file. #250

Closed Bing-su closed 4 months ago

Bing-su commented 4 months ago

스크린샷 2024-07-15 135248

pip-binary-factory\pocketbase on  main is 📦 v0.22.17 via 🐹 v1.22.5 via 🐍 v3.12.3 (.venv) 
❯ pdm --version
PDM, version 2.16.1

pip-binary-factory\pocketbase on  main is 📦 v0.22.17 via 🐹 v1.22.5 via 🐍 v3.12.3 (.venv) 
❯ python -m build -s
* Creating virtualenv isolated environment...
* Installing packages in isolated environment... (pdm-backend, tomli; python_version < '3.11')
* Getting dependencies for sdist...
* Building sdist...
 - Adding LICENSE -> LICENSE
 - Adding README.md -> README.md
 - Adding build_wheel.py -> build_wheel.py
 - Adding download.nu -> download.nu
 - Adding fix.go -> fix.go
 - Adding go.mod -> go.mod
 - Adding go.sum -> go.sum
 - Adding main.go -> main.go
 - Adding pdm_build.py -> pdm_build.py
 - Adding pdm_build.py -> pdm_build.py
 - Adding .pdm-build\pyproject.toml -> pyproject.toml
 - Adding PKG-INFO -> PKG-INFO
Successfully built pocketbase_bin-0.22.17.tar.gz

I am distributing packages without python source files in a repository pip-binary-factory.

I discovered this while distributing the pocketbase-bin package: https://github.com/Bing-su/pip-binary-factory/tree/main/pocketbase

For now, I've fixed the issue by adding the file to the excludes, but you can reproduce the issue by fixing that part.

[tool.pdm.build]
is-purelib = false
source-includes = ["go.mod", "go.sum", "*.go", "download.nu"]
excludes = ["bin/*", ".gitignore", "pdm_build.py", "build_wheel.py"]

[tool.pdm.build]
is-purelib = false
source-includes = ["go.mod", "go.sum", "*.go", "download.nu"]
excludes = ["bin/*", ".gitignore"]

Refer to this source code and the produced files.

pocketbase.zip (source code for reproduce) pocketbase_bin-0.22.17.tar.gz (sdist file)

Thank you.