Skip to content

Commit 3c888b3

Browse files
committed
Add xdsl and xdsl-jax as dependencies of Catalyst
1 parent 1001ed1 commit 3c888b3

27 files changed

+99
-143
lines changed

.dep-versions

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ stablehlo=0a4440a5c8de45c4f9649bf3eb4913bf3f97da0d
66
llvm=113f01aa82d055410f22a9d03b3468fa68600589
77
enzyme=v0.0.203
88

9+
# xDSL dependencies
10+
xdsl=0.55.4
11+
xdsl_jax=0.1.1
12+
913
# Always remove custom PL/LQ versions before release.
1014

1115
# For a custom PL version, update the package version here and at

doc/releases/changelog-dev.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,9 @@
366366

367367
<h3>Internal changes ⚙️</h3>
368368

369+
* xDSL and xDSL-JAX are now dependencies of Catalyst.
370+
[(#22__)](https://github.com/PennyLaneAI/catalyst/pull/22__)
371+
369372
* Integration tests for `qml.specs` have been updated to match the new output format introduced
370373
in PennyLane.
371374
[(#2255)](https://github.com/PennyLaneAI/catalyst/pull/2255)

frontend/test/pytest/python_interface/dialects/test_catalyst_dialect.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,13 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
"""Unit test module for the xDSL Catalyst dialect."""
1615

1716
import pytest
1817

19-
# pylint: disable=wrong-import-position
18+
from catalyst.python_interface.dialects import Catalyst
2019

2120
pytestmark = pytest.mark.xdsl
22-
xdsl = pytest.importorskip("xdsl")
23-
24-
from catalyst.python_interface.dialects import Catalyst
2521

2622
all_ops = list(Catalyst.operations)
2723
all_attrs = list(Catalyst.attributes)

frontend/test/pytest/python_interface/dialects/test_mbqc_dialect.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,19 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
"""Unit tests for the xDSL MBQC dialect."""
16-
15+
# pylint: disable=line-too-long
1716

1817
import pytest
19-
20-
# pylint: disable=wrong-import-position,line-too-long
21-
pytestmark = pytest.mark.xdsl
22-
xdsl = pytest.importorskip("xdsl")
23-
2418
from xdsl.context import Context
2519
from xdsl.dialects import arith, builtin, test
2620
from xdsl.parser import Parser
2721
from xdsl.utils.exceptions import VerifyException
2822

2923
from catalyst.python_interface.dialects import Quantum, mbqc
3024

25+
pytestmark = pytest.mark.xdsl
26+
3127
all_ops = list(mbqc.MBQC.operations)
3228
all_attrs = list(mbqc.MBQC.attributes)
3329

frontend/test/pytest/python_interface/dialects/test_qec_dialect.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
"""Unit tests for the xDSL QEC dialect."""
1615

1716
import pytest
1817

19-
# pylint: disable=wrong-import-position
20-
pytestmark = pytest.mark.xdsl
21-
xdsl = pytest.importorskip("xdsl")
22-
2318
from catalyst.python_interface.dialects import QEC
2419

20+
pytestmark = pytest.mark.xdsl
21+
2522
all_ops = list(QEC.operations)
2623
all_attrs = list(QEC.attributes)
2724

frontend/test/pytest/python_interface/dialects/test_quantum_dialect.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,9 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
"""Unit tests for the xDSL Quantum dialect."""
16-
import pytest
17-
18-
# pylint: disable=wrong-import-position
19-
pytestmark = pytest.mark.xdsl
20-
xdsl = pytest.importorskip("xdsl")
2115

16+
import pytest
2217
from xdsl.dialects.builtin import (
2318
I32,
2419
ComplexType,
@@ -40,6 +35,8 @@
4035
QuregType,
4136
)
4237

38+
pytestmark = pytest.mark.xdsl
39+
4340
all_ops = list(Quantum.operations)
4441
all_attrs = list(Quantum.attributes)
4542

frontend/test/pytest/python_interface/dialects/test_stablehlo_dialect.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
"""Unit test module for catalyst/python_interface/dialects/stablehlo.py."""
1615
# pylint: disable=line-too-long
16+
1717
import pytest
1818

1919
pytestmark = pytest.mark.xdsl
20-
xdsl = pytest.importorskip("xdsl")
2120

2221

2322
def test_all_unary_operations(run_filecheck):

frontend/test/pytest/python_interface/dialects/test_transform_dialect.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,12 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
"""Unit tests for the xDSL Transform dialect."""
15+
# pylint: disable=line-too-long
1616

1717
from dataclasses import dataclass
1818

1919
import pytest
20-
21-
# pylint: disable=wrong-import-position,line-too-long
22-
pytestmark = pytest.mark.xdsl
23-
xdsl = pytest.importorskip("xdsl")
24-
2520
from xdsl import passes
2621
from xdsl.context import Context
2722
from xdsl.dialects import builtin, transform
@@ -37,6 +32,8 @@
3732
compiler_transform,
3833
)
3934

35+
pytestmark = pytest.mark.xdsl
36+
4037

4138
def test_dict_options():
4239
"""Test ApplyRegisteredPassOp constructor with DictionaryAttr options."""

frontend/test/pytest/python_interface/inspection/test_draw_unified_compiler.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,20 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
"""Unit test module for the draw function in the unified compiler inspection module."""
15+
# pylint: disable=unnecessary-lambda
1516

16-
17-
import pytest
18-
19-
pytestmark = pytest.mark.xdsl
20-
xdsl = pytest.importorskip("xdsl")
21-
22-
# pylint: disable=wrong-import-position,unnecessary-lambda
2317
import jax
2418
import pennylane as qml
19+
import pytest
2520

2621
from catalyst.python_interface.inspection import draw
2722
from catalyst.python_interface.transforms import (
2823
iterative_cancel_inverses_pass,
2924
merge_rotations_pass,
3025
)
3126

27+
pytestmark = pytest.mark.xdsl
28+
3229

3330
@pytest.mark.usefixtures("use_capture")
3431
class Testdraw:

frontend/test/pytest/python_interface/inspection/test_mlir_graph.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,21 @@
1616
from pathlib import Path
1717
from subprocess import run
1818

19-
import pytest
20-
21-
# pylint: disable=wrong-import-position
22-
pytestmark = pytest.mark.xdsl
23-
xdsl = pytest.importorskip("xdsl")
24-
graphviz = pytest.importorskip("graphviz")
25-
26-
if run(["/usr/bin/which", "dot"], check=False).returncode != 0:
27-
pytest.skip(reason="Graphviz isn't installed.")
28-
29-
3019
import pennylane as qml
20+
import pytest
3121

3222
from catalyst.python_interface.inspection import generate_mlir_graph
3323
from catalyst.python_interface.transforms import (
3424
iterative_cancel_inverses_pass,
3525
merge_rotations_pass,
3626
)
3727

28+
pytestmark = pytest.mark.xdsl
29+
graphviz = pytest.importorskip("graphviz")
30+
31+
if run(["/usr/bin/which", "dot"], check=False).returncode != 0:
32+
pytest.skip(reason="Graphviz isn't installed.")
33+
3834

3935
@pytest.fixture(autouse=True)
4036
def _chdir_tmp(monkeypatch, tmp_path: Path):

0 commit comments

Comments
 (0)