Skip to content

Migrate development workflow to uv and Ruff - #88

Merged
kripnerl merged 4 commits into
developfrom
agent/uv-repository-guidelines
Aug 12, 2026
Merged

Migrate development workflow to uv and Ruff#88
kripnerl merged 4 commits into
developfrom
agent/uv-repository-guidelines

Conversation

@kripnerl

Copy link
Copy Markdown
Owner

Summary

  • migrate packaging and development dependencies from Poetry to PEP 621, Hatchling, and uv.lock
  • replace Flake8/Pylint with Ruff, retain advisory Ty checks, and add ipykernel/Jupyter tooling
  • migrate GitLab CI and both GitHub Actions workflows to locked uv environments while preserving test and coverage artifacts
  • add AGENTS.md and update contributor, Claude, setup, release, and documentation guidance
  • render committed notebook outputs during docs builds and modernize the affected GEQDSK regression test

Why

The repository documentation and local environment were moving to uv, but dependency declarations, lockfiles, and CI still depended on Poetry. This aligns all contributor and automation paths around one locked workflow.

Validation

  • uv lock --check
  • uv run ruff check pleque/ tests/
  • uv run pytest --junitxml=report.xml --cov=pleque --cov-report=xml:coverage.xml --cov-report=term-missing — 814 passed, 37 skipped
  • uv build
  • uv run make -C docs html — succeeds with existing documentation warnings
  • GitLab CI/CD YAML lint — valid
  • uv run ty check pleque/ — advisory job runs and reports existing legacy diagnostics

kripnerl and others added 4 commits August 11, 2026 19:02
Took 8 minutes

Took 12 minutes
The docs jobs on GitHub and GitLab were green but built with 236 Sphinx
warnings, and the Read the Docs config had never been migrated off Poetry.

Repair notebooks/fuzenet_phd.ipynb, which has been invalid JSON since
f4cdf22 ("Broke up the fuzenet_phd notebook into three notebooks"). That
commit moved two sections into straight_field_lines.ipynb but left their
code behind without the surrounding cell boundaries, merging cells and
dropping commas. nbformat could not parse the result, so nbsphinx fell
back to rendering the raw JSON as reST -- 225 of the 236 warnings, and no
document title. Both orphan blocks are dead code: psi_onq no longer had a
definition, and the code now lives in straight_field_lines.ipynb. With the
JSON valid, the notebook's existing "Common PLEQUE tasks" heading is
picked up again and the examples toctree links to it.

Fix the remaining docstring warnings in pleque/core/. pol_flux and
tor_flux were non-raw docstrings containing \rho and \frac, so Python
substituted a literal carriage return and form feed into the .. math::
blocks and the formulas rendered broken; both are now raw strings. Also
escape |grad psi|^2 (parsed as a substitution reference) and r_\mathrm{mid}
(parsed as a reference to an undefined target), convert lcfs_field_line
from numpydoc sections to the :param: style used elsewhere in the file
(napoleon is not enabled), and add two missing blank lines.

Set SPHINXOPTS = -W so the builds stay warning-free; both CI jobs run
make -C docs html, so both are covered. Read the Docs invokes sphinx-build
directly and is deliberately left lenient, so a warning cannot silently
stale the published site.

Point readthedocs.yml at uv instead of Poetry, and install pandoc there
for nbsphinx, matching what both CI jobs already do.

Drop the duplicated before_script in the GitLab docs job in favour of
!reference [default, before_script], and strip 16 nonstandard jetTransient
keys from notebooks/pleque_compass.ipynb so every notebook validates.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Complexity Health
. 100% 0
config 98% 0
core 69% 0
core.interpolators 100% 0
core.math 100% 0
io 41% 0
io.jet 0% 0
resources 100% 0
spatran 44% 0
tests 81% 0
utils 61% 0
Summary 61% (2325 / 3811) 0

@kripnerl
kripnerl marked this pull request as ready for review August 12, 2026 11:30
@kripnerl
kripnerl merged commit 6102fcd into develop Aug 12, 2026
7 checks passed
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.

1 participant