Skip to content

Commit 9fd929f

Browse files
authored
chore: some touchups & 3.12 classifier (#539)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent f2af601 commit 9fd929f

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

pyproject.toml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ classifiers = [
1818
"Programming Language :: Python :: 3.9",
1919
"Programming Language :: Python :: 3.10",
2020
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
2122
]
2223
authors = [{name = "Daniel Holth", email = "dholth@fastmail.fm"}]
2324
maintainers = [{name = "Alex Grönholm", email = "alex.gronholm@nextday.fi"}]
@@ -39,7 +40,7 @@ bdist_wheel = "wheel.bdist_wheel:bdist_wheel"
3940
[project.optional-dependencies]
4041
test = [
4142
"pytest >= 6.0.0",
42-
"setuptools >= 65"
43+
"setuptools >= 65",
4344
]
4445

4546
[tool.flit.sdist]
@@ -97,25 +98,27 @@ select = [
9798
"I", # isort
9899
"PGH", # pygrep-hooks
99100
"UP", # pyupgrade
100-
"B0", # flake8-bugbear
101+
"B", # flake8-bugbear
101102
]
102103
src = ["src"]
103104

105+
# Tox (https://tox.wiki/) is a tool for running tests in multiple virtualenvs.
106+
# This configuration file will run the test suite on all supported python
107+
# versions. To use it, "pipx install tox" and then run "tox" from this
108+
# directory.
109+
104110
[tool.tox]
105111
legacy_tox_ini = '''
106-
# Tox (https://tox.wiki/) is a tool for running tests
107-
# in multiple virtualenvs. This configuration file will run the
108-
# test suite on all supported python versions. To use it, "pip install tox"
109-
# and then run "tox" from this directory.
110-
111112
[tox]
112-
envlist = py37, py38, py39, py310, py311, pypy3, lint, pkg
113+
envlist = py37, py38, py39, py310, py311, py312, pypy3, lint, pkg
113114
minversion = 4.0.0
114115
skip_missing_interpreters = true
115116
116117
[testenv]
118+
package = wheel
119+
wheel_build_env = .pkg
117120
depends = lint
118-
commands = {envpython} -b -m pytest {posargs}
121+
commands = {env_python} -b -m pytest {posargs}
119122
extras = test
120123
set_env =
121124
PYTHONWARNDEFAULTENCODING = 1

src/wheel/bdist_wheel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def finalize_options(self):
238238
try:
239239
self.compression = self.supported_compressions[self.compression]
240240
except KeyError:
241-
raise ValueError(f"Unsupported compression: {self.compression}")
241+
raise ValueError(f"Unsupported compression: {self.compression}") from None
242242

243243
need_options = ("dist_dir", "plat_name", "skip_build")
244244

src/wheel/wheelfile.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(self, file, mode="r", compression=ZIP_DEFLATED):
6262
try:
6363
record = self.open(self.record_path)
6464
except KeyError:
65-
raise WheelError(f"Missing {self.record_path} file")
65+
raise WheelError(f"Missing {self.record_path} file") from None
6666

6767
with record:
6868
for line in csv.reader(
@@ -76,7 +76,9 @@ def __init__(self, file, mode="r", compression=ZIP_DEFLATED):
7676
try:
7777
hashlib.new(algorithm)
7878
except ValueError:
79-
raise WheelError(f"Unsupported hash algorithm: {algorithm}")
79+
raise WheelError(
80+
f"Unsupported hash algorithm: {algorithm}"
81+
) from None
8082

8183
if algorithm.lower() in {"md5", "sha1"}:
8284
raise WheelError(

0 commit comments

Comments
 (0)