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

Install all the files #4479

Merged
merged 6 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading