Skip to content

Commit 7b17f87

Browse files
authored
Merge pull request #161 from krcb197/160-remove-support-for-python-37-and-38
remove support for python 3.7 and 3.8
2 parents ce05433 + 9695dba commit 7b17f87

15 files changed

Lines changed: 328 additions & 504 deletions

.github/workflows/action.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
runs-on: ubuntu-latest
7272
strategy:
7373
matrix:
74-
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13" ]
74+
python-version: [ 3.9, "3.10", "3.11", "3.12", "3.13" ]
7575

7676
steps:
7777
- uses: actions/checkout@v4
@@ -101,7 +101,7 @@ jobs:
101101
runs-on: ubuntu-latest
102102
strategy:
103103
matrix:
104-
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13" ]
104+
python-version: [ 3.9, "3.10", "3.11", "3.12", "3.13" ]
105105

106106
steps:
107107
- uses: actions/checkout@v4
@@ -150,7 +150,7 @@ jobs:
150150
runs-on: ubuntu-latest
151151
strategy:
152152
matrix:
153-
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13" ]
153+
python-version: [ 3.9, "3.10", "3.11", "3.12", "3.13" ]
154154

155155
steps:
156156
- uses: actions/checkout@v4
@@ -252,7 +252,7 @@ jobs:
252252
runs-on: ubuntu-latest
253253
strategy:
254254
matrix:
255-
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]
255+
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
256256

257257
steps:
258258
- uses: actions/checkout@v4
@@ -291,9 +291,7 @@ jobs:
291291
runs-on: ubuntu-latest
292292
strategy:
293293
matrix:
294-
# reduced matrix because the autoformatter was having issues with python 3.8 so we will
295-
# limit this to modern versions of python only
296-
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]
294+
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
297295

298296
steps:
299297
- uses: actions/checkout@v4

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "peakrdl-python"
77
dynamic = ["version"]
8-
requires-python = ">=3.7"
8+
requires-python = ">=3.9"
99
dependencies = [
1010
"systemrdl-compiler>=1.25.0",
1111
"jinja2",
12-
"asynctest;python_version<'3.8'",
1312
"typing-extensions;python_version<'3.11'"
1413
]
1514

@@ -27,8 +26,6 @@ classifiers = [
2726
"Development Status :: 4 - Beta",
2827
"Programming Language :: Python",
2928
"Programming Language :: Python :: 3",
30-
"Programming Language :: Python :: 3.7",
31-
"Programming Language :: Python :: 3.8",
3229
"Programming Language :: Python :: 3.9",
3330
"Programming Language :: Python :: 3.10",
3431
"Programming Language :: Python :: 3.11",

src/peakrdl_python/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
1818
Variables that describes the peakrdl-python Package
1919
"""
20-
__version__ = "0.9.3"
20+
__version__ = "0.9.4"

src/peakrdl_python/lib/async_memory.py

Lines changed: 37 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,12 @@ async def _read(self, start_entry: int, number_entries: int) -> List[int]:
177177
read_callback = self._callbacks.read_callback
178178

179179
if read_block_callback is not None:
180-
# python 3.7 doesn't have the callback defined as protocol so mypy doesn't recognise
181-
# the arguments in the call back functions
182180
addr = self.address_lookup(entry=start_entry)
183181
data_read = \
184-
await read_block_callback(addr=addr, # type: ignore[call-arg]
185-
width=self.width, # type: ignore[call-arg]
186-
accesswidth=self.width, # type: ignore[call-arg]
187-
length=number_entries) # type: ignore[call-arg]
182+
await read_block_callback(addr=addr,
183+
width=self.width,
184+
accesswidth=self.width,
185+
length=number_entries)
188186

189187
if isinstance(self._callbacks, AsyncCallbackSet):
190188
if not isinstance(data_read, List):
@@ -204,11 +202,10 @@ async def _read(self, start_entry: int, number_entries: int) -> List[int]:
204202

205203
for entry in range(number_entries):
206204
entry_address = self.address_lookup(entry=start_entry+entry)
207-
# python 3.7 doesn't have the callback defined as protocol so mypy doesn't
208-
# recognise the arguments in the call back functions
209-
data_entry = await read_callback(addr=entry_address, # type: ignore[call-arg]
210-
width=self.width, # type: ignore[call-arg]
211-
accesswidth=self.width) # type: ignore[call-arg]
205+
206+
data_entry = await read_callback(addr=entry_address,
207+
width=self.width,
208+
accesswidth=self.width)
212209

213210
data_read[entry] = data_entry
214211

@@ -248,14 +245,12 @@ async def _read_legacy(self, start_entry: int, number_entries: int) -> Array:
248245
read_callback = self._callbacks.read_callback
249246

250247
if read_block_callback is not None:
251-
# python 3.7 doesn't have the callback defined as protocol so mypy doesn't recognise
252-
# the arguments in the call back functions
253248
addr = self.address_lookup(entry=start_entry)
254249
data_read = \
255-
await read_block_callback(addr=addr, # type: ignore[call-arg]
256-
width=self.width, # type: ignore[call-arg]
257-
accesswidth=self.width, # type: ignore[call-arg]
258-
length=number_entries) # type: ignore[call-arg]
250+
await read_block_callback(addr=addr,
251+
width=self.width,
252+
accesswidth=self.width,
253+
length=number_entries)
259254

260255
if isinstance(self._callbacks, AsyncCallbackSet):
261256
if not isinstance(data_read, List):
@@ -275,11 +270,9 @@ async def _read_legacy(self, start_entry: int, number_entries: int) -> Array:
275270

276271
for entry in range(number_entries):
277272
entry_address = self.address_lookup(entry=start_entry + entry)
278-
# python 3.7 doesn't have the callback defined as protocol so mypy doesn't
279-
# recognise the arguments in the call back functions
280-
data_entry = await read_callback(addr=entry_address, # type: ignore[call-arg]
281-
width=self.width, # type: ignore[call-arg]
282-
accesswidth=self.width) # type: ignore[call-arg]
273+
data_entry = await read_callback(addr=entry_address,
274+
width=self.width,
275+
accesswidth=self.width)
283276

284277
data_read_block[entry] = data_entry
285278

@@ -428,53 +421,41 @@ async def _write(self, start_entry: int, data: Union[Array, List[int]]) -> None:
428421
f'but got {len(data):d}')
429422

430423
if self._callbacks.write_block_callback is not None:
431-
# python 3.7 doesn't have the callback defined as protocol so mypy doesn't recognise
432-
# the arguments in the call back functions
424+
433425
addr = self.address_lookup(entry=start_entry)
434426
if isinstance(self._callbacks, AsyncCallbackSet):
435427
if isinstance(data, Array):
436-
# pylint: disable=line-too-long
437-
await self._callbacks.write_block_callback(addr=addr, # type: ignore[call-arg]
438-
width=self.width, # type: ignore[call-arg]
439-
accesswidth=self.width, # type: ignore[call-arg]
440-
data=data.tolist()) # type: ignore[call-arg]
441-
# pylint: enable=line-too-long
428+
await self._callbacks.write_block_callback(addr=addr,
429+
width=self.width,
430+
accesswidth=self.width,
431+
data=data.tolist())
442432
else:
443-
# pylint: disable=line-too-long
444-
await self._callbacks.write_block_callback(addr=addr, # type: ignore[call-arg]
445-
width=self.width, # type: ignore[call-arg]
446-
accesswidth=self.width, # type: ignore[call-arg]
447-
data=data) # type: ignore[call-arg]
448-
# pylint: enable=line-too-long
433+
await self._callbacks.write_block_callback(addr=addr,
434+
width=self.width,
435+
accesswidth=self.width,
436+
data=data)
449437
if isinstance(self._callbacks, AsyncCallbackSetLegacy):
450438
if isinstance(data, list):
451439
# need to convert the data to an array before calling
452-
# pylint: disable=line-too-long
453-
await self._callbacks.write_block_callback(addr=addr, # type: ignore[call-arg]
454-
width=self.width, # type: ignore[call-arg]
455-
accesswidth=self.width, # type: ignore[call-arg]
456-
data=Array(self.array_typecode, data)) # type: ignore[call-arg]
457-
# pylint: enable=line-too-long
440+
await self._callbacks.write_block_callback(
441+
addr=addr,
442+
width=self.width,
443+
accesswidth=self.width,
444+
data=Array(self.array_typecode, data))
458445
else:
459-
# pylint: disable=line-too-long
460-
await self._callbacks.write_block_callback(addr=addr, # type: ignore[call-arg]
461-
width=self.width, # type: ignore[call-arg]
462-
accesswidth=self.width, # type: ignore[call-arg]
463-
data=data) # type: ignore[call-arg]
464-
# pylint: enable=line-too-long
446+
await self._callbacks.write_block_callback(addr=addr,
447+
width=self.width,
448+
accesswidth=self.width,
449+
data=data)
465450

466451
elif self._callbacks.write_callback is not None:
467452
# there is not write_block_callback defined so we must used individual write
468453
for entry_index, entry_data in enumerate(data):
469454
entry_address = self.address_lookup(entry=start_entry+entry_index)
470-
# python 3.7 doesn't have the callback defined as protocol so mypy doesn't
471-
# recognise the arguments in the call back functions
472-
# pylint: disable=line-too-long
473-
await self._callbacks.write_callback(addr=entry_address, # type: ignore[call-arg]
474-
width=self.width, # type: ignore[call-arg]
475-
accesswidth=self.width, # type: ignore[call-arg]
476-
data=entry_data) # type: ignore[call-arg]
477-
# pylint: enable=line-too-long
455+
await self._callbacks.write_callback(addr=entry_address,
456+
width=self.width,
457+
accesswidth=self.width,
458+
data=entry_data)
478459

479460
else:
480461
raise RuntimeError('No suitable callback')

0 commit comments

Comments
 (0)