Skip to content

Conversation

@cdce8p
Copy link
Contributor

@cdce8p cdce8p commented Mar 2, 2022

  • Explicitly include CHANGELOG and README.rst in the sdist. (LICENSE is already included through license.file.) https://flit.readthedocs.io/en/latest/pyproject_toml.html#sdist-section
    This will not change that CHANGELOG and README.rst are not included in the wheel. (which is by design)
  • Explicitly exclude any test files. Those should not be part of the distribution. Anyone who needs them should clone the repo instead.
  • Use contents of README.rst for long description. Suggested here.
  • Remove MANIFEST.in as it wasn't used to begin with.

Fixes: python/typing_extensions#18

@JelleZijlstra JelleZijlstra self-assigned this Mar 2, 2022
@cdce8p
Copy link
Contributor Author

cdce8p commented Mar 2, 2022

FYI: Added a small note to the PR description regarding the wheel contents.

This will not change that CHANGELOG and README.rst are not included in the wheel. (which is by design)

LICENSE is separate and will be included in the wheel.

@JelleZijlstra
Copy link
Member

Thanks!

@hegjon would you mind confirming whether this meets your needs as a redistributor?

@hegjon
Copy link

hegjon commented Mar 2, 2022

Yes, it is only the LICENSE file we are required to include. Other documentation like README and CHANGELOG will be included if the project have it. I noticed that README were no longer included, so I assumed it was unintetional.

I feel it is up to upstream if they want to ship the unit tests in the sdist. As a package maintainer, it would be nice to run the tests as part of the build. An example of how Fedora was able to detect issues early by running the included unit tests: https://bugzilla.redhat.com/show_bug.cgi?id=2049642

@hegjon
Copy link

hegjon commented Mar 2, 2022

As a side note, the tests are not included in the 3.7.4.3 version of RPM that is redistributed by Fedora:

$ rpm -ql python3-typing-extensions
/usr/lib/python3.10/site-packages/__pycache__/typing_extensions.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/__pycache__/typing_extensions.cpython-310.pyc
/usr/lib/python3.10/site-packages/typing_extensions-3.7.4.3-py3.10.egg-info
/usr/lib/python3.10/site-packages/typing_extensions-3.7.4.3-py3.10.egg-info/PKG-INFO
/usr/lib/python3.10/site-packages/typing_extensions-3.7.4.3-py3.10.egg-info/SOURCES.txt
/usr/lib/python3.10/site-packages/typing_extensions-3.7.4.3-py3.10.egg-info/dependency_links.txt
/usr/lib/python3.10/site-packages/typing_extensions-3.7.4.3-py3.10.egg-info/requires.txt
/usr/lib/python3.10/site-packages/typing_extensions-3.7.4.3-py3.10.egg-info/top_level.txt
/usr/lib/python3.10/site-packages/typing_extensions.py
/usr/share/doc/python3-typing-extensions
/usr/share/doc/python3-typing-extensions/README.rst
/usr/share/licenses/python3-typing-extensions
/usr/share/licenses/python3-typing-extensions/LICENSE

@dlax
Copy link

dlax commented Mar 2, 2022

Debian also runs tests during package build. That's a fairly common practice and this usually relies on the test suite being available in sdist.

@cdce8p
Copy link
Contributor Author

cdce8p commented Mar 2, 2022

I feel it is up to upstream if they want to ship the unit tests in the sdist.

I had seen this tweet recently about how including "unnecessary" data inside distribution packages can add up quickly. That's why I usually choose to exclude them. For my personal projects, I even go as far as to only include license files in addition to the actual package.

@JelleZijlstra
Copy link
Member

I have no opinion on whether tests should be in the sdist; I'd like to just follow whatever recommendation the packaging folks come up with.

@cdce8p
Copy link
Contributor Author

cdce8p commented Mar 2, 2022

Thinking about it some more, I would guess most users will download the wheel not sdist. So all in all, it might not matter too much. Let's include include it, it's only one more file after all.

@JelleZijlstra JelleZijlstra merged commit 95c9c2b into python:master Mar 3, 2022
@cdce8p cdce8p deleted the improve-packaging branch March 3, 2022 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing CHANGELOG and README.rst is sdist

5 participants