Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python binding tests failing on CI #366

Closed
aborgna-q opened this issue May 28, 2024 · 0 comments · Fixed by #367
Closed

Python binding tests failing on CI #366

aborgna-q opened this issue May 28, 2024 · 0 comments · Fixed by #367
Assignees
Labels
bug Something isn't working ci CI / devops py-bindings Python bindings

Comments

@aborgna-q
Copy link
Collaborator

pytket cannot find the tket2.ops module.

============================= test session starts ==============================
platform linux -- Python 3.11.9, pytest-8.2.1, pluggy-1.5.0
rootdir: /home/runner/work/tket2/tket2
configfile: pyproject.toml
plugins: cov-5.0.0, hypothesis-6.102.6
collected 15 items / 2 errors

==================================== ERRORS ====================================
________________ ERROR collecting tket2-py/test/test_circuit.py ________________
ImportError while importing test module '/home/runner/work/tket2/tket2/tket2-py/test/test_circuit.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/importlib/__init__.py:1[26](https://github.com/CQCL/tket2/actions/runs/9248580011/job/25439096636#step:8:27): in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tket2-py/test/test_circuit.py:9: in <module>
    from tket2.ops import Tk2Op
E   ModuleNotFoundError: No module named 'tket2.ops'
__________________ ERROR collecting tket2-py/test/test_ops.py __________________
ImportError while importing test module '/home/runner/work/tket2/tket2/tket2-py/test/test_ops.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tket2-py/test/test_ops.py:2: in <module>
    from tket2.ops import Tk2Op, Pauli
E   ModuleNotFoundError: No module named 'tket2.ops'
=========================== short test summary info ============================
ERROR tket2-py/test/test_circuit.py
ERROR tket2-py/test/test_ops.py
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 2 errors in 0.80s ===============================

https://github.com/CQCL/tket2/actions/runs/9248580011/job/25439096636#step:8:30

@aborgna-q aborgna-q added bug Something isn't working ci CI / devops py-bindings Python bindings labels May 28, 2024
@aborgna-q aborgna-q self-assigned this May 28, 2024
github-merge-queue bot pushed a commit that referenced this issue May 28, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci CI / devops py-bindings Python bindings
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant