Skip to content

Avoid including stray packages in wheel#20

Merged
ynikitenko merged 1 commit intoynikitenko:masterfrom
cjwatson:tighten-packages
Jan 13, 2026
Merged

Avoid including stray packages in wheel#20
ynikitenko merged 1 commit intoynikitenko:masterfrom
cjwatson:tighten-packages

Conversation

@cjwatson
Copy link
Contributor

@cjwatson cjwatson commented Jan 6, 2026

In some environments, using exclude can result in stray packages ending up in the wheel; for example in a Debian package build that built for each of Python 3.13 and 3.14 in succession, I found that the 3.14 build ended up containing a duplicate build directory. Using include is safer.

In some environments, using `exclude` can result in stray packages
ending up in the wheel; for example in a Debian package build that built
for each of Python 3.13 and 3.14 in succession, I found that the 3.14
build ended up containing a duplicate `build` directory.  Using
`include` is safer.
@ynikitenko ynikitenko merged commit 078cb05 into ynikitenko:master Jan 13, 2026
@ynikitenko
Copy link
Owner

Hi Colin, thanks for your contribution. I think you are right, explicit include should be safer. I understand that the bug was that "build" was not in excludes (probably it was undefined and worked previously).
Merged.

@ynikitenko
Copy link
Owner

Are you sure it makes what it says?

[tool.setuptools.packages.find]
include = ["yarsync", "yarsync.*"]

Because after that patch I still got a package with a dist subdirectory. And now I still have tests in my new .tar.gz archive (that is not written in include).

@cjwatson
Copy link
Contributor Author

Because after that patch I still got a package with a dist subdirectory.

Odd, that doesn't happen for me. What are you running to build the wheel? (I'm using pyproject-build (a.k.a. python3 -m build.)

And now I still have tests in my new .tar.gz archive (that is not written in include).

The .tar.gz is the sdist, whose contents are controlled separately. See https://setuptools.pypa.io/en/latest/userguide/miscellaneous.html. My patch was just about the wheel - see https://setuptools.pypa.io/en/latest/userguide/package_discovery.html.

@cjwatson cjwatson deleted the tighten-packages branch January 13, 2026 22:20
@ynikitenko
Copy link
Owner

ynikitenko commented Jan 13, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants