Skip to content

[bug/feature request] SDist missing files not removed by .gitignore #3797

@henryiii

Description

@henryiii
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.

This is closely related to #2015, though this is about the SDist contents, not the wheel / final package contents.

Issue

The webpage seems to indicate that the only items excluded from the .gitignore will be excluded from the SDist. However, that's not the case. The entire /tests folder is missing from the SDist! This means that I can't run tests downstream in conda-forge recipes, or in Distro packaging. I would like and expect the git repository to be the default for the SDist contents, minus any exclusions. In Setuptools, you would add this to a MANIFEST.in, but leave it off of your package list / package find. Someone tried to drop the tests folder from the iMinuit SDist, and I (for conda-forge) and the OpenSUSE maintainers had a fit.

This is not referring to the final package / wheel, which should never contain a raw /tests folder. Final users don't need to waste space on tests, and only one package can install a "tests" package before you get a conflict.

Example:

pipx run build --sdist
tar --list --verbose --file  dist/uhi-0.2.0.tar.gz

-rw-r--r--  0 0      0        1525 Jan 19 16:46 uhi-0.2.0/LICENSE
-rw-r--r--  0 0      0        3525 Mar 16 21:55 uhi-0.2.0/README.md
-rw-r--r--  0 0      0        1740 Mar 16 19:00 uhi-0.2.0/pyproject.toml
-rw-r--r--  0 0      0          22 Mar 16 19:04 uhi-0.2.0/src/uhi/__init__.py
-rw-r--r--  0 0      0        6648 Mar 16 18:59 uhi-0.2.0/src/uhi/numpy_plottable.py
-rw-r--r--  0 0      0           0 Jan 19 17:08 uhi-0.2.0/src/uhi/py.typed
-rw-r--r--  0 0      0           0 Nov  3 12:24 uhi-0.2.0/src/uhi/typing/__init__.py
-rw-r--r--  0 0      0        5689 Mar 16 21:54 uhi-0.2.0/src/uhi/typing/plottable.py
-rw-r--r--  0 0      0        4734 Mar 17 14:51 uhi-0.2.0/setup.py
-rw-r--r--  0 0      0        5074 Mar 17 14:51 uhi-0.2.0/PKG-INFO

git ls-files
.github/CONTRIBUTING.md
.github/dependabot.yml
.github/workflows/ci.yml
.gitignore
.pre-commit-config.yaml
.readthedocs.yml
LICENSE
README.md
docs/Makefile
docs/conf.py
docs/index.rst
docs/indexing+.rst
docs/indexing.rst
docs/make.bat
docs/plotting.rst
poetry.lock
pyproject.toml
setup.cfg
src/uhi/__init__.py
src/uhi/numpy_plottable.py
src/uhi/py.typed
src/uhi/typing/__init__.py
src/uhi/typing/plottable.py
tests/__init__.py
tests/test_ensure.py
tests/test_uhi.py

If I add include = ["tests/*"], then the tests folder is also in the final wheel, which is unusable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/docsDocumentation issues/improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions