From c52bd40c751cf4062f61a3663faa28c393c3cf81 Mon Sep 17 00:00:00 2001 From: Sebastian Abrahamsson Date: Fri, 16 Oct 2026 14:35:39 +0200 Subject: [PATCH] Use the requires expression in the package manifest requires-vunit and requires-vhdl are deprecated since VUnit 5.0.0.dev15 (VUnit/vunit#1232) in favour of one requires expression. The test checks that its VUnit version is the one pyproject.toml requires. Co-Authored-By: Claude Opus 5.5 --- release_notes/news.d/36.misc.md | 1 + src/vunit_python_bridge/vunit_pkg.toml | 4 +--- tests/test_python_bridge.py | 12 +++++++----- 3 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 release_notes/news.d/36.misc.md diff --git a/release_notes/news.d/36.misc.md b/release_notes/news.d/36.misc.md new file mode 100644 index 0000000..f00e5f9 --- /dev/null +++ b/release_notes/news.d/36.misc.md @@ -0,0 +1 @@ +The package manifest uses the `requires` expression of VUnit 5.0.0.dev15 instead of the deprecated `requires-vunit` and `requires-vhdl` fields. diff --git a/src/vunit_python_bridge/vunit_pkg.toml b/src/vunit_python_bridge/vunit_pkg.toml index 1183a69..c19390c 100644 --- a/src/vunit_python_bridge/vunit_pkg.toml +++ b/src/vunit_python_bridge/vunit_pkg.toml @@ -5,9 +5,7 @@ # Copyright (c) 2014-2026, Lars Asplund lars.anders.asplund@gmail.com [package] -# The VUnit adding packages and simulator hooks, VUnit/vunit#1221 -requires-vunit = ">=5.0.0.dev12" -requires-vhdl = ">=2008" +requires = 'vunit >= "5.0.0.dev15" and vhdl >= "2008"' library = "python_bridge" setup = "vunit_python_bridge:setup" diff --git a/tests/test_python_bridge.py b/tests/test_python_bridge.py index a8e5582..23e7413 100644 --- a/tests/test_python_bridge.py +++ b/tests/test_python_bridge.py @@ -147,11 +147,13 @@ def test_setup_points_at_the_setup_function(self): self.assertEqual(module_name, vunit_python_bridge.__name__) self.assertIs(getattr(vunit_python_bridge, function_name), vunit_python_bridge.setup) - def test_requires_vhdl_2008(self): - self.assertEqual(self.package["requires-vhdl"], ">=2008") - - def test_requires_a_vunit_version(self): - self.assertTrue(self.package["requires-vunit"].startswith(">=")) + def test_requires_vhdl_2008_and_the_vunit_of_pyproject(self): + with (Path(__file__).parents[1] / "pyproject.toml").open("rb") as fptr: + dependencies = tomllib.load(fptr)["project"]["dependencies"] + vunit = next(item for item in dependencies if item.startswith("vunit_hdl>=")) + self.assertEqual( + self.package["requires"], f'vunit >= "{vunit.removeprefix("vunit_hdl>=")}" and vhdl >= "2008"' + ) def test_sources_are_the_simulator_independent_vhdl(self): includes = [item for source in self.package["sources"] for item in source["include"]]