Modernize repo: type hints, ruff, pre-commit, Python 3.14 CI#2
Merged
Conversation
…README - Add type annotations throughout wiggle.py with from __future__ import annotations - Add py.typed marker for PEP 561 typed package support - Add ruff for linting & formatting with modern rule set (E/W/F/I/UP/B/SIM/RUF) - Add pre-commit config with ruff hooks - Expand CI test matrix to Python 3.10-3.14 - Add dedicated lint job to CI pipeline - Update actions/setup-python from v3 to v5 (with allow-prereleases for 3.14) - Add PyPI classifiers (Typing::Typed, all supported Python versions) - Rename wiggle_input_check -> _validate_inputs (private, clearer name) - Fix xx validation bug (was checking tt.shape[0] instead of xx.shape[0]) - Modernize RNG: np.random.randn -> np.random.default_rng().standard_normal - Clean up .gitignore (remove irrelevant Django/Flask/Scrapy entries) - Rewrite README with quick-start example and development instructions - Fix CI badge URL (gatechzhu -> lijunzh) - Add pytest.ini_options to pyproject.toml - Add autouse fixture to close matplotlib figures after each test - Expand test coverage: verbose output, sf type, ax type validation - Make verbose keyword-only in wiggle() signature
Pillow 11.1.0 (transitive dep via matplotlib) doesn't ship pre-built wheels for Python 3.14 yet, causing source builds to fail on CI runners missing libjpeg headers. Will re-add once the ecosystem catches up.
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
This PR brings the 10-year-old wiggle repo into 2025 with modern Python tooling and best practices.
Changes
Code Quality & Typing
wiggle.pyusingfrom __future__ import annotationspy.typedmarker (PEP 561) for downstream type checker supportverboseis now keyword-only inwiggle()— prevents positional arg footgunswiggle_input_check→_validate_inputs(private helper, clearer name)xxvalidation was checkingtt.shape[0]instead ofxx.shape[0]Linting & Formatting
E/W/F/I/UP/B/SIM/RUFruff checkandruff format --checkCI/CD
actions/setup-pythonupdated from v3 → v5 (withallow-prereleasesfor 3.14)lintandtestsPackaging & Metadata
pytest.ini_optionsinpyproject.tomlTests
autousefixture to close matplotlib figures after each test (no leaks)np.random.randn→np.random.default_rng().standard_normalHousekeeping