Skip to content

Commit 5c43cf5

Browse files
committed
Drop support for Python 3.8.
1 parent 746709e commit 5c43cf5

File tree

5 files changed

+4
-37
lines changed

5 files changed

+4
-37
lines changed

.github/workflows/main.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ jobs:
1212
strategy:
1313
matrix:
1414
python-version:
15-
- '3.8'
1615
- '3.9'
1716
- '3.10'
1817
- '3.11'
1918
- '3.12'
20-
- 'pypy-3.8'
19+
- '3.13'
2120
- 'pypy-3.9'
2221
- 'pypy-3.10'
2322
# this version range needs to be synchronized with the one in pyproject.toml

amaranth_soc/csr/bus.py

-7
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ class Signature(wiring.Signature):
5353
def __init__(self, width, access):
5454
if not isinstance(width, int) or width < 0:
5555
raise TypeError(f"Width must be a non-negative integer, not {width!r}")
56-
# TODO(py3.9): Remove this. Python 3.8 and below use cls.__name__ in the error message
57-
# instead of cls.__qualname__.
58-
# Element.Access(access)
59-
try:
60-
Element.Access(access)
61-
except ValueError as e:
62-
raise ValueError(f"{access!r} is not a valid Element.Access") from e
6356

6457
self._width = width
6558
self._access = Element.Access(access)

amaranth_soc/csr/reg.py

+2-19
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@ class Signature(wiring.Signature):
5656
def __init__(self, shape, access):
5757
if not isinstance(shape, ShapeLike):
5858
raise TypeError(f"Field shape must be a shape-like object, not {shape!r}")
59-
# TODO(py3.9): Remove this. Python 3.8 and below use cls.__name__ in the error message
60-
# instead of cls.__qualname__.
61-
# FieldPort.Access(access)
62-
try:
63-
FieldPort.Access(access)
64-
except ValueError as e:
65-
raise ValueError(f"{access!r} is not a valid FieldPort.Access") from e
6659

6760
self._shape = Shape.cast(shape)
6861
self._access = FieldPort.Access(access)
@@ -461,13 +454,7 @@ class Register(wiring.Component):
461454

462455
def __init_subclass__(cls, *, access=None, **kwargs):
463456
if access is not None:
464-
# TODO(py3.9): Remove this. Python 3.8 and below use cls.__name__ in the error message
465-
# instead of cls.__qualname__.
466-
# cls._access = Element.Access(access)
467-
try:
468-
cls._access = Element.Access(access)
469-
except ValueError as e:
470-
raise ValueError(f"{access!r} is not a valid Element.Access") from e
457+
cls._access = Element.Access(access)
471458
cls.__doc__ = cls._doc_template.format(parameters="")
472459
super().__init_subclass__(**kwargs)
473460

@@ -493,11 +480,7 @@ def filter_fields(src):
493480
f"field annotations: {', '.join(annot_fields)}")
494481

495482
if access is not None:
496-
# TODO(py3.9): Remove this (see above).
497-
try:
498-
access = Element.Access(access)
499-
except ValueError as e:
500-
raise ValueError(f"{access!r} is not a valid Element.Access") from e
483+
access = Element.Access(access)
501484
if hasattr(self, "_access") and access != self._access:
502485
raise ValueError(f"Element access mode {access} conflicts with the value "
503486
f"provided during class creation: {self._access}")

amaranth_soc/event.py

-8
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ class Signature(wiring.Signature):
2929
Event trigger. Asserted when an event occurs, according to the trigger mode.
3030
"""
3131
def __init__(self, *, trigger="level"):
32-
# TODO(py3.9): Remove this. Python 3.8 and below use cls.__name__ in the error message
33-
# instead of cls.__qualname__.
34-
# Source.Trigger(trigger)
35-
try:
36-
Source.Trigger(trigger)
37-
except ValueError as e:
38-
raise ValueError(f"{trigger!r} is not a valid Source.Trigger") from e
39-
4032
super().__init__({
4133
"i": Out(1),
4234
"trg": In(1),

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description = "System on Chip toolkit for Amaranth HDL"
1111
authors = [{name = "Amaranth HDL contributors"}]
1212
license = {file = "LICENSE.txt"}
1313

14-
requires-python = "~=3.8"
14+
requires-python = "~=3.9"
1515
dependencies = [
1616
# this version requirement needs to be synchronized with the one in .github/workflows/main.yml
1717
"amaranth>=0.5,<0.6",

0 commit comments

Comments
 (0)