Skip to content

Commit

Permalink
Move to action to share code
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <[email protected]>
  • Loading branch information
gaborbernat committed Oct 24, 2024
1 parent 399510c commit 7ff742f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 310 deletions.
25 changes: 3 additions & 22 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,13 @@ jobs:
strategy:
fail-fast: false
matrix:
env:
python:
- "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- type
- dev
steps:
- uses: actions/checkout@v4
- uses: tox-dev/action-pre-commit-mirrorer/check@main
with:
fetch-depth: 0
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Install tox
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
- name: Install Python
if: startsWith(matrix.env, '3.') && matrix.env != '3.13'
run: uv python install --python-preference only-managed ${{ matrix.env }}
- name: Setup test suite
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.env }}
- name: Run test suite
run: tox run --skip-pkg-install -e ${{ matrix.env }}
env:
PYTEST_ADDOPTS: "-vv --durations=20"
DIFF_AGAINST: HEAD
python: "${{ matrix.python }}"
13 changes: 3 additions & 10 deletions .github/workflows/mirror.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,7 @@ jobs:
name: mirror
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tox-dev/action-pre-commit-mirrorer/mirror@main
with:
fetch-depth: 0
token: ${{ secrets.PA_TOKEN }}
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Run mirroring
run: uv run tasks/mirror.py '${{ github.ref == 'refs/heads/main' }}'
project: "pyproject-fmt"
token: "${{ secrets.PA_TOKEN }}"
103 changes: 0 additions & 103 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,108 +36,5 @@ dependencies = [
[tool.hatch]
build.targets.wheel.bypass-selection = true

[tool.ruff]
line-length = 120
format.preview = true
format.docstring-code-line-length = 100
format.docstring-code-format = true
lint.select = [
"ALL",
]
lint.ignore = [
"ANN101", # no type annotation for self
"ANN401", # allow Any as type annotation
"COM812", # Conflict with formatter
"CPY", # No copyright statements
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
"DOC", # not supported
"DOC501", # not working with Sphinx
"ISC001", # Conflict with formatter
"S104", # Possible binding to all interfaces
]
lint.per-file-ignores."tasks/**/*.py" = [
"D", # don't care about documentation in tsask files
"INP001", # not a package
"S", # no security concerns in mirror
"T201", # prints are alloowed
]
lint.per-file-ignores."tests/**/*.py" = [
"D", # don't care about documentation in tests
"FBT", # don't care about booleans as positional arguments in tests
"INP001", # no implicit namespace
"PLC2701", # private import
"PLR0913", # any number of arguments in tests
"PLR0917", # any number of arguments in tests
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
"S", # no security concerns in tests
]
lint.isort = { known-first-party = [ ], required-imports = [
"from __future__ import annotations",
] }
lint.preview = true

[tool.codespell]
builtin = "clear,usage,en-GB_to_en-US"
count = true

[tool.pyproject-fmt]
max_supported_python = "3.13"

[tool.pytest]
ini_options.testpaths = [
"tests",
]
ini_options.verbosity_assertions = 2

[tool.coverage]
html.show_contexts = true
html.skip_covered = false
paths.source = [
"src",
".tox/*/.venv/lib/*/site-packages",
".tox\\*\\.venv\\Lib\\site-packages",
".tox/*/lib/*/site-packages",
".tox\\*\\Lib\\site-packages",
"**/src",
"**\\src",
]
report.fail_under = 100
run.parallel = true
run.plugins = [
"covdefaults",
]
covdefaults.subtract_omit = "*/__main__.py"

[tool.mypy]
show_error_codes = true
strict = true

[dependency-groups]
dev = [
{ include-group = "tasks" },
{ include-group = "test" },
{ include-group = "type" },
]
fix = [
"pre-commit-uv>=4.1.3",
]
tasks = [
"gitpython>=3.1.43",
"httpx>=0.27.2",
"packaging>=24.1",
]
test = [
"covdefaults>=2.3",
"pygments>=2.18",
"pytest>=8.3.2",
"pytest-cov>=5",
{ include-group = "fix" },
]
type = [
"mypy==1.11.2",
"types-cachetools>=5.5.0.20240820",
"types-chardet>=5.0.4.6",
{ include-group = "test" },
{ include-group = "tasks" },
]
56 changes: 0 additions & 56 deletions tasks/mirror.py

This file was deleted.

64 changes: 0 additions & 64 deletions tests/test_mirror.py

This file was deleted.

55 changes: 0 additions & 55 deletions tox.toml

This file was deleted.

0 comments on commit 7ff742f

Please sign in to comment.