Skip to content

Fix #4961: declare pymbolic and platformdirs, drop pycparser#5050

Open
miguelcoolchips wants to merge 1 commit intofiredrakeproject:mainfrom
Corintis:fix/4961-undeclared-deps
Open

Fix #4961: declare pymbolic and platformdirs, drop pycparser#5050
miguelcoolchips wants to merge 1 commit intofiredrakeproject:mainfrom
Corintis:fix/4961-undeclared-deps

Conversation

@miguelcoolchips
Copy link
Copy Markdown
Contributor

⚠️ This PR was generated by an AI agent (Claude Opus 4.7). All commits are attributed accordingly. A human should review before merging.

Summary

Fixes #4961uv sync / poetry prune packages that Firedrake imports at runtime but does not declare in [project.dependencies].

  • Add pymbolic — imported at firedrake/mg/kernels.py:14, firedrake/slate/slac/kernel_builder.py:10, pyop2/codegen/rep2loopy.py:9, tsfc/loopy.py:16, and method-local sites in pyop2/types/dat.py and pyop2/codegen/loopycompat.py. Previously only transitive via loopy.
  • Add platformdirs — imported at firedrake/scripts/firedrake_clean.py:7, which is the firedrake-clean console-script entrypoint. Previously only transitive via pytools.
  • Drop pycparser — no import pycparser / from pycparser anywhere in firedrake/, pyop2/, or tsfc/. Stale.

Intentionally out of scope

  • petsc4py stays commented alongside the other TODO RELEASE entries. It will be declared when the next PETSc release pin is applied, consistent with existing practice.
  • requests is kept — it is used by firedrake/scripts/firedrake-zenodo (listed under [tool.setuptools].script-files).
  • No changes to [project.optional-dependencies] or [build-system].requires — the uv sync bug only affects the base dependencies list.

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" → ok
  • uv pip compile pyproject.toml resolves cleanly
  • Metadata-only change, no code paths modified, so the existing test suite is unaffected.

Test plan

  • Reproduce the original failure: install Firedrake in a fresh env, run uv sync, confirm pymbolic and platformdirs are retained (currently they are removed)
  • CI passes

Commit attribution: Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>.

🤖 Generated with Claude Code

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>
@miguelcoolchips miguelcoolchips force-pushed the fix/4961-undeclared-deps branch from de2ffd0 to 293bd44 Compare April 22, 2026 13:22
@connorjward
Copy link
Copy Markdown
Contributor

@miguelcoolchips happy to merge if you say this is ready. The docs failures are unrelated and will be fixed imminently.

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.

BUG: Undeclared dependencies break uv sync

2 participants