Skip to content

Commit 25e843c

Browse files
committed
refactor: only run mypy through pre-commit
- Explicit trusted publishing for uv - Run pre-commit through uv backend
1 parent d9c68ae commit 25e843c

File tree

4 files changed

+15
-22
lines changed

4 files changed

+15
-22
lines changed

.github/workflows/release-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ jobs:
2828
run: uv build
2929

3030
- name: Publish package
31-
run: uv publish
31+
run: uv publish --trusted-publishing=always

.pre-commit-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ repos:
2424
- id: pretty-format-toml
2525
args: [--autofix]
2626
- repo: https://github.com/pre-commit/mirrors-mypy
27-
rev: v1.13.0
27+
rev: v1.18.1
2828
hooks:
2929
- id: mypy
30-
additional_dependencies: [types-certifi]

python/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ nosetests.xml
5353
/include
5454
/share
5555
/local
56+
.venv/
5657

5758
.mypy_cache/
5859
.ruff_cache/

python/pyproject.toml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,13 @@ maintainers = [
3535
name = "cucumber-messages"
3636
readme = "README.md"
3737
requires-python = ">=3.9"
38-
urls = {Repository = "https://github.com/cucumber/messages"}
3938
version = "29.0.1"
4039

4140
[project.optional-dependencies]
4241
test = [
4342
# local
4443
"cucumber-messages[test-coverage]",
4544
# external; Must be in sync with [tool.tox]
46-
"mypy",
47-
"pre-commit",
4845
"tox>=4.2"
4946
]
5047
test-coverage = [
@@ -54,6 +51,13 @@ test-coverage = [
5451
"pytest"
5552
]
5653

54+
[project.urls]
55+
Changelog = "https://github.com/cucumber/messages/releases"
56+
Download = "https://pypi.org/project/cucumber-messages"
57+
Homepage = "https://github.com/cucumber/messages"
58+
Issues = "https://github.com/cucumber/messages/issues"
59+
Repository = "https://github.com/cucumber/messages.git"
60+
5761
[tool.mypy]
5862
files = "src/**/*.py"
5963
install_types = true
@@ -92,8 +96,7 @@ legacy_tox_ini = """
9296
requires =
9397
tox>=4.2
9498
env_list =
95-
py313-pre-commit-lin
96-
py{313, 312, 311, 310, 39}-mypy-lin
99+
py{313, 312, 311, 310, 39}-lint-lin
97100
py{py310, py39, 313, 312, 311, 310, 39}-pytest-coverage-lin
98101
py313-pytest-coverage-{win, mac}
99102
distshare = {homedir}/.tox/distshare
@@ -104,23 +107,13 @@ platform =
104107
mac: darwin
105108
win: win32
106109
107-
[testenv:py313-pre-commit-lin]
110+
[testenv:py{313, 312, 311, 310, 39}-lint-lin]
108111
skip_install = true
112+
description = run code formatter and linter (auto-fix)
109113
deps =
110-
pre-commit
111-
commands =
112-
pre-commit run
113-
114-
[testenv:py{313, 312, 311, 310, 39}-mypy-lin]
115-
deps =
116-
mypy
117-
allowlist_externals =
118-
mkdir
119-
chmod
114+
pre-commit-uv>=4.1.1
120115
commands =
121-
mkdir .mypy_cache
122-
chmod 755 .mypy_cache
123-
python -m mypy --cache-dir .mypy_cache
116+
pre-commit run --all-files --show-diff-on-failure
124117
125118
[testenv:py{py310, py39, 313, 312, 311, 310, 39}-pytest-coverage-{lin, win, mac}]
126119
deps =

0 commit comments

Comments
 (0)