pypa / pypa/setuptools

Setuptools handles MANIFEST.in different on Windows and Linux

Open
#3,047 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Triage
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.

https://github.com/pypa/setuptools/blob/1a1397a4ef0327ba09ddd4a3d0916af48d3be7ec/setuptools/_distutils/util.py#L114-L130

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
  1. Use Windows
  2. Checkout the following commit: https://github.com/domdfcoding/shippinglabel/commit/34e5828bc968bce5eecb4198fb364cf3eacd0e13
  3. Build with pip or build
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.