From 8409a6bb943c9f677041bf696a7ef5c6b543bd10 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 30 Apr 2023 16:53:49 +0800 Subject: [PATCH 1/4] update gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 77178c15e..0e5c2324c 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ __pycache__/ /repository/ /results /last_rid.pyon -/dataset_db.pyon +/dataset_db.mdb +/dataset_db.mdb-lock /device_db*.py /test* From 3ff0be6540b5a9eb252cd95db6a812d75e7c8ed2 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 30 Apr 2023 16:55:49 +0800 Subject: [PATCH 2/4] PEP440 compliant version numbers --- artiq/_version.py | 2 +- flake.nix | 2 +- versioneer.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/artiq/_version.py b/artiq/_version.py index e308ce8c2..bf9797c9d 100644 --- a/artiq/_version.py +++ b/artiq/_version.py @@ -1,4 +1,4 @@ import os def get_version(): - return os.getenv("VERSIONEER_OVERRIDE", default="8.0.beta") + return os.getenv("VERSIONEER_OVERRIDE", default="8.0+unknown.beta") diff --git a/flake.nix b/flake.nix index 1336351bb..2d9a03c12 100644 --- a/flake.nix +++ b/flake.nix @@ -21,7 +21,7 @@ artiqVersionMajor = 8; artiqVersionMinor = self.sourceInfo.revCount or 0; artiqVersionId = self.sourceInfo.shortRev or "unknown"; - artiqVersion = (builtins.toString artiqVersionMajor) + "." + (builtins.toString artiqVersionMinor) + "." + artiqVersionId + ".beta"; + artiqVersion = (builtins.toString artiqVersionMajor) + "." + (builtins.toString artiqVersionMinor) + "+" + artiqVersionId + ".beta"; artiqRev = self.sourceInfo.rev or "unknown"; rustManifest = pkgs.fetchurl { diff --git a/versioneer.py b/versioneer.py index f6393d21e..dcb8bf1b2 100644 --- a/versioneer.py +++ b/versioneer.py @@ -11,7 +11,7 @@ def get_rev(): """ def get_version(): - return os.getenv("VERSIONEER_OVERRIDE", default="8.0.beta") + return os.getenv("VERSIONEER_OVERRIDE", default="8.0+unknown.beta") def get_rev(): return os.getenv("VERSIONEER_REV", default="unknown") From d5a775558456a83fb2aa7e60a02acf9f460edb05 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 30 Apr 2023 17:15:34 +0800 Subject: [PATCH 3/4] test: improve tmpdir names --- artiq/test/test_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/test/test_client.py b/artiq/test/test_client.py index f3110d150..aa6cae692 100644 --- a/artiq/test/test_client.py +++ b/artiq/test/test_client.py @@ -29,8 +29,8 @@ def get_env(): class TestClient(unittest.TestCase): def setUp(self): - self.tmp_dir = TemporaryDirectory(prefix="test") - self.tmp_empty_dir = TemporaryDirectory(prefix="empty_repo") + self.tmp_dir = TemporaryDirectory(prefix="artiq_client_test") + self.tmp_empty_dir = TemporaryDirectory(prefix="artiq_empty_repo") self.exp_name = "experiment.py" self.exp_path = os.path.join(self.tmp_dir.name, self.exp_name) self.device_db_path = os.path.join(self.tmp_dir.name, "device_db.py") From 0e7e30d46e91b7a4000f83413e7aae3d4a267aca Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 30 Apr 2023 17:16:36 +0800 Subject: [PATCH 4/4] test: fix hardware testbench trying to write to ARTIQ_ROOT --- artiq/test/hardware_testbench.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/artiq/test/hardware_testbench.py b/artiq/test/hardware_testbench.py index c5cebfeff..05e925d0c 100644 --- a/artiq/test/hardware_testbench.py +++ b/artiq/test/hardware_testbench.py @@ -5,6 +5,7 @@ import os import sys import unittest import logging +from tempfile import TemporaryDirectory from artiq.master.databases import DeviceDB, DatasetDB from artiq.master.worker_db import DeviceManager, DatasetManager, DeviceError @@ -19,9 +20,10 @@ logger = logging.getLogger(__name__) @unittest.skipUnless(artiq_root, "no ARTIQ_ROOT") class ExperimentCase(unittest.TestCase): def setUp(self): + self.tempdir = TemporaryDirectory(prefix="artiq_hw_test") self.device_db = DeviceDB(os.path.join(artiq_root, "device_db.py")) self.dataset_db = DatasetDB( - os.path.join(artiq_root, "dataset_db.mdb")) + os.path.join(self.tempdir.name, "dataset_db.mdb")) self.device_mgr = DeviceManager( self.device_db, virtual_devices={"scheduler": DummyScheduler()}) self.dataset_mgr = DatasetManager(self.dataset_db) @@ -29,6 +31,7 @@ class ExperimentCase(unittest.TestCase): def tearDown(self): self.device_mgr.close_devices() self.dataset_db.close_db() + self.tempdir.cleanup() def create(self, cls, *args, **kwargs): try: