Skip to content

Commit c9a7b10

Browse files
authored
Run all tests with Python 3.14 by default. Remove Python 3.9 support because it has reached end-of-life. (UCSBarchlab#478)
Apply some lint fixes that are possible now that we no longer support Python 3.9.
1 parent 1c06c9e commit c9a7b10

21 files changed

Lines changed: 235 additions & 464 deletions

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.13
1+
3.14

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tests:
1111

1212
# Run `pytest` in an isolated virtual environment, with the earliest
1313
# version of Python supported by PyRTL.
14-
uv run --python=3.9 --isolated pytest -n auto
14+
uv run --python=3.10 --isolated pytest -n auto
1515

1616
# Run `ruff format` to check that code is formatted properly.
1717
#

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ authors = [
2323
description = "RTL-level Hardware Design and Simulation Toolkit"
2424
readme = "README.md"
2525
license = {file = "LICENSE.md"}
26-
requires-python = ">=3.9"
26+
requires-python = ">=3.10"
2727
classifiers = [
2828
"Development Status :: 4 - Beta",
2929
"Environment :: Console",

pyrtl/analysis.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
import subprocess
1313
import sys
1414
import tempfile
15-
from collections.abc import Iterable
16-
from typing import Callable
15+
from collections.abc import Callable, Iterable
1716

1817
from pyrtl.core import Block, LogicNet, working_block
1918
from pyrtl.helperfuncs import _currently_in_jupyter_notebook, _print_netlist_latex

pyrtl/helperfuncs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ def fn(n):
493493
msg = f"bitpattern field {exc.args[0]} was not provided in named_field list"
494494
raise PyrtlError(msg) from exc
495495

496-
fmap = dict(zip(lifo, intfields))
496+
fmap = dict(zip(lifo, intfields, strict=True))
497497
for c in bitpattern[::-1]:
498498
if c == "0" or c == "1":
499499
bitlist.append(c)
@@ -582,7 +582,7 @@ def chop(w: WireVector, *segment_widths: int) -> list[WireVector]:
582582
n_segments = len(segment_widths)
583583
starts = [sum(segment_widths[i + 1 :]) for i in range(n_segments)]
584584
ends = [sum(segment_widths[i:]) for i in range(n_segments)]
585-
return [w[s:e] for s, e in zip(starts, ends)]
585+
return [w[s:e] for s, e in zip(starts, ends, strict=True)]
586586

587587

588588
def input_list(
@@ -706,7 +706,7 @@ def wirevector_list(
706706
)
707707

708708
wirelist = []
709-
for fullname, bw in zip(names, bitwidth):
709+
for fullname, bw in zip(names, bitwidth, strict=True):
710710
try:
711711
name, bw = fullname.split("/")
712712
except ValueError:

pyrtl/memory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import collections
2020
import numbers
2121
import types
22-
from collections.abc import Sequence
23-
from typing import Callable, NamedTuple
22+
from collections.abc import Callable, Sequence
23+
from typing import NamedTuple
2424

2525
from pyrtl.core import Block, LogicNet, _NameIndexer, working_block
2626
from pyrtl.corecircuits import as_wires

pyrtl/rtllib/adders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import itertools
1212
import math
13-
from typing import Callable
13+
from collections.abc import Callable
1414

1515
import pyrtl
1616

pyrtl/rtllib/multipliers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"""
1010

1111
import math
12-
from typing import Callable
12+
from collections.abc import Callable
1313

1414
import pyrtl
1515
from pyrtl.rtllib import adders

pyrtl/rtllib/muxes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def _add_signal(self, data_signals):
258258
)
259259
raise pyrtl.PyrtlError(msg)
260260

261-
for dw, sig in zip(self.dest_wires, data_signals):
261+
for dw, sig in zip(self.dest_wires, data_signals, strict=True):
262262
data_signal = pyrtl.as_wires(sig, dw.bitwidth)
263263
self.dest_instrs_info[dw].append(data_signal)
264264

@@ -268,7 +268,7 @@ def finalize(self):
268268
self._final = True
269269

270270
for dest_w, values in self.dest_instrs_info.items():
271-
mux_vals = dict(zip(self.instructions, values))
271+
mux_vals = dict(zip(self.instructions, values, strict=False))
272272
dest_w <<= sparse_mux(self.signal_wire, mux_vals)
273273

274274

pyrtl/rtllib/testingutils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import random
4-
from typing import Callable
4+
from collections.abc import Callable
55

66
import pyrtl
77

@@ -62,7 +62,8 @@ def make_inputs_and_values(
6262
random_dist=dist,
6363
)
6464
for i in range(num_wires)
65-
)
65+
),
66+
strict=True,
6667
)
6768
)
6869
return wires, vals
@@ -165,7 +166,7 @@ def sim_and_ret_outws(
165166
:class:`list` of its values in each cycle.
166167
"""
167168
sim = pyrtl.Simulation()
168-
sim.step_multiple(provided_inputs=dict(zip(inwires, invals)))
169+
sim.step_multiple(provided_inputs=dict(zip(inwires, invals, strict=True)))
169170
return sim.tracer.trace
170171

171172

0 commit comments

Comments
 (0)