Skip to content

Remove 'dry run' functionality throughout.#4872

Merged
jaraco merged 8 commits intomainfrom
debt/dry-run
Feb 6, 2026
Merged

Remove 'dry run' functionality throughout.#4872
jaraco merged 8 commits intomainfrom
debt/dry-run

Conversation

@jaraco
Copy link
Member

@jaraco jaraco commented Mar 9, 2025

Summary of changes

At first, I considered deprecating this functionality. Then I realized that this functionality is exposed almost exclusively through a parameter to setup.py, which is already deprecated. Moreover, it seems unlikely that anyone would use this functionality in today's modern usage. I personally haven't used it even going back to the most legacy usage.

Removing these changes from Setuptools should unblock the failing tests in pypa/distutils#335, and in fact, maybe they should be merged together for easier rollback if needed. [Update] The changes from pypa/distutils#335 are included in this merge.

Ref pypa/distutils#334

Pull Request Checklist

@jaraco jaraco marked this pull request as ready for review March 9, 2025 19:10
@jaraco jaraco force-pushed the debt/dry-run branch 2 times, most recently from bfb58ac to 0ac9dba Compare March 16, 2025 16:17
@jaraco
Copy link
Member Author

jaraco commented Mar 16, 2025

@abravalheri Any reservations before I proceed with merging?

@jaraco
Copy link
Member Author

jaraco commented Feb 6, 2026

Well that's annoying. The test is failing with:

FAILED setuptools/dist.py::ruff - pytest_ruff.RuffError: FURB171 Membership test against single-item container

But the test failure report doesn't indicate where the error exists and instead shows a traceback about how it came to report the failure (unhelpful, pytest-ruff).

The test doesn't fail if I run ruff in standalone mode.

I tested on main and the failure isn't here, so I guess I'll bisect the diff and see if I can figure out where the failure is.

@jaraco
Copy link
Member Author

jaraco commented Feb 6, 2026

Oh, I was wrong - the ruff error is visible in the traceback, and the issue is in line 617.

Removed "ugh!" comment because it's not at all clear if it's even relevant, and even if it was, it's not actionable.
@jaraco jaraco merged commit 326bdb8 into main Feb 6, 2026
41 of 46 checks passed
@jaraco jaraco deleted the debt/dry-run branch February 6, 2026 20:22
@andrey-khropov
Copy link

andrey-khropov commented Feb 7, 2026

Please update the documentation at https://setuptools.pypa.io/en/stable/deprecated/distutils/apiref.html.
I understand that distutils is deprecated but it is not unsupported yet, so it should be mentioned that dry_run parameter is no longer present.

robot-piglet pushed a commit to catboost/catboost that referenced this pull request Feb 8, 2026
robot-piglet pushed a commit to catboost/docs that referenced this pull request Feb 8, 2026
robot-piglet pushed a commit to catboost/catboost that referenced this pull request Feb 8, 2026
@jaraco
Copy link
Member Author

jaraco commented Feb 8, 2026

Please update the documentation at https://setuptools.pypa.io/en/stable/deprecated/distutils/apiref.html. I understand that distutils is deprecated but it is not unsupported yet, so it should be mentioned that dry_run parameter is no longer present.

Thanks for catching this. Docs updated in pypa/distutils@a1c0ebc14, which will merge here in due course.

@mdavidsaver
Copy link

Was this v75.3.4 tag intended to follow v81.0.0?

$ git tag --contains 326bdb8fa7dd9a98814140beadadf51b1beb9486
v75.3.4
v81.0.0
v82.0.0
image

@Avasam
Copy link
Contributor

Avasam commented Feb 9, 2026

@mdavidsaver tags don't have to be linear. In fact, they're arbitrary strings, they don't even have to represent a version number. It's a backport so it's normal that a lower number (patch to a previous major version) comes after a bigger number (actual latest). Also read: #5142 (comment)

@mdavidsaver
Copy link

I completely understand the "can" aspect of git tags. I was asking about the "should" aspect. I have expressed my surprise on #5142 (comment) .

@pkgw
Copy link

pkgw commented Feb 10, 2026

Reporting as requested in the release notes: this change broke gobject-introspection.

@Avasam
Copy link
Contributor

Avasam commented Feb 10, 2026

TypeError: Compiler.init() takes from 1 to 3 positional arguments but 4 were given

I was gonna suggest leaving in an unused parameter, but thinking about it more, maybe this is a rare case where a loud error is better. Script doesn't work vs script that used to dry run now actually makes changes on disk.

arcivanov added a commit to karellen/wheel-axle that referenced this pull request Feb 10, 2026
Remove dry_run from our code and work around lack of pkg_resources
Related to pypa/setuptools#4872

fixes #34
@michailf-cyberhaven
Copy link

michailf-cyberhaven commented Feb 10, 2026

TypeError: Compiler.init() takes from 1 to 3 positional arguments but 4 were given

I was gonna suggest leaving in an unused parameter, but thinking about it more, maybe this is a rare case where a loud error is better. Script doesn't work vs script that used to dry run now actually makes changes on disk.

No, it's not. We use setuptools 69.0.3. We specify the exact version to use in the requirements file. Now this breaks our testing because pytest-dependency, which has not been updated for years but works, passes dry_run parameter to setuptools.

