Fix #4961: declare pymbolic and platformdirs, drop pycparser#5050
Open
miguelcoolchips wants to merge 1 commit intofiredrakeproject:mainfrom
Open
Fix #4961: declare pymbolic and platformdirs, drop pycparser#5050miguelcoolchips wants to merge 1 commit intofiredrakeproject:mainfrom
miguelcoolchips wants to merge 1 commit intofiredrakeproject:mainfrom
Conversation
Firedrake imports pymbolic (firedrake/mg/kernels.py, firedrake/slate/slac/kernel_builder.py, pyop2/codegen/rep2loopy.py, pyop2/types/dat.py) and platformdirs (firedrake/scripts/firedrake_clean.py, the firedrake-clean console script), but neither was declared in [project.dependencies]. They were pulled in transitively via loopy and pytools, so uv sync / poetry treated them as unused and removed them, breaking the installed environment (issue firedrakeproject#4961). Also drop pycparser from [project.dependencies] — it is not imported anywhere in firedrake/, pyop2/, or tsfc/. petsc4py is intentionally left out of this change; it remains commented alongside the other TODO RELEASE entries and will be declared when the next PETSc release pin is applied. Fixes firedrakeproject#4961 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
de2ffd0 to
293bd44
Compare
connorjward
approved these changes
Apr 22, 2026
Contributor
|
@miguelcoolchips happy to merge if you say this is ready. The docs failures are unrelated and will be fixed imminently. |
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
Fixes #4961 —
uv sync/poetryprune packages that Firedrake imports at runtime but does not declare in[project.dependencies].pymbolic— imported atfiredrake/mg/kernels.py:14,firedrake/slate/slac/kernel_builder.py:10,pyop2/codegen/rep2loopy.py:9,tsfc/loopy.py:16, and method-local sites inpyop2/types/dat.pyandpyop2/codegen/loopycompat.py. Previously only transitive vialoopy.platformdirs— imported atfiredrake/scripts/firedrake_clean.py:7, which is thefiredrake-cleanconsole-script entrypoint. Previously only transitive viapytools.pycparser— noimport pycparser/from pycparseranywhere infiredrake/,pyop2/, ortsfc/. Stale.Intentionally out of scope
petsc4pystays commented alongside the otherTODO RELEASEentries. It will be declared when the next PETSc release pin is applied, consistent with existing practice.requestsis kept — it is used byfiredrake/scripts/firedrake-zenodo(listed under[tool.setuptools].script-files).[project.optional-dependencies]or[build-system].requires— theuv syncbug only affects the basedependencieslist.Verification
python -c "import tomllib; d=tomllib.load(open('pyproject.toml','rb')); deps=d['project']['dependencies']; assert 'pymbolic' in deps and 'platformdirs' in deps and 'pycparser' not in deps"→ okuv pip compile pyproject.tomlresolves cleanlyTest plan
uv sync, confirmpymbolicandplatformdirsare retained (currently they are removed)Commit attribution:
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>.🤖 Generated with Claude Code