Skip to content

Remove setuptools from runtime dependency#2121

Open
ricardoV94 wants to merge 2 commits into
pymc-devs:mainfrom
ricardoV94:cleanup_deps
Open

Remove setuptools from runtime dependency#2121
ricardoV94 wants to merge 2 commits into
pymc-devs:mainfrom
ricardoV94:cleanup_deps

Conversation

@ricardoV94
Copy link
Copy Markdown
Member

@ricardoV94 ricardoV94 commented May 11, 2026

Drops setuptools as a runtime dependency. It only entered the runtime deps because aesara-devs/aesara#1050 (2022) and #277 (2023) reached for setuptools._distutils.sysconfig and setuptools.errors.CompileError to replace deprecated distutils — stdlib sysconfig had identical equivalents the whole time, and _distutils is a private namespace setuptools makes no stability promises about. The same concern was raised in #2026 but closed without action. Lazy imports in #1170 hid the cost; this PR removes it entirely.

Swaps the four setuptools._distutils.sysconfig calls in link/c/cmodule.py to stdlib sysconfig, replaces setuptools.errors.CompileError with a local Exception subclass, and drops setuptools from [project.dependencies] (kept in [build-system].requires). pytest tests/link/c passes; verified that pytensor.function end-to-end still works with setuptools blocked from import.

Related issues: #2026, #481
Prior PRs: #277, #483, #812, #1170, aesara-devs/aesara#1050

@ricardoV94 ricardoV94 added maintenance dependencies Pull requests that update a dependency file labels May 11, 2026
@ricardoV94 ricardoV94 marked this pull request as ready for review May 11, 2026 16:32
@ricardoV94 ricardoV94 requested a review from maresb May 11, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant