From d7c95baecbd0bef38092f8ab93d3462055df909f Mon Sep 17 00:00:00 2001 From: Noelle Leigh <5957867+noelleleigh@users.noreply.github.com> Date: Sat, 23 Nov 2024 10:15:09 -0500 Subject: [PATCH] Fix linting and testing errors (#272) - Fixes Black formatting and import order in `django-stubs/db/transaction.pyi`. - ~~Fixes expected Pyright error messages in `tests/pyright/test_arrays.py` and `tests/pyright/test_fields.py`.~~ Edit: With Python pinned to 3.8.18, these message changes are no longer necessary. These changes allow `./s/lint` to run successfully on my machine. --- .github/workflows/test.yml | 1 - .python-version | 2 +- django-stubs/db/transaction.pyi | 5 +++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 19b93e64c..344c8d66a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,6 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.8" cache: "poetry" - name: Use Node.js diff --git a/.python-version b/.python-version index 143c2f5d0..9ad6380c1 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.8.19 +3.8.18 diff --git a/django-stubs/db/transaction.pyi b/django-stubs/db/transaction.pyi index 1d7adb72f..d5f0bd23a 100644 --- a/django-stubs/db/transaction.pyi +++ b/django-stubs/db/transaction.pyi @@ -1,8 +1,8 @@ from collections.abc import Callable, Iterator from contextlib import contextmanager +from types import TracebackType from typing import Any, TypeVar, overload -from types import TracebackType from django.db import ProgrammingError class TransactionManagementError(ProgrammingError): ... @@ -40,8 +40,9 @@ class Atomic: self, exc_type: type[BaseException] | None, exc_value: BaseException | None, - traceback: TracebackType | None, / + traceback: TracebackType | None, ) -> None: ... + # Bare decorator @overload def atomic(using: _C) -> _C: ...