diff --git a/setup.py b/setup.py index 401f4554529b..4282195dbad5 100644 --- a/setup.py +++ b/setup.py @@ -322,9 +322,11 @@ def make_release_tree(self, base_dir, files): "pyparsing>=2.2.1,<3.0.0", "python-dateutil>=2.7", ] + ( - # Installing from a git checkout. - ["setuptools_scm>=4"] if Path(__file__).with_name(".git").exists() - else [] + # Installing from a git checkout that is not producing a wheel. + ["setuptools_scm>=4"] if ( + Path(__file__).with_name(".git").exists() and + os.environ.get("CIBUILDWHEEL", "0") != "1" + ) else [] ), use_scm_version={ "version_scheme": "release-branch-semver",