From b50253727a1f917ec4ec86e49016bfc817a587c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 27 Oct 2023 23:38:41 +0200 Subject: [PATCH 1/2] Test with python 3.12 --- .github/workflows/ci.yml | 4 +++- pyproject.toml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72479e7..5229418 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,8 @@ on: push: branches: - main + tags: + - "[0-9]+.[0-9]+(.[0-9]+)?" pull_request: branches: - main @@ -24,7 +26,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11.0-alpha.7 - 3.11"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/pyproject.toml b/pyproject.toml index 1ee44ee..1f4ff15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,8 @@ classifiers = [ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Framework :: Hatch", "Framework :: Odoo", ] @@ -61,7 +63,7 @@ cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src/ha no-cov = "cov --no-cov" [[tool.hatch.envs.test.matrix]] -python = ["37", "38", "39", "310"] +python = ["37", "38", "39", "310", "311", "312"] [tool.coverage.run] branch = true From 26a0cea8126301f48a33847ac3ef941c7156499f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 27 Oct 2023 23:41:15 +0200 Subject: [PATCH 2/2] Use ruff --- .pre-commit-config.yaml | 39 +++++++-------------------------------- pyproject.toml | 9 +++++++-- 2 files changed, 14 insertions(+), 34 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e30060a..0d6b570 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,42 +1,17 @@ default_language_version: python: python3 repos: - - repo: https://github.com/psf/black - rev: 23.1.0 - hooks: - - id: black - - repo: https://github.com/PyCQA/autoflake - rev: v2.0.1 - hooks: - - id: autoflake - args: - - --in-place - - --ignore-init-module-imports - - --remove-all-unused-imports - - --remove-duplicate-keys - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-toml - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - - repo: https://github.com/PyCQA/flake8 - rev: "6.0.0" - hooks: - - id: flake8 - additional_dependencies: ["flake8-bugbear==22.8.23"] - - repo: https://github.com/PyCQA/isort - rev: 5.12.0 - hooks: - - id: isort - - repo: https://github.com/PyCQA/docformatter - rev: v1.5.1 - hooks: - - id: docformatter - args: ["--in-place", "--wrap-summaries=88"] - - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 + - repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.1.3 hooks: - - id: pyupgrade - args: ["--py36-plus"] + - id: ruff + args: [ --fix, --exit-non-zero-on-fix ] + - id: ruff-format diff --git a/pyproject.toml b/pyproject.toml index 1f4ff15..712a4ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,5 +77,10 @@ exclude_lines = [ "if TYPE_CHECKING:", ] -[tool.isort] -profile = "black" +# ruff + +[tool.ruff.lint] +extend-select = [ + "UP", # pyupgrade + "I", # isort +]