Skip to content

Commit f751fd8

Browse files
committed
more cicd stuff
1 parent c93d42c commit f751fd8

File tree

5 files changed

+82
-124
lines changed

5 files changed

+82
-124
lines changed

.github/workflows/checks.yaml

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ jobs:
77
matrix:
88
python-version: ['3.11', '3.12', '3.13']
99
steps:
10-
- uses: actions/checkout@v3
10+
- uses: actions/checkout@v6
1111

1212
- name: Set up Python
13-
uses: actions/setup-python@v4
13+
uses: actions/setup-python@v6
1414
with:
1515
python-version: ${{ matrix.python-version }}
1616

1717
- name: Install uv
18-
uses: astral-sh/setup-uv@v6
18+
uses: astral-sh/setup-uv@v7
1919
with:
2020
enable-cache: true
2121

@@ -24,18 +24,19 @@ jobs:
2424

2525
- name: Run tests
2626
run: uv run pytest
27+
2728
python-lint:
2829
runs-on: ubuntu-latest
2930
steps:
30-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@v6
3132

3233
- name: Setup Python
33-
uses: actions/setup-python@v5
34+
uses: actions/setup-python@v6
3435
with:
35-
python-version: 3.11
36+
python-version: 3.13
3637

3738
- name: Install uv
38-
uses: astral-sh/setup-uv@v6
39+
uses: astral-sh/setup-uv@v7
3940
with:
4041
enable-cache: true
4142

@@ -44,13 +45,14 @@ jobs:
4445

4546
- name: Check style
4647
run: uv run ruff check && uv run ruff format --check
48+
4749
rust-lint:
4850
runs-on: ubuntu-latest
4951
defaults:
5052
run:
5153
working-directory: ./rust
5254
steps:
53-
- uses: actions/checkout@v4
55+
- uses: actions/checkout@v6
5456

5557
- name: Update Rust
5658
run: rustup update stable && rustup default stable
@@ -62,20 +64,9 @@ jobs:
6264

6365
precommit_hooks:
6466
runs-on: ubuntu-latest
65-
strategy:
66-
matrix:
67-
cmd:
68-
- "end-of-file-fixer"
69-
- "trailing-whitespace"
70-
- "mixed-line-ending"
7167
steps:
72-
- uses: actions/checkout@v4
73-
74-
- name: Set up Python 3.12
75-
uses: actions/setup-python@v5
76-
with:
77-
python-version: 3.12
68+
- uses: actions/checkout@v6
7869

79-
- uses: pre-commit/action@v3.0.1
70+
- uses: j178/prek-action@v1
8071
with:
81-
extra_args: ${{ matrix.cmd }} --all-files
72+
extra_args: '--all-files --skip "ruff-format" --skip "ruff-check" --skip "fmt"'

.pre-commit-config.yaml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0 # pre-commit-hooks version
3+
rev: v6.0.0 # pre-commit-hooks version
44
hooks:
5-
- id: check-added-large-files
6-
- id: detect-private-key
7-
- id: trailing-whitespace
8-
- id: end-of-file-fixer
9-
- id: check-merge-conflict
105
- id: detect-aws-credentials
116
args: [ --allow-missing-credentials ]
7+
- repo: builtin
8+
hooks:
9+
- id: trailing-whitespace
10+
- id: check-added-large-files
11+
args: ['--maxkb=1500']
12+
- id: check-case-conflict
13+
- id: end-of-file-fixer
14+
- id: fix-byte-order-marker
15+
- id: check-json
16+
- id: check-toml
17+
- id: check-yaml
1218
- id: mixed-line-ending
1319
args: [ --fix=lf ]
20+
- id: check-merge-conflict
21+
- id: detect-private-key
1422
- repo: https://github.com/astral-sh/ruff-pre-commit
15-
rev: v0.12.1 # ruff version
23+
rev: v0.14.10 # ruff version
1624
hooks:
1725
- id: ruff-format
18-
- id: ruff
26+
- id: ruff-check
1927
args: [ --fix, --exit-non-zero-on-fix ]
2028
- repo: https://github.com/doublify/pre-commit-rust
2129
rev: v1.0
2230
hooks:
2331
- id: fmt
2432
entry: bash -c 'cd rust && cargo fmt'
2533
args: ['--verbose', '--']
26-
27-
minimum_pre_commit_version: 4.2.0
34+
minimum_prek_version: 0.2.23

pyproject.toml

Lines changed: 51 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ tests = [
3131
]
3232
dev = [
3333
"maturin",
34-
"ruff==0.12.1",
35-
"pre-commit>=4.2.0",
34+
"ruff==0.14.10",
35+
"prek>=0.2.23",
3636
]
3737

3838
[project.urls]
@@ -62,111 +62,72 @@ branch = true
6262
src = ["src"]
6363

