Skip to content

Commit

Permalink
fix: pytest failing to find tket2 in CI (#367)
Browse files Browse the repository at this point in the history
Sets the `pytket.pythonpath` config so that pytket can correctly find
the python library in `tket2-py/tket2`.
This caused a module-not-found error on CI, but for some reason it
worked ok locally -.-'

drive-by: Fix the definition of `tket2.__all__`, and include the `ops`
submodule.

Fixes #366.
  • Loading branch information
aborgna-q authored May 28, 2024
1 parent d8f4f74 commit a9df8e6
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 55 deletions.
106 changes: 53 additions & 53 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ python-source = "tket2-py"
# "extension-module" tells pyo3 we want to build an extension module (skips linking against libpython.so)
features = ["pyo3/extension-module"]

[tool.pytest]
pythonpath = "tket2-py"

[tool.pytest.ini_options]
# Lark throws deprecation warnings for `src_parse` and `src_constants`.
filterwarnings = "ignore::DeprecationWarning:lark.*"
Expand Down
4 changes: 2 additions & 2 deletions tket2-py/tket2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from . import passes, circuit, optimiser, pattern, rewrite
from . import circuit, ops, optimiser, passes, pattern, rewrite

__all__ = [circuit, optimiser, passes, pattern, rewrite]
__all__ = ["circuit", "ops", "optimiser", "passes", "pattern", "rewrite"]

0 comments on commit a9df8e6

Please sign in to comment.