Setuptools handles MANIFEST.in different on Windows and Linux
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
60.5.0
Python version
Python 3.6+
OS
Windows 10
Additional environment information
No response
Description
If an entry is specified in MANIFEST.in with the path ending in a forward slash (e.g. recursive-include shippinglabel/_vendor/ * setuptools fails to include the files on Windows. When running on Linux and macOS (where the path separator is /) setuptools includes the files without any warnings. However, on Windows (where the path separator isn't /), a warning is emitted from the convert_path function:
warning: manifest_maker: MANIFEST.in, line 4: path 'shippinglabel/_vendor/' cannot end with '/'
The code of the function (shown below) has a short circuit if the path separator is /, but on Windows proceeds to check if the path ends in a forward slash, raising a ValueError if it does. because of the error the files don't get added to the sdist.
If I remove the check setuptools includes the files in the wheel as I would expect.
I'm not sure what the purpose of the check is, but it's been there since the function was added in 0e7330777448758b059ab24d6db4b527c0269001
Expected behavior
Setuptools includes the same files on Windows as on Linux and macOS
How to Reproduce
- Use Windows
- Checkout the following commit: https://github.com/domdfcoding/shippinglabel/commit/34e5828bc968bce5eecb4198fb364cf3eacd0e13
- Build with
piporbuild
Output
On Windows
running sdist
running egg_info
creating shippinglabel.egg-info
writing manifest file 'shippinglabel.egg-info\SOURCES.txt'
no previously-included directories found matching '**\__pycache__'
warning: manifest_maker: MANIFEST.in, line 4: path 'shippinglabel/_vendor/' cannot end with '/'
no previously-included directories found matching '**\__pycache__'
writing manifest file 'shippinglabel.egg-info\SOURCES.txt'
running check
creating shippinglabel-1.0.1
creating shippinglabel-1.0.1\shippinglabel
creating shippinglabel-1.0.1\shippinglabel.egg-info
creating shippinglabel-1.0.1\shippinglabel\_vendor
creating shippinglabel-1.0.1\shippinglabel\_vendor\trove_classifiers
copying LICENSE -> shippinglabel-1.0.1
copying MANIFEST.in -> shippinglabel-1.0.1
copying README.rst -> shippinglabel-1.0.1
copying pyproject.toml -> shippinglabel-1.0.1
copying requirements.txt -> shippinglabel-1.0.1
copying setup.cfg -> shippinglabel-1.0.1
copying setup.py -> shippinglabel-1.0.1
copying shippinglabel\__init__.py -> shippinglabel-1.0.1\shippinglabel
copying shippinglabel\checksum.py -> shippinglabel-1.0.1\shippinglabel
copying shippinglabel\classifiers.py -> shippinglabel-1.0.1\shippinglabel
copying shippinglabel\conda.py -> shippinglabel-1.0.1\shippinglabel
copying shippinglabel\py.typed -> shippinglabel-1.0.1\shippinglabel
copying shippinglabel\pypi.py -> shippinglabel-1.0.1\shippinglabel
copying shippinglabel\requirements.py -> shippinglabel-1.0.1\shippinglabel
copying shippinglabel\sdist.py -> shippinglabel-1.0.1\shippinglabel
copying shippinglabel.egg-info\PKG-INFO -> shippinglabel-1.0.1\shippinglabel.egg-info
copying shippinglabel.egg-info\SOURCES.txt -> shippinglabel-1.0.1\shippinglabel.egg-info
copying shippinglabel.egg-info\dependency_links.txt -> shippinglabel-1.0.1\shippinglabel.egg-info
copying shippinglabel.egg-info\not-zip-safe -> shippinglabel-1.0.1\shippinglabel.egg-info
copying shippinglabel.egg-info\requires.txt -> shippinglabel-1.0.1\shippinglabel.egg-info
copying shippinglabel.egg-info\top_level.txt -> shippinglabel-1.0.1\shippinglabel.egg-info
copying shippinglabel\_vendor\__init__.py -> shippinglabel-1.0.1\shippinglabel\_vendor
copying shippinglabel\_vendor\trove_classifiers.pyi -> shippinglabel-1.0.1\shippinglabel\_vendor
copying shippinglabel\_vendor\trove_classifiers\__init__.py -> shippinglabel-1.0.1\shippinglabel\_vendor\trove_classifiers
copying shippinglabel\_vendor\trove_classifiers\__main__.py -> shippinglabel-1.0.1\shippinglabel\_vendor\trove_classifiers
Creating tar archive
removing 'shippinglabel-1.0.1' (and everything under it)
On Ubuntu
running sdist
running egg_info
creating shippinglabel.egg-info
writing manifest file 'shippinglabel.egg-info/SOURCES.txt'
no previously-included directories found matching '**/__pycache__'
writing manifest file 'shippinglabel.egg-info/SOURCES.txt'
running check
creating shippinglabel-1.0.1
creating shippinglabel-1.0.1/shippinglabel
creating shippinglabel-1.0.1/shippinglabel.egg-info
creating shippinglabel-1.0.1/shippinglabel/_vendor
creating shippinglabel-1.0.1/shippinglabel/_vendor/trove_classifiers
copying LICENSE -> shippinglabel-1.0.1
copying MANIFEST.in -> shippinglabel-1.0.1
copying README.rst -> shippinglabel-1.0.1
copying pyproject.toml -> shippinglabel-1.0.1
copying requirements.txt -> shippinglabel-1.0.1
copying setup.cfg -> shippinglabel-1.0.1
copying setup.py -> shippinglabel-1.0.1
copying shippinglabel/__init__.py -> shippinglabel-1.0.1/shippinglabel
copying shippinglabel/checksum.py -> shippinglabel-1.0.1/shippinglabel
copying shippinglabel/classifiers.py -> shippinglabel-1.0.1/shippinglabel
copying shippinglabel/conda.py -> shippinglabel-1.0.1/shippinglabel
copying shippinglabel/py.typed -> shippinglabel-1.0.1/shippinglabel
copying shippinglabel/pypi.py -> shippinglabel-1.0.1/shippinglabel
copying shippinglabel/requirements.py -> shippinglabel-1.0.1/shippinglabel
copying shippinglabel/sdist.py -> shippinglabel-1.0.1/shippinglabel
copying shippinglabel.egg-info/PKG-INFO -> shippinglabel-1.0.1/shippinglabel.egg-info
copying shippinglabel.egg-info/SOURCES.txt -> shippinglabel-1.0.1/shippinglabel.egg-info
copying shippinglabel.egg-info/dependency_links.txt -> shippinglabel-1.0.1/shippinglabel.egg-info
copying shippinglabel.egg-info/not-zip-safe -> shippinglabel-1.0.1/shippinglabel.egg-info
copying shippinglabel.egg-info/requires.txt -> shippinglabel-1.0.1/shippinglabel.egg-info
copying shippinglabel.egg-info/top_level.txt -> shippinglabel-1.0.1/shippinglabel.egg-info
copying shippinglabel/_vendor/__init__.py -> shippinglabel-1.0.1/shippinglabel/_vendor
copying shippinglabel/_vendor/requirements.txt -> shippinglabel-1.0.1/shippinglabel/_vendor
copying shippinglabel/_vendor/trove_classifiers.pyi -> shippinglabel-1.0.1/shippinglabel/_vendor
copying shippinglabel/_vendor/trove_classifiers/LICENSE -> shippinglabel-1.0.1/shippinglabel/_vendor/trove_classifiers
copying shippinglabel/_vendor/trove_classifiers/__init__.py -> shippinglabel-1.0.1/shippinglabel/_vendor/trove_classifiers
copying shippinglabel/_vendor/trove_classifiers/__main__.py -> shippinglabel-1.0.1/shippinglabel/_vendor/trove_classifiers
Creating tar archive
removing 'shippinglabel-1.0.1' (and everything under it)
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
Start with setuptools/_distutils/util.py at the convert_path function referenced in the issue, then reproduce the MANIFEST.in case on Windows and Linux or macOS. Done means a trailing forward slash in the recursive-include path produces the same included files across platforms without the reported warning.
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
- Clearly specified
- Newbie friendliness
- 45/100