Skip to content

Commit

Permalink
chore: some touchups & 3.12 classifier (#539)
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Jul 3, 2023
1 parent f2af601 commit 9fd929f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
21 changes: 12 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}]
Expand All @@ -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]
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/wheel/bdist_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
6 changes: 4 additions & 2 deletions src/wheel/wheelfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit 9fd929f

Please sign in to comment.