Skip to content

Commit

Permalink
build: consolidate config & use tox-uv runners
Browse files Browse the repository at this point in the history
  • Loading branch information
boidolr committed Dec 12, 2024
1 parent 2250070 commit 89a499f
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 57 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,16 @@ jobs:
- name: Install Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install tox
run: uv tool install tox --with tox-uv

- name: Execute tests
run: uv tool run tox -e ${{ matrix.python-version }}
run: tox --runner virtualenv -e ${{ matrix.python-version }}

precommit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: boidolr/actions/run-precommit@main
env:
UV_PYTHON: "3.13"
92 changes: 54 additions & 38 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ build-backend = "setuptools.build_meta"
name = "pre_commit_text"
description = "Some text hooks for pre-commit."
authors = [
{ name="Raphael Boidol", email="boidolr@users.noreply.github.com" },
{ name = "Raphael Boidol", email = "boidolr@users.noreply.github.com" },
]
urls = {"Respository" = "https://github.com/boidolr/pre-commit-text"}
license = {file = "LICENSE"}
urls = { "Respository" = "https://github.com/boidolr/pre-commit-text" }
license = { file = "LICENSE" }
readme = "README.md"
version = "1.2.17"
classifiers = [
Expand All @@ -20,23 +20,11 @@ classifiers = [
]

requires-python = ">=3.10,<4"
dependencies = [
"ruamel.yaml==0.18.6",
]
dependencies = ["ruamel.yaml==0.18.6"]

[project.optional-dependencies]
dev = [
"pre-commit",
"ruff",
"tox",
"tox-uv",
]
tests = [
"pytest",
"pytest-clarity",
"pytest-ruff",
"pytest-mypy",
]
dev = ["pre-commit", "ruff", "tox", "tox-uv"]
tests = ["pytest", "pytest-clarity", "pytest-ruff", "pytest-mypy"]

[project.scripts]
format-yaml = "pre_commit_text.format_yaml:main"
Expand All @@ -52,24 +40,25 @@ fix = true

[tool.ruff.lint]
select = [
"F", # Pyflakes
"E", "W", # Pycodestyle
"UP", # pyupgrade
"FURB", # refurb
"S", # flake8-bandit
"C4", # flake8-comprehensions
"G", # flake8-logging-format
"ANN", # flake8-annotations
"F", # Pyflakes
"E",
"W", # Pycodestyle
"UP", # pyupgrade
"FURB", # refurb
"S", # flake8-bandit
"C4", # flake8-comprehensions
"G", # flake8-logging-format
"ANN", # flake8-annotations
# "ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"PT", # flake8-pytest-style
"RET", # flake8-return
"PTH", # flake8-use-pathlib
"TID252", # flake8-tidy-imports (relative-imports)
"PERF", # Perflint
"FLY", # flynt
"I", # isort
"RUF100" # Unneeded noqa
"SIM", # flake8-simplify
"PT", # flake8-pytest-style
"RET", # flake8-return
"PTH", # flake8-use-pathlib
"TID252", # flake8-tidy-imports (relative-imports)
"PERF", # Perflint
"FLY", # flynt
"I", # isort
"RUF100", # Unneeded noqa
]

[tool.ruff.lint.per-file-ignores]
Expand All @@ -92,10 +81,37 @@ ignore_missing_imports = true

[tool.pytest.ini_options]
addopts = "--mypy --ruff"
filterwarnings = [
"error",
]
filterwarnings = ["error"]

[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false

[tool.tox]
requires = ["tox>=4.19"]
envlist = ["py310", "py311", "py312", "py313", "pre-commit"]
isolated_build = true

[tool.tox.env_run_base]
description = "Run test under {base_python}"
commands = [
[
"pytest",
{ replace = "posargs", default = [
"tests",
], extend = true },
],
]
extras = ["tests", "svg", "avif"]
runner = "uv-venv-lock-runner"
uv_sync_flags = ["--python={env_python}", "--no-editable"]

[tool.tox.env.pre-commit]
description = "run commit hooks on code base"
skip_install = true
deps = ["pre-commit"]
commands = [["pre-commit", "run", "--all-files"]]
runner = "virtualenv"

[tool.tox.env.static]
commands = [["pytest", "--ignore", "tests"]]
18 changes: 0 additions & 18 deletions tox.ini

This file was deleted.

0 comments on commit 89a499f

Please sign in to comment.