|
1 | 1 | from __future__ import annotations
|
2 | 2 |
|
3 |
| -import ast |
4 | 3 | import os
|
5 | 4 | import platform
|
6 | 5 | import re
|
@@ -536,28 +535,10 @@ def test_package_with_include(mocker: MockerFixture):
|
536 | 535 | assert "with-include-1.2.3/package_with_include/__init__.py" in names
|
537 | 536 | assert "with-include-1.2.3/tests/__init__.py" in names
|
538 | 537 | assert "with-include-1.2.3/pyproject.toml" in names
|
539 |
| - assert "with-include-1.2.3/setup.py" in names |
540 | 538 | assert "with-include-1.2.3/PKG-INFO" in names
|
541 | 539 | assert "with-include-1.2.3/for_wheel_only/__init__.py" not in names
|
542 | 540 | assert "with-include-1.2.3/src/src_package/__init__.py" in names
|
543 | 541 |
|
544 |
| - setup = tar.extractfile("with-include-1.2.3/setup.py").read() |
545 |
| - setup_ast = ast.parse(setup) |
546 |
| - |
547 |
| - setup_ast.body = [n for n in setup_ast.body if isinstance(n, ast.Assign)] |
548 |
| - ns = {} |
549 |
| - exec(compile(setup_ast, filename="setup.py", mode="exec"), ns) |
550 |
| - assert ns["package_dir"] == {"": "src"} |
551 |
| - assert ns["packages"] == [ |
552 |
| - "extra_dir", |
553 |
| - "extra_dir.sub_pkg", |
554 |
| - "package_with_include", |
555 |
| - "src_package", |
556 |
| - "tests", |
557 |
| - ] |
558 |
| - assert ns["package_data"] == {"": ["*"]} |
559 |
| - assert ns["modules"] == ["my_module"] |
560 |
| - |
561 | 542 | whl = module_path / "dist" / "with_include-1.2.3-py3-none-any.whl"
|
562 | 543 |
|
563 | 544 | assert whl.exists()
|
@@ -606,7 +587,6 @@ def test_respect_format_for_explicit_included_files():
|
606 | 587 | in names
|
607 | 588 | )
|
608 | 589 | assert "exclude-whl-include-sdist-0.1.0/pyproject.toml" in names
|
609 |
| - assert "exclude-whl-include-sdist-0.1.0/setup.py" in names |
610 | 590 | assert "exclude-whl-include-sdist-0.1.0/PKG-INFO" in names
|
611 | 591 |
|
612 | 592 | whl = module_path / "dist" / "exclude_whl_include_sdist-0.1.0-py3-none-any.whl"
|
|
0 commit comments