Apply linting to entire codebase & add CI workflow to check linting#167
Merged
Apply linting to entire codebase & add CI workflow to check linting#167
Conversation
… config Populate pyproject.toml with PEP 621 project metadata and setuptools configuration: set build-system requirements (setuptools>=64, wheel, setuptools_scm[toml]>=7), declare package name, description, python requirement, license, authors, classifiers, dependencies, project URLs and napari entry-point. Configure setuptools to use src layout, include package data (napari.yaml), mark version as dynamic (setuptools-scm), and add optional testing dependencies. Minor whitespace/qt_api line adjustments preserved.
Update pyproject.toml: raise build-system requirement to setuptools>=77 and replace the license table with license = "LGPL-3.0-only" plus license-files = ["LICENSE"]. These changes align packaging metadata with newer setuptools/PEP expectations and ensure the license file is included.
Add GNU Lesser General Public License v3 (LGPLv3) to the project classifiers in pyproject.toml to explicitly declare the license. Also rephrase the setuptools-scm comment for clarity that the version is derived from git tags.
Add pyproject-fmt and validate-pyproject to pre-commit to enforce and validate pyproject.toml formatting. Add [tool.pyproject-fmt] settings in pyproject.toml to set max_supported_python to 3.12, enable generation of Python version classifiers, and keep tables in long format to preserve readability.
Delete the GNU Lesser General Public License v3 trove classifier from pyproject.toml to correct package metadata, following PEP 639
3 tasks
Remove the setup-cfg-fmt hook from .pre-commit-config.yaml. Correct a grammar/casing issue in pyproject.toml by changing the author line from "Lead by Jessy Lauer" to "led by Jessy Lauer".
Add several pre-commit hooks (check-added-large-files, check-yaml, check-toml, name-tests-test, check-merge-conflict) alongside existing EOF and trailing-whitespace fixes to improve repo hygiene and catch common issues early. Also configure ruff's pydocstyle convention to "google" in pyproject.toml to enforce Google-style docstrings.
Add a GitHub Actions workflow that runs pre-commit checks only on files changed in a pull request. The workflow triggers on PR opened/synchronize/reopened, fetches full git history to detect changed files against the base branch, and exposes that list as an output. A conditional precommit job runs only when changes exist: it checks out the PR branch, sets up Python 3.12, installs pre-commit, and executes pre-commit in CI check-only mode on the changed files (--hook-stage manual --show-diff-on-failure).
deruyter92
approved these changes
Mar 11, 2026
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.
Following standardization efforts across repos, this PR introduces a workflow to automatically enforce linting on PRs and applies the configuration introduced in #166 to all existing files.
Changes:
(Copies the procedure from DeepLabCut/DeepLabCut-live#166)