Skip to content

Commit f43ceeb

Browse files
authored
Merge pull request #175 from DeepLabCut/cy/feature-refactor-2026
Plugin refactor : full version User patch notes available [here(#195).
2 parents f8746f9 + 19f8b0a commit f43ceeb

119 files changed

Lines changed: 30346 additions & 3104 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/format.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
steps:
1414
- name: Checkout full history
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@v6
1616
with:
1717
fetch-depth: 0
1818

@@ -40,13 +40,13 @@ jobs:
4040

4141
steps:
4242
- name: Checkout PR branch
43-
uses: actions/checkout@v4
43+
uses: actions/checkout@v6
4444
with:
4545
fetch-depth: 0
4646
ref: ${{ github.head_ref }}
4747

4848
- name: Set up Python
49-
uses: actions/setup-python@v5
49+
uses: actions/setup-python@v6
5050
with:
5151
python-version: "3.12"
5252

.github/workflows/test_and_deploy.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ on:
77
push:
88
branches:
99
- main
10-
- npe2
1110
tags:
1211
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
1312
pull_request:
1413
branches:
1514
- main
16-
- npe2
1715
workflow_dispatch:
1816
inputs:
1917
force_deploy:
@@ -33,10 +31,10 @@ jobs:
3331
python-version: ["3.10", "3.11", "3.12"]
3432

3533
steps:
36-
- uses: actions/checkout@v4
34+
- uses: actions/checkout@v6
3735

3836
- name: Set up Python ${{ matrix.python-version }}
39-
uses: actions/setup-python@v5
37+
uses: actions/setup-python@v6
4038
with:
4139
python-version: ${{ matrix.python-version }}
4240

@@ -69,7 +67,7 @@ jobs:
6967
PLATFORM: ${{ matrix.platform }}
7068

7169
- name: Coverage
72-
uses: codecov/codecov-action@v4
70+
uses: codecov/codecov-action@v6
7371

7472
deploy:
7573
# this will run when you have tagged a commit, starting with "v*"
@@ -78,24 +76,28 @@ jobs:
7876
needs: [test]
7977
runs-on: ubuntu-latest
8078
if: |
81-
always() &&
82-
inputs.force_deploy ||
83-
(contains(github.ref, 'tags') && contains(needs.test.result, 'success'))
79+
always() && (
80+
(github.event_name == 'workflow_dispatch' && inputs.force_deploy) ||
81+
(startsWith(github.ref, 'refs/tags/v') && needs.test.result == 'success')
82+
)
8483
steps:
85-
- uses: actions/checkout@v4
84+
- uses: actions/checkout@v6
8685
- name: Set up Python
87-
uses: actions/setup-python@v4
86+
uses: actions/setup-python@v6
8887
with:
8988
python-version: "3.x"
9089
- name: Install dependencies
9190
run: |
9291
python -m pip install --upgrade pip
9392
pip install -U setuptools setuptools_scm wheel twine build
94-
- name: Build and publish
93+
- name: Build package
94+
run: python -m build .
95+
- name: Check metadata
96+
run: twine check --strict dist/*
97+
- name: Publish to PyPI
9598
env:
9699
TWINE_USERNAME: __token__
97100
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
98101
run: |
99102
git tag
100-
python -m build .
101103
twine upload dist/*

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,6 @@ venv/
8282

8383
# written by setuptools_scm
8484
**/_version.py
85+
86+
# Package managers
87+
uv.lock

.pre-commit-config.yaml

Lines changed: 47 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,65 @@
1+
default_stages: [pre-commit]
2+
13
repos:
24
- repo: https://github.com/pre-commit/pre-commit-hooks
35
rev: v6.0.0
46
hooks:
7+
# These are safe to run in both local & CI (they don't require "fix vs check" split)
58
- id: check-added-large-files
9+
stages: [pre-commit, manual]
610
args: ['--maxkb=1024']
711
- id: check-yaml
12+
stages: [pre-commit, manual]
813
- id: check-toml
9-
- id: end-of-file-fixer
14+
stages: [pre-commit, manual]
15+
- id: check-merge-conflict
16+
stages: [pre-commit, manual]
1017
- id: name-tests-test
11-
args: ['--pytest-test-first']
18+
stages: [pre-commit, manual]
19+
args: ["--pytest-test-first"]
20+
21+
# These modify files. Run locally only (pre-commit stage).
22+
- id: end-of-file-fixer
23+
stages: [pre-commit]
1224
- id: trailing-whitespace
13-
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.15.4
15-
hooks:
16-
# Run the formatter.
17-
- id: ruff-format
18-
# Run the linter.
19-
- id: ruff-check
20-
args: [--fix,--unsafe-fixes]
25+
stages: [pre-commit]
26+
2127
- repo: https://github.com/tox-dev/pyproject-fmt
22-
rev: v2.16.2
28+
rev: v2.21.1
2329
hooks:
2430
- id: pyproject-fmt
31+
stages: [pre-commit] # modifies -> local only
32+
2533
- repo: https://github.com/abravalheri/validate-pyproject
2634
rev: v0.25
2735
hooks:
2836
- id: validate-pyproject
29-
- repo: https://github.com/tlambert03/napari-plugin-checks
30-
rev: v0.3.0
37+
stages: [pre-commit, manual]
38+
39+
- repo: https://github.com/astral-sh/ruff-pre-commit
40+
rev: v0.15.12
3141
hooks:
32-
- id: napari-plugin-checks
33-
# https://mypy.readthedocs.io/en/stable/introduction.html
34-
# you may wish to add this as well!
35-
# - repo: https://github.com/pre-commit/mirrors-mypy
36-
# rev: v0.910-1
37-
# hooks:
38-
# - id: mypy
42+
# --------------------------
43+
# LOCAL AUTOFIX (developers)
44+
# --------------------------
45+
- id: ruff-check
46+
name: ruff-check (fix)
47+
args: [--fix, --unsafe-fixes]
48+
stages: [pre-commit]
49+
50+
- id: ruff-format
51+
name: ruff-format (write)
52+
stages: [pre-commit]
53+
54+
# --------------------------
55+
# CI CHECK-ONLY (no writes)
56+
# --------------------------
57+
- id: ruff-check
58+
name: ruff-check (ci)
59+
args: [--output-format=github]
60+
stages: [manual]
61+
62+
- id: ruff-format
63+
name: ruff-format (ci)
64+
args: [--check, --diff]
65+
stages: [manual]

0 commit comments

Comments
 (0)