Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Can't exclude some of test code when build sdist #3817

Closed
yukihiko-shinoda opened this issue Feb 11, 2023 · 1 comment
Closed

[BUG] Can't exclude some of test code when build sdist #3817

yukihiko-shinoda opened this issue Feb 11, 2023 · 1 comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.

Comments

@yukihiko-shinoda
Copy link
Contributor

yukihiko-shinoda commented Feb 11, 2023

setuptools version

setuptools==67.2.0

Python version

3.10.6

OS

Debian GNU/Linux 11 (bullseye)

Additional environment information

Package         Version
--------------- -------
build           0.10.0
packaging       23.0
pip             23.0
pyproject_hooks 1.0.0
setuptools      67.2.0
tomli           2.0.1
wheel           0.38.4

Description

When build sdist, some of test codes are included.

Expected behavior

Exclude tests directory from sdist. (original behavior)

How to Reproduce

1.
Clone this project:
yukihiko-shinoda/pyvelocity: Automates task to check configurations about Python project to follow best practices to increase development velocity.

2.
Install dependencies:

pip install setuptools==67.2.0 build==0.10.0 pyproject_hooks==1.0.0 tomli=2.0.1

3.
Build:

python -m build

4.
Check sdist:

tar tf dist/*.tar.gz

Output

Click me
pyvelocity-0.1.2/
pyvelocity-0.1.2/LICENSE
pyvelocity-0.1.2/PKG-INFO
pyvelocity-0.1.2/README.md
pyvelocity-0.1.2/pyproject.toml
pyvelocity-0.1.2/pyvelocity/
pyvelocity-0.1.2/pyvelocity/__init__.py
pyvelocity-0.1.2/pyvelocity/checks/
pyvelocity-0.1.2/pyvelocity/checks/__init__.py
pyvelocity-0.1.2/pyvelocity/checks/aggregation.py
pyvelocity-0.1.2/pyvelocity/checks/line_length.py
pyvelocity-0.1.2/pyvelocity/checks/using_py_project_toml.py
pyvelocity-0.1.2/pyvelocity/cli.py
pyvelocity-0.1.2/pyvelocity/configurations/
pyvelocity-0.1.2/pyvelocity/configurations/__init__.py
pyvelocity-0.1.2/pyvelocity/configurations/aggregation.py
pyvelocity-0.1.2/pyvelocity/configurations/files/
pyvelocity-0.1.2/pyvelocity/configurations/files/__init__.py
pyvelocity-0.1.2/pyvelocity/configurations/files/aggregation.py
pyvelocity-0.1.2/pyvelocity/configurations/files/py_project_toml.py
pyvelocity-0.1.2/pyvelocity/configurations/files/sections/
pyvelocity-0.1.2/pyvelocity/configurations/files/sections/__init__.py
pyvelocity-0.1.2/pyvelocity/configurations/files/sections/black.py
pyvelocity-0.1.2/pyvelocity/configurations/files/sections/docformatter.py
pyvelocity-0.1.2/pyvelocity/configurations/files/sections/factory.py
pyvelocity-0.1.2/pyvelocity/configurations/files/sections/flake8.py
pyvelocity-0.1.2/pyvelocity/configurations/files/sections/isort.py
pyvelocity-0.1.2/pyvelocity/configurations/files/sections/pylint/
pyvelocity-0.1.2/pyvelocity/configurations/files/sections/pylint/__init__.py
pyvelocity-0.1.2/pyvelocity/configurations/files/sections/pyvelocity.py
pyvelocity-0.1.2/pyvelocity/configurations/files/setup_cfg.py
pyvelocity-0.1.2/pyvelocity/configurations/tools/
pyvelocity-0.1.2/pyvelocity/configurations/tools/__init__.py
pyvelocity-0.1.2/pyvelocity/configurations/tools/black.py
pyvelocity-0.1.2/pyvelocity/configurations/tools/docformatter.py
pyvelocity-0.1.2/pyvelocity/configurations/tools/flake8.py
pyvelocity-0.1.2/pyvelocity/configurations/tools/isort.py
pyvelocity-0.1.2/pyvelocity/configurations/tools/pylint.py
pyvelocity-0.1.2/pyvelocity/configurations/tools/pyvelocity.py
pyvelocity-0.1.2/pyvelocity/py.typed
pyvelocity-0.1.2/pyvelocity/pyvelocity.py
pyvelocity-0.1.2/pyvelocity.egg-info/
pyvelocity-0.1.2/pyvelocity.egg-info/PKG-INFO
pyvelocity-0.1.2/pyvelocity.egg-info/SOURCES.txt
pyvelocity-0.1.2/pyvelocity.egg-info/dependency_links.txt
pyvelocity-0.1.2/pyvelocity.egg-info/entry_points.txt
pyvelocity-0.1.2/pyvelocity.egg-info/not-zip-safe
pyvelocity-0.1.2/pyvelocity.egg-info/requires.txt
pyvelocity-0.1.2/pyvelocity.egg-info/top_level.txt
pyvelocity-0.1.2/setup.cfg
pyvelocity-0.1.2/setup.py
pyvelocity-0.1.2/tests/
pyvelocity-0.1.2/tests/test_cli.py

This seams to depends exported SOURCES.txt:

Click me
LICENSE
README.md
pyproject.toml
setup.cfg
setup.py
pyvelocity/__init__.py
pyvelocity/cli.py
pyvelocity/py.typed
pyvelocity/pyvelocity.py
pyvelocity.egg-info/PKG-INFO
pyvelocity.egg-info/SOURCES.txt
pyvelocity.egg-info/dependency_links.txt
pyvelocity.egg-info/entry_points.txt
pyvelocity.egg-info/not-zip-safe
pyvelocity.egg-info/requires.txt
pyvelocity.egg-info/top_level.txt
pyvelocity/checks/__init__.py
pyvelocity/checks/aggregation.py
pyvelocity/checks/line_length.py
pyvelocity/checks/using_py_project_toml.py
pyvelocity/configurations/__init__.py
pyvelocity/configurations/aggregation.py
pyvelocity/configurations/files/__init__.py
pyvelocity/configurations/files/aggregation.py
pyvelocity/configurations/files/py_project_toml.py
pyvelocity/configurations/files/setup_cfg.py
pyvelocity/configurations/files/sections/__init__.py
pyvelocity/configurations/files/sections/black.py
pyvelocity/configurations/files/sections/docformatter.py
pyvelocity/configurations/files/sections/factory.py
pyvelocity/configurations/files/sections/flake8.py
pyvelocity/configurations/files/sections/isort.py
pyvelocity/configurations/files/sections/pyvelocity.py
pyvelocity/configurations/files/sections/pylint/__init__.py
pyvelocity/configurations/tools/__init__.py
pyvelocity/configurations/tools/black.py
pyvelocity/configurations/tools/docformatter.py
pyvelocity/configurations/tools/flake8.py
pyvelocity/configurations/tools/isort.py
pyvelocity/configurations/tools/pylint.py
pyvelocity/configurations/tools/pyvelocity.py
tests/test_cli.py

However, the cache of SOURCES.txt when built in 2022-09-29 is:

Click me
LICENSE
README.md
pyproject.toml
setup.cfg
setup.py
pyvelocity/__init__.py
pyvelocity/cli.py
pyvelocity/py.typed
pyvelocity/pyvelocity.py
pyvelocity.egg-info/PKG-INFO
pyvelocity.egg-info/SOURCES.txt
pyvelocity.egg-info/dependency_links.txt
pyvelocity.egg-info/entry_points.txt
pyvelocity.egg-info/not-zip-safe
pyvelocity.egg-info/requires.txt
pyvelocity.egg-info/top_level.txt
pyvelocity/checks/__init__.py
pyvelocity/checks/aggregation.py
pyvelocity/checks/line_length.py
pyvelocity/checks/using_py_project_toml.py
pyvelocity/configurations/__init__.py
pyvelocity/configurations/aggregation.py
pyvelocity/configurations/files/__init__.py
pyvelocity/configurations/files/aggregation.py
pyvelocity/configurations/files/py_project_toml.py
pyvelocity/configurations/files/setup_cfg.py
pyvelocity/configurations/files/sections/__init__.py
pyvelocity/configurations/files/sections/black.py
pyvelocity/configurations/files/sections/docformatter.py
pyvelocity/configurations/files/sections/factory.py
pyvelocity/configurations/files/sections/flake8.py
pyvelocity/configurations/files/sections/isort.py
pyvelocity/configurations/files/sections/pyvelocity.py
pyvelocity/configurations/files/sections/pylint/__init__.py
pyvelocity/configurations/tools/__init__.py
pyvelocity/configurations/tools/black.py
pyvelocity/configurations/tools/docformatter.py
pyvelocity/configurations/tools/flake8.py
pyvelocity/configurations/tools/isort.py
pyvelocity/configurations/tools/pylint.py
pyvelocity/configurations/tools/pyvelocity.py
@yukihiko-shinoda yukihiko-shinoda added bug Needs Triage Issues that need to be evaluated for severity and status. labels Feb 11, 2023
@yukihiko-shinoda
Copy link
Contributor Author

This is not range of setuptools but distutils.
see: pypa/distutils#187

The current specification seams to be that:

  • [tool.setuptools.packages.find] block in pyproject.toml effects only for bdist
  • The sdist includes some of test files however it's not completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

No branches or pull requests

1 participant