[BUG] propagating `egg.info/SOURCES.txt` despite being excluded via `MANIFEST.in`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
setuptools version
setuptools==71.1.0
Python version
3.12.4
OS
macOS Sonoma 14.5
Additional environment information
build==1.2.1
Description
I have a MANIFEST.in that looks like this:
# Ignore .gitignore and requirements files
exclude [.r]*
# Ignore .github and tests directories
recursive-exclude [.t]* *
# Exclude all eggs
global-exclude *.egg-info/*
When I editably install, its SOURCES.txt looks like this, and it looks great:
LICENSE
MANIFEST.in
README.md
pyproject.toml
src/package/__init__.py
src/package/foo.py
src/package/py.typed
Next, when I run python -m build --sdist, I get the following output:
* Creating isolated environment: virtualenv+pip...
* Installing packages in isolated environment:
- setuptools>=64
- setuptools_scm>=8
* Getting build dependencies for sdist...
running egg_info
writing src/package.egg-info/PKG-INFO
writing dependency_links to src/package.egg-info/dependency_links.txt
writing requirements to src/package.egg-info/requires.txt
writing top-level names to src/package.egg-info/top_level.txt
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'src/package.egg-info/SOURCES.txt'
* Building sdist...
running sdist
running egg_info
writing src/package.egg-info/PKG-INFO
writing dependency_links to src/package.egg-info/dependency_links.txt
writing requirements to src/package.egg-info/requires.txt
writing top-level names to src/package.egg-info/top_level.txt
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'src/package.egg-info/SOURCES.txt'
running check
creating package-6.4.2.dev1+gabdd294.d20240723
creating package-6.4.2.dev1+gabdd294.d20240723/src
creating package-6.4.2.dev1+gabdd294.d20240723/src/package
creating package-6.4.2.dev1+gabdd294.d20240723/src/package.egg-info
copying files to package-6.4.2.dev1+gabdd294.d20240723...
copying LICENSE -> package-6.4.2.dev1+gabdd294.d20240723
copying MANIFEST.in -> package-6.4.2.dev1+gabdd294.d20240723
copying README.md -> package-6.4.2.dev1+gabdd294.d20240723
copying pyproject.toml -> package-6.4.2.dev1+gabdd294.d20240723
copying src/package/__init__.py -> package-6.4.2.dev1+gabdd294.d20240723/src/package
copying src/package/foo.py -> package-6.4.2.dev1+gabdd294.d20240723/src/package
copying src/package/py.typed -> package-6.4.2.dev1+gabdd294.d20240723/src/package
copying src/package/version.py -> package-6.4.2.dev1+gabdd294.d20240723/src/package
copying src/package.egg-info/SOURCES.txt -> package-6.4.2.dev1+gabdd294.d20240723/src/package.egg-info
Writing package-6.4.2.dev1+gabdd294.d20240723/setup.cfg
Creating tar archive
removing 'package-6.4.2.dev1+gabdd294.d20240723' (and everything under it)
Successfully built package-6.4.2.dev1+gabdd294.d20240723.tar.gz
Please note that it copies the .egg-info/SOURCES.txt. This is not supposed to happen, as I excluded it as part of the global-exclude in my MANIFEST.in.
What is interesting is all other .egg-info files were not copied, just SOURCES.txt was copied. This is why I think this is a bug
Expected behavior
I expect the .egg-info/SOURCES.txt to be excluded as that was specified in MANIFEST.in
How to Reproduce
See above
Output
See above
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported behavior with the shown MANIFEST.in and compare the editable-install SOURCES.txt with the result of python -m build --sdist. Start by tracing how setuptools handles egg-info/SOURCES.txt during egg_info and sdist; done means the generated source archive no longer includes that excluded file while preserving the other listed files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100