From 52447b3ae14f9ddb1da9a0f71aa03915b563b0de Mon Sep 17 00:00:00 2001 From: Christian Bespin Date: Fri, 17 May 2024 17:30:56 +0200 Subject: [PATCH 1/2] Use importlib instead of deprecated pkg_resources --- basil/__init__.py | 6 +++--- setup.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/basil/__init__.py b/basil/__init__.py index 23355cb7f..50d0f4cf0 100644 --- a/basil/__init__.py +++ b/basil/__init__.py @@ -1,4 +1,4 @@ -from pkg_resources import get_distribution, DistributionNotFound +from importlib.metadata import version, PackageNotFoundError import collections import yaml @@ -6,8 +6,8 @@ __version__ = None # required for initial installation try: - __version__ = get_distribution("basil_daq").version -except DistributionNotFound: + __version__ = version("basil_daq") +except PackageNotFoundError: __version__ = "(local)" diff --git a/setup.py b/setup.py index 044ce0f98..d832edd96 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ def package_files(directory): setup( name='basil_daq', version=version, - python_requires='>=3.7', + python_requires='>=3.8', description='Basil - a data acquisition and system testing framework', url='https://github.com/SiLab-Bonn/basil', license='BSD 3-Clause ("BSD New" or "BSD Simplified") License', From 216279acec80b1699a82a43e32a0f77ca2a02270 Mon Sep 17 00:00:00 2001 From: Christian Bespin Date: Tue, 21 May 2024 11:45:46 +0200 Subject: [PATCH 2/2] fix numpy cast conversion deprecation --- examples/mio_sram_test/tests/test_Sim.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/mio_sram_test/tests/test_Sim.py b/examples/mio_sram_test/tests/test_Sim.py index 8a0eaf3d7..6f0cc2f5f 100644 --- a/examples/mio_sram_test/tests/test_Sim.py +++ b/examples/mio_sram_test/tests/test_Sim.py @@ -143,7 +143,7 @@ def test_overflow(self): self.chip['PULSE'].start() ret = self.chip['FIFO'].get_data() - x = np.arange((128 + 1023) * 4, (128 + 1023 + 1) * 4, dtype=np.uint8) + x = np.arange((128 + 1023) * 4, (128 + 1023 + 1) * 4).astype(np.uint8) x.dtype = np.uint32 np.testing.assert_array_equal(ret, x) @@ -197,12 +197,12 @@ def test_continouse(self): for _ in range(100): ret = self.chip['FIFO'].get_data() - x = np.arange(i * 4, (i + ret.shape[0]) * 4, dtype=np.uint8) + x = np.arange(i * 4, (i + ret.shape[0]) * 4).astype(np.uint8) x.dtype = np.uint32 i += ret.shape[0] - ok = np.alltrue(ret == x) + ok = np.all(ret == x) # print 'OK?', ok, ret.shape[0], i, k if not ok: error = True