I don't know how this change is affecting v69 but it does somehow.

Brilliant!

@michailf-cyberhaven
Copy link

michailf-cyberhaven commented Feb 10, 2026

python -m pip install pytest-dependency==0.6.0
Defaulting to user installation because normal site-packages is not writeable
Collecting pytest-dependency==0.6.0
  Downloading pytest-dependency-0.6.0.tar.gz (19 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: setuptools in ...\appdata\roaming\python\python312\site-packages (from pytest-dependency==0.6.0) (69.0.3)
Requirement already satisfied: pytest>=3.7.0 in c:\program files\python312\lib\site-packages (from pytest-dependency==0.6.0) (9.0.2)
Requirement already satisfied: colorama>=0.4 in c:\program files\python312\lib\site-packages (from pytest>=3.7.0->pytest-dependency==0.6.0) (0.4.6)
Requirement already satisfied: iniconfig>=1.0.1 in c:\program files\python312\lib\site-packages (from pytest>=3.7.0->pytest-dependency==0.6.0) (2.3.0)
Requirement already satisfied: packaging>=22 in c:\program files\python312\lib\site-packages (from pytest>=3.7.0->pytest-dependency==0.6.0) (25.0)
Requirement already satisfied: pluggy<2,>=1.5 in c:\program files\python312\lib\site-packages (from pytest>=3.7.0->pytest-dependency==0.6.0) (1.6.0)
Requirement already satisfied: pygments>=2.7.2 in c:\program files\python312\lib\site-packages (from pytest>=3.7.0->pytest-dependency==0.6.0) (2.19.2)
Building wheels for collected packages: pytest-dependency
  Building wheel for pytest-dependency (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pytest-dependency (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [81 lines of output]
      ...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\dist.py:765: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!

              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:

              License :: OSI Approved :: Apache Software License

              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************

      !!
        self._finalize_license_expression()
      running bdist_wheel
      running build
      running build_py
      running meta
      version: 0.6.0
      creating build\lib
      Traceback (most recent call last):
        File "C:\Program Files\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module>
          main()
        File "C:\Program Files\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Program Files\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 280, in build_wheel
          return _build_backend().build_wheel(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\build_meta.py", line 441, in build_wheel
          return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\build_meta.py", line 429, in _build
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\build_meta.py", line 410, in _build_with_temp_dir
          self.run_setup()
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\build_meta.py", line 520, in run_setup
          super().run_setup(setup_script=setup_script)
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup
          exec(code, locals())
        File "<string>", line 124, in <module>
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)  # type: ignore[return-value]
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 186, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 202, in run_commands
          dist.run_commands()
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 1000, in run_commands
          self.run_command(cmd)
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\dist.py", line 1107, in run_command
          super().run_command(command)
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 1019, in run_command
          cmd_obj.run()
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\command\bdist_wheel.py", line 370, in run
          self.run_command("build")
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 341, in run_command
          self.distribution.run_command(command)
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\dist.py", line 1107, in run_command
          super().run_command(command)
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 1019, in run_command
          cmd_obj.run()
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 135, in run
          self.run_command(cmd_name)
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 341, in run_command
          self.distribution.run_command(command)
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\dist.py", line 1107, in run_command
          super().run_command(command)
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 1019, in run_command
          cmd_obj.run()
        File "<string>", line 118, in run
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\command\build_py.py", line 76, in run
          self.build_modules()
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\_distutils\command\build_py.py", line 360, in build_modules
          self.build_module(module, module_file, package)
        File "...\AppData\Local\Temp\pip-build-env-drrhjv9w\overlay\Lib\site-packages\setuptools\_distutils\command\build_py.py", line 351, in build_module
          return self.copy_file(module_file, outfile, preserve_mode=False)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<string>", line 71, in copy_file
      TypeError: copy_file() got an unexpected keyword argument 'dry_run'
      [end of output]

@michailf-cyberhaven
Copy link

@jaraco FYI

@michailf-cyberhaven
Copy link

michailf-cyberhaven commented Feb 11, 2026

It looks like pip install uses build isolation environment that completely ignores the pre-installed setuptools and installs its own "newest" setuptools. But this breaks packages that we have no control over. The workaround is to use --no-build-isolation with pip install to force it to use the pre-installed packages. This, however, makes you maintain the dependencies manually.

@andrey-khropov
Copy link

It looks like pip install uses build isolation environment that completely ignores the pre-installed setuptools and installs its own "newest" setuptools. But this breaks packages that we have no control over. The workaround is to use --no-build-isolation with pip install to force it to use the pre-installed packages. This, however, makes you maintain the dependencies manually.

You can restict setuptools version used during the build using the build constraints:
https://pip.pypa.io/en/latest/user_guide/#build-constraints

It can also be included in the project's own pyproject.toml: https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#build-system-requirement

BTW, there's a PR in pytest-dependency to fix this issue

mammo0 added a commit to mammo0/freetype-py that referenced this pull request Feb 16, 2026
myd7349 added a commit to myd7349/cppimport that referenced this pull request Mar 1, 2026
Dry run functionality has been removed from setuptools v81.0.0+.

pypa/setuptools#4872

pypa/distutils#335
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants