refactor: pyproject.toml migration + ruff lint clean-up - #13
Open
bknight1 wants to merge 2 commits into
Open
Conversation
- Replace setup.py with PEP 621 pyproject.toml (setuptools backend) - Add environment.yml for conda/mamba (conda-forge + nodefaults, python=3.11) - Migrate CI to use environment.yml via setup-miniconda@v3 (single 3.11 job) - All Python deps (core + jupyter/dev extras) now in pyproject.toml as SSOT - Update README.md and AGENTS.md with conda + pip install tracks
- Add [tool.ruff] config to pyproject.toml (extend-exclude Tutorials) - Auto-fix: import sorting (I001), unused imports (F401), deprecated typing imports (UP006/UP035), unnecessary list() in sorted() (C414) - Manual: narrow exception catches (BLE001/E722/S110), ValueError→TypeError for type validation (TRY004), mutable default args (B006), uncaptured loop variable (B023), unused unpacked variables (RUF059/F841), ClassVar annotations (RUF012), nested with collapse (SIM117), subprocess check (PLW1510) - Add __all__ to __init__.py for explicit public API re-exports - Fix test_grid_extraction.py expected exception (ValueError→TypeError)
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
Replaces
setup.pywith PEP 621pyproject.tomlas the single source of truth for all Python dependencies, addsenvironment.ymlfor conda/mamba users, migrates CI to the env file, and cleans up all 118 ruff lint issues to zero.Changes
Dependency management overhaul (6 files)
[jupyter]+[dev](ruff) extraspip: -e ".[jupyter,dev]"setup-miniconda@v3with env file, single 3.11 jobRuff lint clean-up (25 files)
ruff check .→ 0 errors (was 118)list()insorted()(C414)ValueError→TypeErrorfor type validation (TRY004), mutable default args (B006), uncaptured loop variable (B023), unused unpacked/dead variables (RUF059/F841),ClassVarannotations (RUF012), nestedwithcollapse (SIM117), subprocess check (PLW1510)__all__to__init__.pyfor explicit public API re-exports[tool.ruff]config withextend-exclude = ["Tutorials"]Verification
ruff check .→ 0 errorspython3 -m unittest discover tests→ 88 tests OK, 1 skipped (live Julia test)