Skip to content

Commit

Permalink
Merge pull request #4479 from pypa/bugfix/4475-all-the-files
Browse files Browse the repository at this point in the history
Install all the files
  • Loading branch information
jaraco authored Jul 18, 2024
2 parents aa41ab5 + cf298e7 commit 87afa4b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
1 change: 1 addition & 0 deletions newsfragments/4475.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Restored package data that went missing in 71.0. This change also incidentally causes tests to be installed once again.
8 changes: 1 addition & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,7 @@ PKG-INFO = "setuptools.command.egg_info:write_pkg_info"
"dependency_links.txt" = "setuptools.command.egg_info:overwrite_arg"

[tool.setuptools]
# disabled as it causes tests to be included #2505
# include_package_data = true
include-package-data = false
include-package-data = true

[tool.setuptools.packages.find]
include = [
Expand All @@ -194,10 +192,6 @@ exclude = [
]
namespaces = true

[tool.setuptools.package-data]
# ensure that `setuptools/_vendor/jaraco/text/Lorem ipsum.txt` is installed
"*" = ["*.txt"]

[tool.distutils.sdist]
formats = "zip"

Expand Down
6 changes: 0 additions & 6 deletions setuptools/tests/config/test_apply_pyprojecttoml.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from inspect import cleandoc
from pathlib import Path
from unittest.mock import Mock
from zipfile import ZipFile

import pytest
from ini2toml.api import LiteTranslator
Expand Down Expand Up @@ -422,11 +421,6 @@ def test_example_file_in_sdist(self, setuptools_sdist):
with tarfile.open(setuptools_sdist) as tar:
assert any(name.endswith(EXAMPLES_FILE) for name in tar.getnames())

def test_example_file_not_in_wheel(self, setuptools_wheel):
"""Meta test to ensure auxiliary test files are not in wheel"""
with ZipFile(setuptools_wheel) as zipfile:
assert not any(name.endswith(EXAMPLES_FILE) for name in zipfile.namelist())


class TestInteropCommandLineParsing:
def test_version(self, tmp_path, monkeypatch, capsys):
Expand Down
8 changes: 8 additions & 0 deletions setuptools/tests/test_setuptools.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,17 @@ def test_findall_missing_symlink(tmpdir, can_symlink):
assert found == []


@pytest.mark.xfail(reason="unable to exclude tests; #4475 #3260")
def test_its_own_wheel_does_not_contain_tests(setuptools_wheel):
with ZipFile(setuptools_wheel) as zipfile:
contents = [f.replace(os.sep, '/') for f in zipfile.namelist()]

for member in contents:
assert '/tests/' not in member


def test_wheel_includes_cli_scripts(setuptools_wheel):
with ZipFile(setuptools_wheel) as zipfile:
contents = [f.replace(os.sep, '/') for f in zipfile.namelist()]

assert any('cli-64.exe' in member for member in contents)

0 comments on commit 87afa4b

Please sign in to comment.