pypa / pypa/setuptools

[BUG] licence file included despite explicitly excluded via MANIFEST.in

Open
#3,977 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted Needs Design Proposal
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

setuptools version

68.0.0

Python version

3.11.4

OS

Debian sid

Additional environment information

Also using python3-setuptools-scm 7.1.0

Description

I have a project using pyproject.toml which includes a file LICENCE and a symlink COPYING to that.

It seems that setuptools cannot include symlinks (🙁) but instead resolves the, so the very same file is included twice, making the sdist and wheel needlessly bigger.

One way of solving this, would be supporting symlinks ;-) ... or perhaps not including the file if it's a symlink to an already included file (an perhaps restricting this to the recognised licences files?).

Anyway, my issue here is, that I've set up a MANIFEST.in with:

exclude COPYING

yet it still includes the file, which I think it shouldn't do, or should it?

Only if I set:

[tool.setuptools]
license-files = ['LICEN[CS]E*', 'NOTICE*', 'AUTHORS*']

in pyproject.toml it really excludes the file (or probably rather not even includes it in the first place, regardless of my MANIFEST.in.

Expected behavior

Files explicitly excluded, should be excluded. :-)

How to Reproduce
  1. Create a simple empty project with LICENCE and COPYING as a symlink to it, as well a a default pyproject.toml
  2. Also MANIFEST.in as described above
  3. Create a sdist
  4. It will have the COPYING despite the exclusion.
Output

not applicable

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

Reproduce the issue with a project containing LICENCE, a COPYING symlink, pyproject.toml, and MANIFEST.in containing exclude COPYING; then inspect the generated sdist. Compare this with the configuration using license-files in pyproject.toml. Done means an explicit MANIFEST.in exclusion prevents COPYING from appearing in the sdist.

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
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.