From b9f6f4168ab48278e3fa0cc8f79c4ada09537777 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 7 Sep 2022 10:07:05 +0100 Subject: [PATCH] Fix SetuptoolsDeprecationWarning about using --global-option --- docs/changelog/2478.bugfix.rst | 1 + src/tox/helper/build_isolated.py | 2 +- tests/unit/package/builder/test_package_builder_isolated.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 docs/changelog/2478.bugfix.rst diff --git a/docs/changelog/2478.bugfix.rst b/docs/changelog/2478.bugfix.rst new file mode 100644 index 000000000..f426a23c2 --- /dev/null +++ b/docs/changelog/2478.bugfix.rst @@ -0,0 +1 @@ +Fixed ``SetuptoolsDeprecationWarning`` about using ``--global-option`` -- by :user:`adamchainz` diff --git a/src/tox/helper/build_isolated.py b/src/tox/helper/build_isolated.py index 4c57c5734..fda88fda1 100644 --- a/src/tox/helper/build_isolated.py +++ b/src/tox/helper/build_isolated.py @@ -38,5 +38,5 @@ def _ensure_module_in_paths(module, paths): if backend_obj: backend = getattr(backend, backend_obj) -basename = backend.build_sdist(dist_folder, {"--global-option": ["--formats=gztar"]}) +basename = backend.build_sdist(dist_folder, {"--build-option": ["--formats=gztar"]}) print(basename) diff --git a/tests/unit/package/builder/test_package_builder_isolated.py b/tests/unit/package/builder/test_package_builder_isolated.py index 9501f40f2..8a41f2df8 100644 --- a/tests/unit/package/builder/test_package_builder_isolated.py +++ b/tests/unit/package/builder/test_package_builder_isolated.py @@ -25,6 +25,7 @@ def test_verbose_isolated_build(initproj, mock_venv, cmd): }, ) result = cmd("--sdistonly", "-v", "-v", "-v", "-e", "py") + assert "The arguments ['--formats=gztar'] were given via `--global-option`." not in result.err assert "running sdist" in result.out, result.out assert "running egg_info" in result.out, result.out assert "example123-0.5.tar.gz" in result.out, result.out