Remove deprecated setup_requires in favor of PEP 517#711
Merged
dkropachev merged 1 commit intomasterfrom Feb 23, 2026
Merged
Conversation
…uires setup.py passed setup_requires=['Cython>=3.0.11,<4'] to setup(), which triggers a deprecation warning on setuptools>=70: setuptools.installer and fetch_build_eggs are deprecated. Requirements should be satisfied by a PEP 517 installer. Since pyproject.toml already declares Cython in [build-system].requires, the setup_requires is redundant. Remove it along with the supporting pre_build_check() function, the egg_info bypass, and the CASS_DRIVER_ALLOWED_CYTHON_VERSION env var handling. Users who need a specific Cython version can use UV_CONSTRAINT, PIP_CONSTRAINT, or pre-install it before building. Fixes #694
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the deprecated
setup_requiresmechanism fromsetup.pyin favor of the PEP 517 build system already configured inpyproject.toml.Background
PEP 517 standardized how Python packages declare build dependencies via
pyproject.toml's[build-system].requires. Before PEP 517,setup_requiresinsetup()was the way to pull in build-time dependencies like Cython. setuptools implemented this throughfetch_build_eggs, which downloaded eggs at build time — bypassing pip's dependency resolver and causing various issues.Starting with setuptools 70, using
setup_requiresemits a deprecation warning:Our
pyproject.tomlalready declares Cython as a PEP 517 build dependency:This means any PEP 517 compliant installer (pip, uv, build) will install Cython before
setup.pyruns, makingsetup_requiresredundant.Changes
setup_requires=['Cython>=3.0.11,<4']from thesetup()call inrun_setup()— redundant with[build-system].requiresand the source of the deprecation warningpre_build_check()function — only existed to gatesetup_requires; compiler availability is still handled gracefully bybuild_extensions.build_extension()which catches and reports compilation failuresegg_infobypass (try_cython &= 'egg_info' not in sys.argv) — existed to preventsetup_requiresfrom triggering during pip's metadata phase, no longer relevantCASS_DRIVER_ALLOWED_CYTHON_VERSIONenv var — only affected thesetup_requiresCython version pin; users who need a specific Cython version can useUV_CONSTRAINT,PIP_CONSTRAINT, or pre-install it before buildingWhat stays the same
build_extensionsclass and_setup_extensions()— these dynamically discover and compile Cython extensions at build time, which works fine under PEP 517try_cythonflag andCASS_DRIVER_NO_CYTHONenv var — still controls whether Cython modules are builtext_modules=[Extension('DUMMY', [])]) — still needed so setuptools invokesbuild_extFixes #694
Test plan
uv synccompletes without PEP 517 deprecation warningpython setup.py build_ext --inplacecompletes without deprecation warning