Skip to content

Commit

Permalink
ruff automatic fixes: from __future__ import annotations
Browse files Browse the repository at this point in the history
```
ruff.....................................................................Failed
- hook id: ruff
- files were modified by this hook

Fixed 44 errors:
- tests/test_class_sh_basic.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_disowning.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_disowning_mi.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_factory_constructors.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_inheritance.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_mi_thunks.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_module_local.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_property.py:
    1 × I002 (missing-required-import)
- tests/test_class_sh_property_non_owning.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_shared_ptr_copy_move.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_trampoline_basic.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_trampoline_self_life_support.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_trampoline_shared_from_this.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_trampoline_shared_ptr_cpp_arg.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_trampoline_unique_ptr.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_unique_ptr_custom_deleter.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_unique_ptr_member.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_class_sh_virtual_py_cpp_mix.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_classh_mock.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_descr_src_loc.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_exc_namespace_visibility.py:
    1 × I002 (missing-required-import)
- tests/test_type_caster_odr_guard_1.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)
- tests/test_type_caster_odr_guard_2.py:
    1 × I001 (unsorted-imports)
    1 × I002 (missing-required-import)

Found 44 errors (44 fixed, 0 remaining).
```
  • Loading branch information
rwgk committed Jun 22, 2024
1 parent 67d6788 commit a8bc5f7
Show file tree
Hide file tree
Showing 23 changed files with 44 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_class_sh_basic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Importing re before pytest after observing a PyPy CI flake when importing pytest first.
from __future__ import annotations

import re

import pytest
Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_disowning.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

from pybind11_tests import class_sh_disowning as m
Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_disowning_mi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

import env # noqa: F401
Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_factory_constructors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

from pybind11_tests import class_sh_factory_constructors as m
Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_inheritance.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from pybind11_tests import class_sh_inheritance as m


Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_mi_thunks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

from pybind11_tests import class_sh_mi_thunks as m
Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_module_local.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import class_sh_module_local_0 as m0
import class_sh_module_local_1 as m1
import class_sh_module_local_2 as m2
Expand Down
1 change: 1 addition & 0 deletions tests/test_class_sh_property.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# The compact 4-character naming scheme (e.g. mptr, cptr, shcp) is explained at the top of
# test_class_sh_property.cpp.
from __future__ import annotations

import pytest

Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_property_non_owning.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

from pybind11_tests import class_sh_property_non_owning as m
Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_shared_ptr_copy_move.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from pybind11_tests import class_sh_shared_ptr_copy_move as m


Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_trampoline_basic.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

from pybind11_tests import class_sh_trampoline_basic as m
Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_trampoline_self_life_support.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

import pybind11_tests.class_sh_trampoline_self_life_support as m
Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_trampoline_shared_from_this.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import sys
import weakref

Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_trampoline_shared_ptr_cpp_arg.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

import pybind11_tests.class_sh_trampoline_shared_ptr_cpp_arg as m
Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_trampoline_unique_ptr.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pybind11_tests.class_sh_trampoline_unique_ptr as m


Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_unique_ptr_custom_deleter.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from pybind11_tests import class_sh_unique_ptr_custom_deleter as m


Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_unique_ptr_member.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

from pybind11_tests import class_sh_unique_ptr_member as m
Expand Down
2 changes: 2 additions & 0 deletions tests/test_class_sh_virtual_py_cpp_mix.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

from pybind11_tests import class_sh_virtual_py_cpp_mix as m
Expand Down
2 changes: 2 additions & 0 deletions tests/test_classh_mock.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from pybind11_tests import classh_mock as m


Expand Down
2 changes: 2 additions & 0 deletions tests/test_descr_src_loc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

from pybind11_tests import descr_src_loc as m
Expand Down
1 change: 1 addition & 0 deletions tests/test_exc_namespace_visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# test_cross_module_exception_translator (test_exceptions.py) failure. This
# test has to be imported (by pytest) before test_exceptions.py; pytest sorts
# lexically. See https://github.com/pybind/pybind11/pull/4054 for more information.
from __future__ import annotations

import itertools

Expand Down
2 changes: 2 additions & 0 deletions tests/test_type_caster_odr_guard_1.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

import pybind11_tests
Expand Down
2 changes: 2 additions & 0 deletions tests/test_type_caster_odr_guard_2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

import pybind11_tests.type_caster_odr_guard_2 as m
Expand Down

0 comments on commit a8bc5f7

Please sign in to comment.