Skip to content

Commit c7d430b

Browse files
authored
Merge pull request #191 from DeepLabCut/cy/v0.3.0.0-version-bump
Plugin refactor [Version bump]: v0.3.0.0
2 parents 91cc3e0 + bf96c4a commit c7d430b

5 files changed

Lines changed: 72 additions & 48 deletions

File tree

.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/*

.pre-commit-config.yaml

Lines changed: 47 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,64 @@
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
- id: check-yaml
11+
stages: [pre-commit, manual]
712
- id: check-toml
8-
- id: end-of-file-fixer
13+
stages: [pre-commit, manual]
14+
- id: check-merge-conflict
15+
stages: [pre-commit, manual]
916
- id: name-tests-test
17+
stages: [pre-commit, manual]
18+
args: ["--pytest-test-first"]
19+
20+
# These modify files. Run locally only (pre-commit stage).
21+
- id: end-of-file-fixer
22+
stages: [pre-commit]
1023
- id: trailing-whitespace
11-
- repo: https://github.com/astral-sh/ruff-pre-commit
12-
rev: v0.15.4
13-
hooks:
14-
# Run the formatter.
15-
- id: ruff-format
16-
# Run the linter.
17-
- id: ruff-check
18-
args: [--fix,--unsafe-fixes]
24+
stages: [pre-commit]
25+
1926
- repo: https://github.com/tox-dev/pyproject-fmt
20-
rev: v2.16.2
27+
rev: v2.21.1
2128
hooks:
2229
- id: pyproject-fmt
30+
stages: [pre-commit] # modifies -> local only
31+
2332
- repo: https://github.com/abravalheri/validate-pyproject
2433
rev: v0.25
2534
hooks:
2635
- id: validate-pyproject
27-
- repo: https://github.com/tlambert03/napari-plugin-checks
28-
rev: v0.3.0
36+
stages: [pre-commit, manual]
37+
38+
- repo: https://github.com/astral-sh/ruff-pre-commit
39+
rev: v0.15.12
2940
hooks:
30-
- id: napari-plugin-checks
31-
# https://mypy.readthedocs.io/en/stable/introduction.html
32-
# you may wish to add this as well!
33-
# - repo: https://github.com/pre-commit/mirrors-mypy
34-
# rev: v0.910-1
35-
# hooks:
36-
# - id: mypy
41+
# --------------------------
42+
# LOCAL AUTOFIX (developers)
43+
# --------------------------
44+
- id: ruff-check
45+
name: ruff-check (fix)
46+
args: [--fix, --unsafe-fixes]
47+
stages: [pre-commit]
48+
49+
- id: ruff-format
50+
name: ruff-format (write)
51+
stages: [pre-commit]
52+
53+
# --------------------------
54+
# CI CHECK-ONLY (no writes)
55+
# --------------------------
56+
- id: ruff-check
57+
name: ruff-check (ci)
58+
args: [--output-format=github]
59+
stages: [manual]
60+
61+
- id: ruff-format
62+
name: ruff-format (ci)
63+
args: [--check, --diff]
64+
stages: [manual]

mkdocs.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

pyproject.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ license = "LGPL-3.0-only"
1010
license-files = [ "LICENSE" ]
1111
requires-python = ">=3.10"
1212
classifiers = [
13-
"Development Status :: 2 - Pre-Alpha",
13+
"Development Status :: 4 - Beta",
1414
"Framework :: napari",
15-
"Intended Audience :: Developers",
15+
"Intended Audience :: Science/Research",
1616
"Operating System :: OS Independent",
1717
"Programming Language :: Python :: 3 :: Only",
1818
"Programming Language :: Python :: 3.10",
@@ -47,6 +47,7 @@ napari-deeplabcut = "napari_deeplabcut:napari.yaml"
4747
[project.optional-dependencies]
4848
dev = [
4949
"pillow",
50+
"pre-commit",
5051
"pytest",
5152
"pytest-cov",
5253
"pytest-qt",
@@ -64,7 +65,11 @@ Documentation = "https://github.com/DeepLabCut/napari-deeplabcut#README.md"
6465
[tool.setuptools]
6566
include-package-data = true
6667
[tool.setuptools.package-data]
67-
napari_deeplabcut = [ "napari.yaml" ]
68+
napari_deeplabcut = [
69+
"napari.yaml",
70+
"assets/black/*.png",
71+
"assets/white/*.png",
72+
]
6873
[tool.setuptools.package-dir]
6974
"" = "src"
7075
[tool.setuptools.packages.find]

0 commit comments

Comments
 (0)