Skip to content

Commit

Permalink
Merge pull request #63 from CQCL/release/0.7.0
Browse files Browse the repository at this point in the history
Release/0.7.0
  • Loading branch information
cqc-alec authored Oct 3, 2023
2 parents 0efb7b4 + ebec5aa commit 610e1bf
Show file tree
Hide file tree
Showing 21 changed files with 101 additions and 112 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,44 @@ jobs:
os: ['ubuntu-22.04', 'macos-12', 'windows-2022']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/*
- name: Set up Python 3.9
if: github.event_name == 'push' || github.event_name == 'schedule'
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Build and test including remote checks (3.9) mypy
if: (matrix.os == 'macos-12') && (github.event_name == 'pull_request' || github.event_name == 'release' || contains(github.ref, 'refs/heads/wheel') || github.event_name == 'schedule')
- name: Build and test (3.9)
if: github.event_name == 'push' || github.event_name == 'schedule'
shell: bash
run: |
./.github/workflows/build-test nomypy
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build and test including remote checks (3.10) mypy
shell: bash
if: (matrix.os == 'macos-12') && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'release' || github.event_name == 'schedule' )
run: |
./.github/workflows/build-test mypy
env:
PYTKET_RUN_REMOTE_TESTS: 1
- name: Build and test including remote checks (3.9) nomypy
- name: Build and test including remote checks (3.10) nomypy
if: (matrix.os != 'macos-12') && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'release' || github.event_name == 'schedule')
shell: bash
run: |
./.github/workflows/build-test nomypy
env:
PYTKET_RUN_REMOTE_TESTS: 1
- name: Set up Python 3.10
- name: Set up Python 3.11
if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'schedule'
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build and test (3.10)
python-version: '3.11'
- name: Build and test (3.11)
if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'schedule'
shell: bash
run: |
Expand Down Expand Up @@ -104,13 +115,13 @@ jobs:
needs: publish_to_pypi
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.10'
- name: Download all wheels
uses: actions/download-artifact@v3
with:
Expand All @@ -129,7 +140,7 @@ jobs:
mkdir extensions
./build-docs -d ${GITHUB_WORKSPACE}/.github/workflows/docs/extensions/api
- name: Upload docs as artefact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v2
with:
path: .github/workflows/docs/extensions

Expand All @@ -147,4 +158,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v2
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: build docs
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
Expand Down
File renamed without changes
Binary file added .github/workflows/docs/Quantinuum_logo_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 10 additions & 9 deletions .github/workflows/docs/build-docs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ MODULE = "iqm"
PYTKET_IQM_PYPI_LINK = "https://pypi.org/project/pytket-iqm/"
PYTKET_IQM_GITHUB = "https://github.com/CQCL/pytket-iqm"


def get_module_version():
m = import_module(f"pytket.extensions.{MODULE}")
return m._metadata.__extension_version__.split(".")
Expand All @@ -39,9 +40,11 @@ def build_module_docs():
mod_docs = MODULES_DIR / "docs"
mod_build = mod_docs / "build"
conf_copy = mod_docs / "conf.py"
logo_copy = mod_docs / "Quantinuum_logo.png"
logo_copy_black = mod_docs / "Quantinuum_logo_black.png"
logo_copy_white = mod_docs / "Quantinuum_logo_white.png"
shutil.copy(DOCS_DIR / "conf.py", conf_copy)
shutil.copy(DOCS_DIR / "Quantinuum_logo.png", logo_copy)
shutil.copy(DOCS_DIR / "Quantinuum_logo_black.png", logo_copy_black)
shutil.copy(DOCS_DIR / "Quantinuum_logo_white.png", logo_copy_white)
remove_dir(mod_build)
index_rst = mod_docs / "index.rst"
with open(mod_docs / "intro.txt", "r") as f:
Expand All @@ -51,14 +54,11 @@ def build_module_docs():
)
content.append(f"\tpytket <{PYTKET_DOCS_LINK}>\n")
content.append(f"\tpytket extensions <{PYTKET_EX_DOCS_LINK}>\n")
content.append(
"\n.. toctree::\n\t:caption: Links:\n\t:maxdepth: 1\n\n"
)
content.append("\n.. toctree::\n\t:caption: Links:\n\t:maxdepth: 1\n\n")
content.append(f"\tbug tracker <{PYTKET_IQM_GITHUB}/issues>\n")
content.append(f"\tGitHub <{PYTKET_IQM_GITHUB}>\n")
content.append(f"\tPyPi <{PYTKET_IQM_PYPI_LINK}>\n")


with open(index_rst, "w") as f:
f.writelines(content)
subprocess.run(
Expand All @@ -69,7 +69,7 @@ def build_module_docs():
"-D",
f"project=pytket-{MODULE}",
"-D",
f"copyright={datetime.date.today().year} Cambridge Quantum Computing",
f"copyright={datetime.date.today().year} Quantinuum",
"-D",
f"version={'.'.join(v[:2])}",
"-D",
Expand All @@ -83,7 +83,8 @@ def build_module_docs():
fix_links(htmlfile)
fix_links(mod_build / "searchindex.js")
conf_copy.unlink()
logo_copy.unlink()
logo_copy_black.unlink()
logo_copy_white.unlink()
index_rst.unlink()


Expand All @@ -103,4 +104,4 @@ if __name__ == "__main__":
MODULES_DIR / "docs" / "build",
dest,
dirs_exist_ok=True,
)
)
12 changes: 6 additions & 6 deletions .github/workflows/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# Configuration file for the Sphinx documentation builder.
# See https://www.sphinx-doc.org/en/master/usage/configuration.html

author = "Cambridge Quantum Computing Ltd"
copyright = "2023 Quantinuum"
author = "Quantinuum"

extensions = [
"sphinx.ext.autodoc",
Expand All @@ -13,22 +14,22 @@
"sphinx_copybutton",
]

pygments_style = "borland"

html_theme = "sphinx_book_theme"

html_theme_options = {
"repository_url": "https://github.com/CQCL/pytket-iqm",
"use_repository_button": True,
"use_issues_button": True,
"logo": {
"image_light": "Quantinuum_logo_black.png",
"image_dark": "Quantinuum_logo_white.png",
},
}

html_static_path = ["_static"]

html_css_files = ["custom.css"]

html_logo = "Quantinuum_logo.png"

# -- Extension configuration -------------------------------------------------

pytketdoc_base = "https://cqcl.github.io/tket/pytket/api/"
Expand Down Expand Up @@ -114,7 +115,6 @@ def correct_signature(
signature: str,
return_annotation: str,
) -> (str, str):

new_signature = signature
new_return_annotation = return_annotation
for k, v in app.config.custom_internal_mapping.items():
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/docs/intro.txt

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx ~= 4.3.2
sphinx_book_theme
sphinx >= 4.3.2, <6.2.0
sphinx_book_theme >= 1.0.1, <2.0
sphinx-copybutton
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ circuit.H(0)
circuit.CX(0, 1)
circuit.CX(0, 2)
circuit.measure_all()
circuit = backend.get_compiled_circuit(circuit)
compiled_circuit = backend.get_compiled_circuit(circuit)

result = backend.run_circuit(c, n_shots=100)
result = backend.run_circuit(compiled_circuit, n_shots=100)
print(result.get_shots())
```

Expand Down
2 changes: 1 addition & 1 deletion _metadata.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__extension_version__ = "0.6.0"
__extension_version__ = "0.7.0"
__extension_name__ = "pytket-iqm"
13 changes: 2 additions & 11 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
background-color: #d9d9d9;
}

.caption-text {
color: #000000;
}

.btn-link:visited,
.btn-link,
a:visited,
Expand All @@ -30,13 +26,8 @@ a:visited,
.wy-menu-vertical ul,
.span.pre,
.sig-param,
.std.std-ref,
a {
color: #544d4d;
}

:root {
--pst-color-inline-code: 199, 37, 78 !important;
html[data-theme=light] {
--pst-color-inline-code: rgb(199, 37, 78) !important;
}

.sig-name {
Expand Down
8 changes: 8 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
~~~~~~~~~

0.7.0 (October 2023)
--------------------

* Update pytket version requirement to 1.20.
* Update iqm-client version requirement to 14.0.
* Fix job status checks.
* Add support for token-based authentication.

0.6.0 (March 2023)
------------------

Expand Down
15 changes: 1 addition & 14 deletions docs/intro.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
pytket-iqm
==========

.. raw:: html

<embed>
<div style="width:100%; display:flex; align-items:center; justify-content:end; transform: translateY(-85px); margin-bottom: -75px">
<img src="_images/Quantinuum_logo.png" width="100" height="100"></img>
</div>
</embed>

.. image:: Quantinuum_logo.png
:width: 0px
:height: 0px
:align: right

``pytket-iqm`` is an extension to ``pytket`` that allows ``pytket`` circuits to
be executed on IQM's quantum devices and simulators.

``pytket-iqm`` is available for Python 3.9 and 3.10, on Linux, MacOS and
``pytket-iqm`` is available for Python 3.9, 3.10 and 3.11, on Linux, MacOS and
Windows. To install, run:

::
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace_packages = True
check_untyped_defs = True

warn_redundant_casts = True
warn_unused_ignores = False
warn_unused_ignores = True
warn_no_return = False
warn_return_any = True
warn_unreachable = True
Expand Down
2 changes: 1 addition & 1 deletion pytket/extensions/iqm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"""

# _metadata.py is copied to the folder after installation.
from ._metadata import __extension_version__, __extension_name__ # type: ignore
from ._metadata import __extension_version__, __extension_name__
from .backends import IQMBackend
from .backends.config import IQMConfig, set_iqm_config
6 changes: 3 additions & 3 deletions pytket/extensions/iqm/backends/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def set_iqm_config(
"""Set default value for IQM API token."""
config = IQMConfig.from_default_config_file()
if auth_server_url is not None:
config.auth_server_url = auth_server_url
config.auth_server_url = auth_server_url # type: ignore
if username is not None:
config.username = username
config.username = username # type: ignore
if password is not None:
config.password = password
config.password = password # type: ignore
config.update_default_config_file()
Loading

0 comments on commit 610e1bf

Please sign in to comment.