diff --git a/pyproject.toml b/pyproject.toml index 97284f5a..da3d3abe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] authors = [{name = "Daniel Holth", email = "dholth@fastmail.fm"}] maintainers = [{name = "Alex Grönholm", email = "alex.gronholm@nextday.fi"}] @@ -39,7 +40,7 @@ bdist_wheel = "wheel.bdist_wheel:bdist_wheel" [project.optional-dependencies] test = [ "pytest >= 6.0.0", - "setuptools >= 65" + "setuptools >= 65", ] [tool.flit.sdist] @@ -97,25 +98,27 @@ select = [ "I", # isort "PGH", # pygrep-hooks "UP", # pyupgrade - "B0", # flake8-bugbear + "B", # flake8-bugbear ] src = ["src"] +# Tox (https://tox.wiki/) is a tool for running tests in multiple virtualenvs. +# This configuration file will run the test suite on all supported python +# versions. To use it, "pipx install tox" and then run "tox" from this +# directory. + [tool.tox] legacy_tox_ini = ''' -# Tox (https://tox.wiki/) is a tool for running tests -# in multiple virtualenvs. This configuration file will run the -# test suite on all supported python versions. To use it, "pip install tox" -# and then run "tox" from this directory. - [tox] -envlist = py37, py38, py39, py310, py311, pypy3, lint, pkg +envlist = py37, py38, py39, py310, py311, py312, pypy3, lint, pkg minversion = 4.0.0 skip_missing_interpreters = true [testenv] +package = wheel +wheel_build_env = .pkg depends = lint -commands = {envpython} -b -m pytest {posargs} +commands = {env_python} -b -m pytest {posargs} extras = test set_env = PYTHONWARNDEFAULTENCODING = 1 diff --git a/src/wheel/bdist_wheel.py b/src/wheel/bdist_wheel.py index 604d5d65..2f93c473 100644 --- a/src/wheel/bdist_wheel.py +++ b/src/wheel/bdist_wheel.py @@ -238,7 +238,7 @@ def finalize_options(self): try: self.compression = self.supported_compressions[self.compression] except KeyError: - raise ValueError(f"Unsupported compression: {self.compression}") + raise ValueError(f"Unsupported compression: {self.compression}") from None need_options = ("dist_dir", "plat_name", "skip_build") diff --git a/src/wheel/wheelfile.py b/src/wheel/wheelfile.py index 25129ce4..465ba7bd 100644 --- a/src/wheel/wheelfile.py +++ b/src/wheel/wheelfile.py @@ -62,7 +62,7 @@ def __init__(self, file, mode="r", compression=ZIP_DEFLATED): try: record = self.open(self.record_path) except KeyError: - raise WheelError(f"Missing {self.record_path} file") + raise WheelError(f"Missing {self.record_path} file") from None with record: for line in csv.reader( @@ -76,7 +76,9 @@ def __init__(self, file, mode="r", compression=ZIP_DEFLATED): try: hashlib.new(algorithm) except ValueError: - raise WheelError(f"Unsupported hash algorithm: {algorithm}") + raise WheelError( + f"Unsupported hash algorithm: {algorithm}" + ) from None if algorithm.lower() in {"md5", "sha1"}: raise WheelError(