Skip to content

Commit 7ff742f

Browse files
committed
Move to action to share code
Signed-off-by: Bernát Gábor <[email protected]>
1 parent 399510c commit 7ff742f

File tree

6 files changed

+6
-310
lines changed

6 files changed

+6
-310
lines changed

Diff for: .github/workflows/check.yaml

+3-22
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,13 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
env:
20+
python:
2121
- "3.13"
2222
- "3.12"
2323
- "3.11"
2424
- "3.10"
2525
- "3.9"
26-
- type
27-
- dev
2826
steps:
29-
- uses: actions/checkout@v4
27+
- uses: tox-dev/action-pre-commit-mirrorer/check@main
3028
with:
31-
fetch-depth: 0
32-
- name: Install the latest version of uv
33-
uses: astral-sh/setup-uv@v3
34-
with:
35-
enable-cache: true
36-
cache-dependency-glob: "pyproject.toml"
37-
- name: Install tox
38-
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
39-
- name: Install Python
40-
if: startsWith(matrix.env, '3.') && matrix.env != '3.13'
41-
run: uv python install --python-preference only-managed ${{ matrix.env }}
42-
- name: Setup test suite
43-
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.env }}
44-
- name: Run test suite
45-
run: tox run --skip-pkg-install -e ${{ matrix.env }}
46-
env:
47-
PYTEST_ADDOPTS: "-vv --durations=20"
48-
DIFF_AGAINST: HEAD
29+
python: "${{ matrix.python }}"

Diff for: .github/workflows/mirror.yaml

+3-10
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,7 @@ jobs:
1919
name: mirror
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: tox-dev/action-pre-commit-mirrorer/mirror@main
2323
with:
24-
fetch-depth: 0
25-
token: ${{ secrets.PA_TOKEN }}
26-
- name: Install the latest version of uv
27-
uses: astral-sh/setup-uv@v3
28-
with:
29-
enable-cache: true
30-
cache-dependency-glob: "pyproject.toml"
31-
- name: Run mirroring
32-
run: uv run tasks/mirror.py '${{ github.ref == 'refs/heads/main' }}'
24+
project: "pyproject-fmt"
25+
token: "${{ secrets.PA_TOKEN }}"

Diff for: pyproject.toml

-103
Original file line numberDiff line numberDiff line change
@@ -36,108 +36,5 @@ dependencies = [
3636
[tool.hatch]
3737
build.targets.wheel.bypass-selection = true
3838

39-
[tool.ruff]
40-
line-length = 120
41-
format.preview = true
42-
format.docstring-code-line-length = 100
43-
format.docstring-code-format = true
44-
lint.select = [
45-
"ALL",
46-
]
47-
lint.ignore = [
48-
"ANN101", # no type annotation for self
49-
"ANN401", # allow Any as type annotation
50-
"COM812", # Conflict with formatter
51-
"CPY", # No copyright statements
52-
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
53-
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
54-
"DOC", # not supported
55-
"DOC501", # not working with Sphinx
56-
"ISC001", # Conflict with formatter
57-
"S104", # Possible binding to all interfaces
58-
]
59-
lint.per-file-ignores."tasks/**/*.py" = [
60-
"D", # don't care about documentation in tsask files
61-
"INP001", # not a package
62-
"S", # no security concerns in mirror
63-
"T201", # prints are alloowed
64-
]
65-
lint.per-file-ignores."tests/**/*.py" = [
66-
"D", # don't care about documentation in tests
67-
"FBT", # don't care about booleans as positional arguments in tests
68-
"INP001", # no implicit namespace
69-
"PLC2701", # private import
70-
"PLR0913", # any number of arguments in tests
71-
"PLR0917", # any number of arguments in tests
72-
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
73-
"S", # no security concerns in tests
74-
]
75-
lint.isort = { known-first-party = [ ], required-imports = [
76-
"from __future__ import annotations",
77-
] }
78-
lint.preview = true
79-
80-
[tool.codespell]
81-
builtin = "clear,usage,en-GB_to_en-US"
82-
count = true
83-
8439
[tool.pyproject-fmt]
8540
max_supported_python = "3.13"
86-
87-
[tool.pytest]
88-
ini_options.testpaths = [
89-
"tests",
90-
]
91-
ini_options.verbosity_assertions = 2
92-
93-
[tool.coverage]
94-
html.show_contexts = true
95-
html.skip_covered = false
96-
paths.source = [
97-
"src",
98-
".tox/*/.venv/lib/*/site-packages",
99-
".tox\\*\\.venv\\Lib\\site-packages",
100-
".tox/*/lib/*/site-packages",
101-
".tox\\*\\Lib\\site-packages",
102-
"**/src",
103-
"**\\src",
104-
]
105-
report.fail_under = 100
106-
run.parallel = true
107-
run.plugins = [
108-
"covdefaults",
109-
]
110-
covdefaults.subtract_omit = "*/__main__.py"
111-
112-
[tool.mypy]
113-
show_error_codes = true
114-
strict = true
115-
116-
[dependency-groups]
117-
dev = [
118-
{ include-group = "tasks" },
119-
{ include-group = "test" },
120-
{ include-group = "type" },
121-
]
122-
fix = [
123-
"pre-commit-uv>=4.1.3",
124-
]
125-
tasks = [
126-
"gitpython>=3.1.43",
127-
"httpx>=0.27.2",
128-
"packaging>=24.1",
129-
]
130-
test = [
131-
"covdefaults>=2.3",
132-
"pygments>=2.18",
133-
"pytest>=8.3.2",
134-
"pytest-cov>=5",
135-
{ include-group = "fix" },
136-
]
137-
type = [
138-
"mypy==1.11.2",
139-
"types-cachetools>=5.5.0.20240820",
140-
"types-chardet>=5.0.4.6",
141-
{ include-group = "test" },
142-
{ include-group = "tasks" },
143-
]

Diff for: tasks/mirror.py

-56
This file was deleted.

Diff for: tests/test_mirror.py

-64
This file was deleted.

Diff for: tox.toml

-55
This file was deleted.

0 commit comments

Comments
 (0)