Migrate to uv, ruff, and pyproject.toml#663
Conversation
8011237 to
fcf69c5
Compare
rtibbles
left a comment
There was a problem hiding this comment.
I think this could do with being rebased onto latest main, and including uv specific updates in AGENTS.md and CLAUDE.md
fcf69c5 to
765eb3c
Compare
|
Rebased onto latest main and added uv-specific workflow documentation to both AGENTS.md and CLAUDE.md (commit 765eb3c). |
1a0ca45 to
40a534e
Compare
dd17095 to
b504482
Compare
42d0a26 to
f4c993a
Compare
rtibbles
left a comment
There was a problem hiding this comment.
Incorrect line length conventions, improperly committed files.
The reformatting commit needs to be redone to avoid churn.
The commit history should be amended.
f4c993a to
2799445
Compare
|
All reviewer feedback has been addressed:
Local verification: PHASE_COMPLETE |
333e730 to
73f158b
Compare
Replace setup.py/setup.cfg with pyproject.toml (setuptools backend, PEP 735 dependency groups, setuptools-scm versioning). Remove tox.ini, pytest.ini, MANIFEST.in. Add uv.lock. Configure ruff (line-length=88, max-line-length=160) and replace black/flake8/reorder-python-imports with ruff in .pre-commit-config.yaml, adding uv-lock hook. Configure exclude-newer cooldown with le-utils exemption.
Replace hardcoded __version__ with importlib.metadata.version(). Update docs/conf.py to match.
Replace setup-python/tox with setup-uv@v7 in test workflow. Replace pre-commit/action with prek in linting workflow. Use uv build in publish workflow. Switch dependabot from pip to uv ecosystem. Update ReadTheDocs config to install via uv. Update CONTRIBUTING.md with uv-based setup instructions. Update Makefile to use uv, ruff, and prek. Update AGENTS.md and CLAUDE.md with uv-specific guidance.
Apply ruff auto-fixes and formatting across the codebase to comply with the new ruff configuration (replacing black/flake8/reorder-python-imports).
PDFParser.open() leaked a file handle on Windows if CustomPDFReader raised (because __enter__ failing means __exit__/close() is never called). Wrap the CustomPDFReader call in try/except to ensure close() runs on error. download_fixture_file previously opened local_path for writing before making the network request, leaving empty files on timeout. Download to a .tmp sidecar first, replace atomically on success, skip on requests.RequestException or non-200 response, and re-download zero-byte files from interrupted prior runs. Consolidate _save_file_url_to_path wrapper (was a thin re-export) and remove post-download assert os.path.exists checks — download_fixture_file now calls pytest.skip() instead of returning normally on failure.
b4b4b49 to
bcf891b
Compare
Summary
Migrate ricecooker from pip/tox/setup.py/black/flake8 to uv/ruff/pyproject.toml, matching the approach established in the Kolibri ecosystem (learningequality/kolibri#14457).
pyproject.tomlreplacessetup.py,setup.cfg,pytest.ini, andMANIFEST.inas the single source of project metadata, dependencies, build config, and tool settings__version__+ bumpversion to setuptools-scm withimportlib.metadatatox.iniremoved; CI workflows useuv rundirectly viaastral-sh/setup-uv@v7uv-locksync hookexclude-newercooldown configured in[tool.uv]for supply chain safety==used instead of=forSETTINGSassignment inchefs.py(deprecated setting migration was silently broken)PDFParser.open()file handle leak on Windows whenCustomPDFReaderraises on an empty/corrupt PDF; consolidate test fixture download logic intoconftest.pyasdownload_fixture_file— downloads atomically via a.tmpsidecar, skips on network failure or non-200 response, and re-downloads zero-byte files from interrupted prior runs (was causing CI failures on Windows)References
Closes #662
Reference implementation: learningequality/kolibri#14457
Reviewer guidance
pyproject.toml— verify dependency completeness against the oldsetup.pyinstall_requiresandextras_require, check setuptools-scm and PEP 735 dependency group configpythontest.yml,pre-commit.yml,python-publish.yml) — the tox-to-uv migration andastral-sh/setup-uv@v7setupricecooker/__init__.py:8-14— version now usesimportlib.metadata.version()instead of a hardcoded stringricecooker/chefs.py— fixed==→=bug in deprecated setting migration (silent no-op before this PR)To test locally:
uv sync --group dev && uv run pytestAI usage
Implemented by Claude Code following a plan derived from the Kolibri uv migration (learningequality/kolibri#14457). Changes were reviewed against the issue acceptance criteria.
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?