Skip to content

Commit bc1bcf7

Browse files
authored
chore: 3.12 + cleanup (#4713)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 8493228 commit bc1bcf7

File tree

6 files changed

+19
-13
lines changed

6 files changed

+19
-13
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- '3.9'
3737
- '3.10'
3838
- '3.11'
39+
- '3.12'
3940
- 'pypy-3.7'
4041
- 'pypy-3.8'
4142
- 'pypy-3.9'
@@ -74,6 +75,7 @@ jobs:
7475
uses: actions/setup-python@v4
7576
with:
7677
python-version: ${{ matrix.python }}
78+
allow-prereleases: true
7779

7880
- name: Setup Boost (Linux)
7981
# Can't use boost + define _

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ repos:
5454
- markdown-it-py<3 # Drop this together with dropping Python 3.7 support.
5555
- nox
5656
- rich
57+
- types-setuptools
5758

5859
# CMake formatting
5960
- repo: https://github.com/cheshirekow/cmake-format-precommit

pybind11/setup_helpers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
from setuptools import Extension as _Extension
6767
from setuptools.command.build_ext import build_ext as _build_ext
6868
except ImportError:
69-
from distutils.command.build_ext import build_ext as _build_ext
70-
from distutils.extension import Extension as _Extension
69+
from distutils.command.build_ext import build_ext as _build_ext # type: ignore[assignment]
70+
from distutils.extension import Extension as _Extension # type: ignore[assignment]
7171

7272
import distutils.ccompiler
7373
import distutils.errors
@@ -84,7 +84,7 @@
8484
# directory into your path if it sits beside your setup.py.
8585

8686

87-
class Pybind11Extension(_Extension): # type: ignore[misc]
87+
class Pybind11Extension(_Extension):
8888
"""
8989
Build a C++11+ Extension module with pybind11. This automatically adds the
9090
recommended flags when you init the extension and assumes C++ sources - you
@@ -266,7 +266,7 @@ def auto_cpp_level(compiler: Any) -> Union[str, int]:
266266
raise RuntimeError(msg)
267267

268268

269-
class build_ext(_build_ext): # type: ignore[misc] # noqa: N801
269+
class build_ext(_build_ext): # noqa: N801
270270
"""
271271
Customized build_ext that allows an auto-search for the highest supported
272272
C++ level for Pybind11Extension. This is only needed for the auto-search

pyproject.toml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
requires = ["setuptools>=42", "cmake>=3.18", "ninja"]
33
build-backend = "setuptools.build_meta"
44

5+
56
[tool.check-manifest]
67
ignore = [
78
"tests/**",
@@ -15,6 +16,7 @@ ignore = [
1516
"noxfile.py",
1617
]
1718

19+
1820
[tool.mypy]
1921
files = ["pybind11"]
2022
python_version = "3.6"
@@ -24,7 +26,7 @@ enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
2426
warn_unreachable = true
2527

2628
[[tool.mypy.overrides]]
27-
module = ["ghapi.*", "setuptools.*"]
29+
module = ["ghapi.*"]
2830
ignore_missing_imports = true
2931

3032

@@ -55,10 +57,11 @@ messages_control.disable = [
5557
"unused-argument", # covered by Ruff ARG
5658
]
5759

60+
5861
[tool.ruff]
5962
select = [
6063
"E", "F", "W", # flake8
61-
"B", "B904", # flake8-bugbear
64+
"B", # flake8-bugbear
6265
"I", # isort
6366
"N", # pep8-naming
6467
"ARG", # flake8-unused-arguments
@@ -77,14 +80,13 @@ select = [
7780
"YTT", # flake8-2020
7881
]
7982
ignore = [
80-
"PLR", # Design related pylint
81-
"E501", # Line too long (Black is enough)
82-
"PT011", # Too broad with raises in pytest
83-
"PT004", # Fixture that doesn't return needs underscore (no, it is fine)
84-
"SIM118",# iter(x) is not always the same as iter(x.keys())
83+
"PLR", # Design related pylint
84+
"E501", # Line too long (Black is enough)
85+
"PT011", # Too broad with raises in pytest
86+
"PT004", # Fixture that doesn't return needs underscore (no, it is fine)
87+
"SIM118", # iter(x) is not always the same as iter(x.keys())
8588
]
8689
target-version = "py37"
87-
typing-modules = ["scikit_build_core._compat.typing"]
8890
src = ["src"]
8991
unfixable = ["T20"]
9092
exclude = []

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ classifiers =
2020
Programming Language :: Python :: 3.9
2121
Programming Language :: Python :: 3.10
2222
Programming Language :: Python :: 3.11
23+
Programming Language :: Python :: 3.12
2324
License :: OSI Approved :: BSD License
2425
Programming Language :: Python :: Implementation :: PyPy
2526
Programming Language :: Python :: Implementation :: CPython

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def get_and_replace(
9696

9797
# Use our input files instead when making the SDist (and anything that depends
9898
# on it, like a wheel)
99-
class SDist(setuptools.command.sdist.sdist): # type: ignore[misc]
99+
class SDist(setuptools.command.sdist.sdist):
100100
def make_release_tree(self, base_dir: str, files: List[str]) -> None:
101101
super().make_release_tree(base_dir, files)
102102

0 commit comments

Comments
 (0)