|
1 | 1 | from __future__ import annotations
|
2 | 2 |
|
3 |
| -import ast |
4 | 3 | import os
|
5 | 4 | import platform
|
6 | 5 | import re
|
@@ -540,30 +539,10 @@ def test_package_with_include(mocker: MockerFixture) -> None:
|
540 | 539 | assert "with-include-1.2.3/package_with_include/__init__.py" in names
|
541 | 540 | assert "with-include-1.2.3/tests/__init__.py" in names
|
542 | 541 | assert "with-include-1.2.3/pyproject.toml" in names
|
543 |
| - assert "with-include-1.2.3/setup.py" in names |
544 | 542 | assert "with-include-1.2.3/PKG-INFO" in names
|
545 | 543 | assert "with-include-1.2.3/for_wheel_only/__init__.py" not in names
|
546 | 544 | assert "with-include-1.2.3/src/src_package/__init__.py" in names
|
547 | 545 |
|
548 |
| - file = tar.extractfile("with-include-1.2.3/setup.py") |
549 |
| - assert file |
550 |
| - setup = file.read() |
551 |
| - setup_ast = ast.parse(setup) |
552 |
| - |
553 |
| - setup_ast.body = [n for n in setup_ast.body if isinstance(n, ast.Assign)] |
554 |
| - ns: dict[str, Any] = {} |
555 |
| - exec(compile(setup_ast, filename="setup.py", mode="exec"), ns) |
556 |
| - assert ns["package_dir"] == {"": "src"} |
557 |
| - assert ns["packages"] == [ |
558 |
| - "extra_dir", |
559 |
| - "extra_dir.sub_pkg", |
560 |
| - "package_with_include", |
561 |
| - "src_package", |
562 |
| - "tests", |
563 |
| - ] |
564 |
| - assert ns["package_data"] == {"": ["*"]} |
565 |
| - assert ns["modules"] == ["my_module"] |
566 |
| - |
567 | 546 | whl = module_path / "dist" / "with_include-1.2.3-py3-none-any.whl"
|
568 | 547 |
|
569 | 548 | assert whl.exists()
|
@@ -612,7 +591,6 @@ def test_respect_format_for_explicit_included_files() -> None:
|
612 | 591 | in names
|
613 | 592 | )
|
614 | 593 | assert "exclude-whl-include-sdist-0.1.0/pyproject.toml" in names
|
615 |
| - assert "exclude-whl-include-sdist-0.1.0/setup.py" in names |
616 | 594 | assert "exclude-whl-include-sdist-0.1.0/PKG-INFO" in names
|
617 | 595 |
|
618 | 596 | whl = module_path / "dist" / "exclude_whl_include_sdist-0.1.0-py3-none-any.whl"
|
|
0 commit comments