From 9ac29eb8341cfcd878ea55d01e4007e74e334e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Fri, 29 Nov 2024 16:13:02 +0100 Subject: [PATCH] TST: add support for Python's optimized mode --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ CHANGELOG.md | 4 ++++ pyproject.toml | 1 + 3 files changed, 25 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4a7ca9e..7e467f9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,6 +152,26 @@ jobs: - name: Run mypy run: uv run mypy src/inifix + optimized_python: + runs-on: ubuntu-latest + name: optimized Python + + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-optimized + cancel-in-progress: true + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + + - uses: astral-sh/setup-uv@d8db0a86d3d88f3017a4e6b8a1e2b234e7a0a1b5 # v4.0.0 + - name: Build + run: uv sync -p 3.13 --group test --no-editable + - name: Run pytest with PYTHONOPTIMIZE=2 + run: uv run --no-project pytest --color=yes --doctest-modules + env: + PYTHONOPTIMIZE: 2 check-readme: runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 5118f0c3..3e581556 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +- TST: add support for Python's optimized mode + ## [5.0.3] - 2024-10-25 - TST: validate inifix's pre-commit hooks continuously diff --git a/pyproject.toml b/pyproject.toml index 9b514c63..77454fcf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,5 +111,6 @@ ignore_errors = true minversion = "6.0" filterwarnings = [ "error", + "ignore:assertions not in test modules or plugins will be ignored:UserWarning", ] addopts = "-ra"