diff options
| author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-03-25 13:56:08 +0000 |
|---|---|---|
| committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-03-25 13:56:08 +0000 |
| commit | 9bc0d0a68fbe47c758fa733fdd9484ed0fb0c7b7 (patch) | |
| tree | d1980df771a9f58c50228ef2db4d2092b643f4e9 /setuptools/tests/config | |
| parent | 51d5124b929ecff3ca590a565b994b9cd4922158 (diff) | |
| download | python-setuptools-git-9bc0d0a68fbe47c758fa733fdd9484ed0fb0c7b7.tar.gz | |
Test setup.py' include_package_data not ignored when parsing pyproject
Diffstat (limited to 'setuptools/tests/config')
| -rw-r--r-- | setuptools/tests/config/test_pyprojecttoml.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/setuptools/tests/config/test_pyprojecttoml.py b/setuptools/tests/config/test_pyprojecttoml.py index 0157b2ad..0fdca253 100644 --- a/setuptools/tests/config/test_pyprojecttoml.py +++ b/setuptools/tests/config/test_pyprojecttoml.py @@ -4,6 +4,7 @@ from inspect import cleandoc import pytest import tomli_w +from path import Path as _Path from setuptools.config.pyprojecttoml import ( read_configuration, @@ -11,6 +12,9 @@ from setuptools.config.pyprojecttoml import ( validate, ) +import setuptools # noqa -- force distutils.core to be patched +import distutils.core + EXAMPLE = """ [project] name = "myproj" @@ -292,3 +296,22 @@ def test_include_package_data_by_default(tmp_path, config): config = read_configuration(pyproject) assert config["tool"]["setuptools"]["include-package-data"] is True + + +def test_include_package_data_in_setuppy(tmp_path): + """Builds with ``pyproject.toml`` should consider ``include_package_data`` set in + ``setup.py``. + + See https://github.com/pypa/setuptools/issues/3197#issuecomment-1079023889 + """ + pyproject = tmp_path / "pyproject.toml" + pyproject.write_text("[project]\nname = 'myproj'\nversion='42'\n") + setuppy = tmp_path / "setup.py" + setuppy.write_text("__import__('setuptools').setup(include_package_data=False)") + + with _Path(tmp_path): + dist = distutils.core.run_setup("setup.py", {}, stop_after="config") + + assert dist.get_name() == "myproj" + assert dist.get_version() == "42" + assert dist.include_package_data is False |