6464
[tool.ruff.lint]
65-
select = [
66-
"F", # https://docs.astral.sh/ruff/rules/#pyflakes-f
67-
"E", "W", # https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
68-
"I", # https://docs.astral.sh/ruff/rules/#isort-i
69-
"N", # https://docs.astral.sh/ruff/rules/#pep8-naming-n
70-
"D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d
71-
"UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up
72-
"ANN", # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
73-
"ASYNC", # https://docs.astral.sh/ruff/rules/#flake8-async-async
74-
"S", # https://docs.astral.sh/ruff/rules/#flake8-bandit-s
75-
"B", # https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
76-
"A", # https://docs.astral.sh/ruff/rules/#flake8-builtins-a
77-
"C4", # https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
78-
"DTZ", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
79-
"T10", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
80-
"EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
81-
"LOG", # https://docs.astral.sh/ruff/rules/#flake8-logging-log
82-
"INP", # https://docs.astral.sh/ruff/rules/#flake8-no-pep420-inp
83-
"G", # https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
84-
"PIE", # https://docs.astral.sh/ruff/rules/#flake8-pie-pie
85-
"T20", # https://docs.astral.sh/ruff/rules/#flake8-print-t20
86-
"PT", # https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
87-
"Q", # https://docs.astral.sh/ruff/rules/#flake8-quotes-q
88-
"RSE", # https://docs.astral.sh/ruff/rules/#flake8-raise-rse
89-
"RET", # https://docs.astral.sh/ruff/rules/#flake8-return-ret
90-
"SLF", # https://docs.astral.sh/ruff/rules/#flake8-self-slf
91-
"SLOT", # https://docs.astral.sh/ruff/rules/#flake8-slots-slot
92-
"SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
93-
"ARG", # https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
94-
"PTH", # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
95-
"PGH", # https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
96-
"PLC", # https://docs.astral.sh/ruff/rules/#convention-c
97-
"PLE", # https://docs.astral.sh/ruff/rules/#error-e_1
98-
"TRY", # https://docs.astral.sh/ruff/rules/#tryceratops-try
99-
"PERF", # https://docs.astral.sh/ruff/rules/#perflint-perf
100-
"FURB", # https://docs.astral.sh/ruff/rules/#refurb-furb
101-
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
102-
]
103-
fixable = [
104-
"I",
105-
"F401",
106-
"D",
107-
"UP",
108-
"ANN",
109-
"B",
110-
"C4",
111-
"LOG",
112-
"G",
113-
"PIE",
114-
"PT",
115-
"RSE",
116-
"SIM",
117-
"PLC",
118-
"PLE",
119-
"TRY",
120-
"PERF",
121-
"FURB",
122-
"RUF"
123-
]
124-
# ANN003 - missing-type-args
125-
# ANN003 - missing-type-kwargs
126-
# ANN101 - missing-type-self
127-
# ANN102 - missing-type-cls
128-
# D203 - one-blank-line-before-class
129-
# D205 - blank-line-after-summary
130-
# D206 - indent-with-spaces*
131-
# D213 - multi-line-summary-second-line
132-
# D300 - triple-single-quotes*
133-
# D400 - ends-in-period
134-
# D415 - ends-in-punctuation
135-
# E111 - indentation-with-invalid-multiple*
136-
# E114 - indentation-with-invalid-multiple-comment*
137-
# E117 - over-indented*
138-
# E501 - line-too-long*
139-
# W191 - tab-indentation*
140-
# S321 - suspicious-ftp-lib-usage
141-
# PLC0206 - dict-index-missing-items
142-
# *ignored for compatibility with formatter
65+
select = ["ALL"]
14366
ignore = [
144-
"ANN002", "ANN003",
145-
"D203", "D205", "D206", "D213", "D300", "D400", "D415",
146-
"E111", "E114", "E117", "E501",
67+
# unused
68+
"AIR",
69+
"ERA",
70+
"YTT",
71+
"BLE",
72+
"FBT",
73+
"CPY",
74+
"DJ",
75+
"EXE",
76+
"FIX",
77+
"FA",
78+
"PYI",
79+
"TD",
80+
"C90",
81+
"NPY",
82+
"PD",
83+
# ignore for compatibility with formatter
84+
"D206",
85+
"D300",
86+
"W191",
87+
"E111",
88+
"E114",
89+
"E117",
90+
"E501",
14791
"W191",
14892
"S321",
93+
"COM812",
94+
"COM819",
95+
"Q000",
96+
"Q001",
97+
"Q002",
98+
"Q003",
99+
# don't require types on *args, **kwargs
100+
"ANN002",
101+
"ANN003",
102+
# subjective pylint thresholds
103+
"PLR0904",
104+
"PLR091",
105+
"PLR1702",
149106
"PLC0206",
107+
# misc unnecessary stuff
108+
"S321",
109+
"D203",
110+
"D205",
111+
"D213",
112+
"D400",
113+
"D415",
150114
]
151115

152116
[tool.ruff.lint.per-file-ignores]
153117
# ANN001 - missing-type-function-argument
154118
# ANN2 - missing-return-type
155-
# D100 - undocumented-public-module
156-
# D102 - undocumented-public-class
157-
# D103 - undocumented-public-function
158119
# S101 - assert
159120
# B011 - assert-false
160121
# INP001 - implicit-namespace-package
122+
# PLR2004 - magic-value-comparison
161123
"tests/*" = [
162124
"ANN001",
163125
"ANN2",
164-
"D100",
165-
"D102",
166-
"D103",
126+
"D",
167127
"S101",
168128
"B011",
169-
"INP001"
129+
"INP001",
130+
"PLR2004",
170131
]
171132

172133
[tool.ruff.lint.flake8-annotations]

src/agct/converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from wags_tails.utils.downloads import download_http, handle_gzip
1212
from wags_tails.utils.storage import get_data_dir
1313

14-
import agct._core as _core
14+
from agct import _core
1515
from agct.seqref_registry import Assembly
1616

1717
_logger = logging.getLogger(__name__)

tests/test_rust_api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Test some non-public aspects of the Rust layer."""
22

33
import pytest
4-
54
from agct._core import ChainfileError, Converter
65

76

0 commit comments

Comments
 (0)