Skip to content

Commit

Permalink
chore(deps): Bump cda-tum/mqt-workflows from 1.3 to 1.4 in the github…
Browse files Browse the repository at this point in the history
…-actions group (#69)

Bumps the github-actions group with 1 update:
[cda-tum/mqt-workflows](https://github.com/cda-tum/mqt-workflows).

Updates `cda-tum/mqt-workflows` from 1.3 to 1.4
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/cda-tum/mqt-workflows/releases">cda-tum/mqt-workflows's
releases</a>.</em></p>
<blockquote>
<h2>MQT Reusable Workflows 1.4.0 Release</h2>
<h2>👀 What Changed</h2>
<p>This release refactors the way tests on Python are distributed and
run. Instead of running separate sessions for each Python version, this
PR changes the workflows to run all sessions in a single workflow run
per operating system.
This should allow for maximum caching reuse across builds and reduce the
number of CI runners that need to be waited for.
It also reduces the number of macOS runners requested per CI run, which
is now fixed to 2 for the python tests regardless of the number of
supported Python versions.</p>
<p>While, previously, only the <code>ubuntu-latest</code> runner would
run tests on all Python versions, this PR changes the workflows so that
also macOS and Windows runners test all the versions.
This should not cause a noticable runtime increase given the excessive
caching opportunities, both via <code>ccache</code> and
<code>uv</code>.</p>
<blockquote>
<p>[!IMPORTANT]<br />
This change will require consuming workflows to adapt their
configuration!</p>
<p>The <code>skip-testing-latest-python</code> workflow input has been
removed and the Python versions being tested are solely defined by the
nox sessions configuration.
Consequently, if a package should not be tested under Python 3.13 yet
for example, <code>&quot;3.13&quot;</code> should be removed from the
<code>PYTHON_ALL_VERSIONS</code> array in the
<code>noxfile.py</code>.</p>
</blockquote>
<p>In addition, this release switches to the official
<code>setup-uv</code> action and employs <code>uv</code> in a couple
more places (see <a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/31">#31</a>
for further details).</p>
<h2>🚀 Features and Enhancements</h2>
<ul>
<li>♻️ unify Python testing <a
href="https://github.com/burgholzer"><code>@​burgholzer</code></a> (<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/32">#32</a>)</li>
<li>⚡ use official <code>setup-uv</code> action and more of
<code>uv</code> <a
href="https://github.com/burgholzer"><code>@​burgholzer</code></a> (<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/31">#31</a>)</li>
<li>🚸 no longer need to explicitly provide <code>GITHUB_TOKEN</code> to
<code>setup-z3</code> <a
href="https://github.com/burgholzer"><code>@​burgholzer</code></a> (<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/30">#30</a>)</li>
</ul>
<h2>🤖 CI</h2>
<ul>
<li>♻️ unify Python testing <a
href="https://github.com/burgholzer"><code>@​burgholzer</code></a> (<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/32">#32</a>)</li>
<li>⚡ use official <code>setup-uv</code> action and more of
<code>uv</code> <a
href="https://github.com/burgholzer"><code>@​burgholzer</code></a> (<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/31">#31</a>)</li>
</ul>
<h2>⬆️ Dependencies</h2>
<!-- raw HTML omitted -->
<ul>
<li>Bump pypa/cibuildwheel from 2.20 to 2.21 in the github-actions group
<a href="https://github.com/dependabot"><code>@​dependabot</code></a>
(<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/33">#33</a>)</li>
<li>♻️ unify Python testing <a
href="https://github.com/burgholzer"><code>@​burgholzer</code></a> (<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/32">#32</a>)</li>
<li>⚡ use official <code>setup-uv</code> action and more of
<code>uv</code> <a
href="https://github.com/burgholzer"><code>@​burgholzer</code></a> (<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/31">#31</a>)</li>
<li>🚸 no longer need to explicitly provide <code>GITHUB_TOKEN</code> to
<code>setup-z3</code> <a
href="https://github.com/burgholzer"><code>@​burgholzer</code></a> (<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/30">#30</a>)</li>
<li>Bump peter-evans/create-pull-request from 6 to 7 in the
github-actions group <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> (<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/29">#29</a>)</li>
<li>⬆️🪝 update pre-commit hooks <a
href="https://github.com/pre-commit-ci"><code>@​pre-commit-ci</code></a>
(<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/28">#28</a>)</li>
<li>⬆️🪝 update pre-commit hooks <a
href="https://github.com/pre-commit-ci"><code>@​pre-commit-ci</code></a>
(<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/27">#27</a>)</li>
</ul>
<!-- raw HTML omitted -->
<p><strong>Full Changelog</strong>: <a
href="https://github.com/cda-tum/mqt-workflows/compare/v1.3.2...v1.4.0">https://github.com/cda-tum/mqt-workflows/compare/v1.3.2...v1.4.0</a></p>
<h2>MQT Reusable Workflows 1.3.2 Release</h2>
<h2>👀 What Changed</h2>
<p>A small bugfix release for the MQT Core Update workflow.</p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/cda-tum/mqt-workflows/commit/7bc94c4133e6849d3e6503b717ff470fb752b5a4"><code>7bc94c4</code></a>
Bump pypa/cibuildwheel from 2.20 to 2.21 in the github-actions group (<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/33">#33</a>)</li>
<li><a
href="https://github.com/cda-tum/mqt-workflows/commit/c256b51441fdf2e8bb11d1f2e66edf3028897f12"><code>c256b51</code></a>
♻️ unify Python testing (<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/32">#32</a>)</li>
<li><a
href="https://github.com/cda-tum/mqt-workflows/commit/0b6eabc6083793121777d2e18ff5e99e0878a329"><code>0b6eabc</code></a>
⚡ use official <code>setup-uv</code> action and more of <code>uv</code>
(<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/31">#31</a>)</li>
<li><a
href="https://github.com/cda-tum/mqt-workflows/commit/fdc30c7975f9cb39ffe964703d5084e3171052de"><code>fdc30c7</code></a>
🚸 no longer need to explicitly provide <code>GITHUB_TOKEN</code> to
<code>setup-z3</code> (<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/30">#30</a>)</li>
<li><a
href="https://github.com/cda-tum/mqt-workflows/commit/dba77f053b165199edd988cf09241a92d72063f8"><code>dba77f0</code></a>
Bump peter-evans/create-pull-request from 6 to 7 in the github-actions
group ...</li>
<li><a
href="https://github.com/cda-tum/mqt-workflows/commit/8dea125a6d32c96930430a76362ba3e8316886a5"><code>8dea125</code></a>
⬆️🪝 update pre-commit hooks (<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/28">#28</a>)</li>
<li><a
href="https://github.com/cda-tum/mqt-workflows/commit/38b81a0148818efff3d8eac03c7c802986aaafbd"><code>38b81a0</code></a>
⬆️🪝 update pre-commit hooks (<a
href="https://redirect.github.com/cda-tum/mqt-workflows/issues/27">#27</a>)</li>
<li>See full diff in <a
href="https://github.com/cda-tum/mqt-workflows/compare/v1.3...v1.4">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cda-tum/mqt-workflows&package-manager=github_actions&previous-version=1.3&new-version=1.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>
  • Loading branch information
burgholzer authored Oct 10, 2024
2 parents 9c62e6f + a139b6b commit f1b9fdf
Show file tree
Hide file tree
Showing 16 changed files with 2,649 additions and 78 deletions.
12 changes: 5 additions & 7 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,30 @@ categories:
- "feature"
- "enhancement"
- "usability"
- "refactor"
- title: "🐛 Bug Fixes"
labels:
- "bug"
- "fix"
- title: "📄 Documentation"
labels:
- "documentation"
- title: "🤖 CI"
labels:
- "continuous integration"
- title: "📦 Packaging"
labels:
- "packaging"
- title: "🧹 Code Quality"
labels:
- "code quality"
- title: "🤖 CI"
labels:
- "continuous integration"
- title: "⬆️ Dependencies"
collapse-after: 5
labels:
- "dependencies"
- "submodules"
- "github_actions"
- "pre-commit"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&'
version-resolver:
Expand All @@ -41,10 +43,6 @@ version-resolver:
labels:
- "patch"
default: patch
autolabeler:
- label: "dependencies"
title:
- "/update pre-commit hooks/i"

template: |
## 👀 What Changed
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
python-packaging:
name: 🐍 Packaging
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.3
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.4
with:
pure-python: true

Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,19 @@ concurrency:
jobs:
change-detection:
name: 🔍 Change
uses: cda-tum/mqt-workflows/.github/workflows/reusable-change-detection.yml@v1.3
uses: cda-tum/mqt-workflows/.github/workflows/reusable-change-detection.yml@v1.4

python-tests:
name: 🐍 Test
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-python-tests)
uses: cda-tum/mqt-workflows/.github/workflows/[email protected]
with:
skip-testing-latest-python: true
uses: cda-tum/mqt-workflows/.github/workflows/[email protected]

code-ql:
name: 📝 CodeQL
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-code-ql)
uses: cda-tum/mqt-workflows/.github/workflows/reusable-code-ql-python.yml@v1.3
uses: cda-tum/mqt-workflows/.github/workflows/reusable-code-ql-python.yml@v1.4

required-checks-pass: # This job does nothing and is only used for branch protection
name: 🚦 Check
Expand Down
13 changes: 5 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ repos:
- id: rst-inline-touching-normal

# Check for spelling
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
- repo: https://github.com/crate-ci/typos
rev: v1.26.0
hooks:
- id: codespell
args: ["-L", "wille,linz", "--skip", "*.ipynb"]
- id: typos

# Format configuration files with prettier
- repo: https://github.com/rbubley/mirrors-prettier
Expand All @@ -62,9 +61,7 @@ repos:
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
types_or: [python, pyi, jupyter]
- id: ruff-format
types_or: [python, pyi, jupyter]

# Also run Black on examples in the documentation
- repo: https://github.com/adamchainz/blacken-docs
Expand All @@ -83,12 +80,11 @@ repos:
rev: v1.11.2
hooks:
- id: mypy
files: ^(src|tests|setup.py)
files: ^(src|tests|noxfile.py)
args: []
additional_dependencies:
- importlib_resources
- types-setuptools
- python_tsp
- networkx
- pytest
- sympy
Expand All @@ -97,6 +93,7 @@ repos:
- tsplib95
- types-Pillow
- referencing
- nox

# Catch common capitalization mistakes
- repo: local
Expand Down
1 change: 1 addition & 0 deletions .python_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
15 changes: 0 additions & 15 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"sphinx.ext.githubpages",
"sphinxcontrib.bibtex",
"sphinx_copybutton",
"hoverxref.extension",
"nbsphinx",
"sphinxext.opengraph",
"sphinx_autodoc_typehints",
Expand Down Expand Up @@ -84,20 +83,6 @@

autosectionlabel_prefix_document = True

hoverxref_auto_ref = True
hoverxref_domains = ["cite", "py"]
hoverxref_roles = []
hoverxref_mathjax = True
hoverxref_role_types = {
"ref": "tooltip",
"p": "tooltip",
"labelpar": "tooltip",
"class": "tooltip",
"meth": "tooltip",
"func": "tooltip",
"attr": "tooltip",
"property": "tooltip",
}
exclude_patterns = ["_build", "build", "**.ipynb_checkpoints", "Thumbs.db", ".DS_Store", ".env"]


Expand Down
4 changes: 2 additions & 2 deletions notebooks/tsp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"source": [
"### Parameters\n",
"\n",
"We begin by setting up our paramters for the QUBOGenerator. The `PathFindingQUBOGenerator` supports the following parameters:\n",
"We begin by setting up our parameters for the QUBOGenerator. The `PathFindingQUBOGenerator` supports the following parameters:\n",
"\n",
"- `encoding_type`: One of `ONE_HOT`, `DOMAIN_WALL`, or `BINARY`. the encoding for the binary variables in the QUBO formulation.\n",
"- `n_paths`: The number of paths to be searched.\n",
Expand Down Expand Up @@ -379,7 +379,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"_Find the shortest paths $\\pi_1$ and $\\pi_2$ from $s_p$ to $t_p$ respectively that don't interesect_"
"_Find the shortest paths $\\pi_1$ and $\\pi_2$ from $s_p$ to $t_p$ respectively that don't intersect_"
]
},
{
Expand Down
12 changes: 6 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import argparse
import os
import shutil
from typing import TYPE_CHECKING

import nox
Expand All @@ -16,7 +17,7 @@

nox.options.sessions = ["lint", "tests"]

PYTHON_ALL_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]
PYTHON_ALL_VERSIONS = ["3.9", "3.10", "3.11", "3.12"]

BUILD_REQUIREMENTS = [
"setuptools_scm>=8.1",
Expand All @@ -30,12 +31,11 @@

@nox.session(reuse_venv=True)
def lint(session: nox.Session) -> None:
"""Lint the Python part of the codebase using pre-commit.
"""Run the linter."""
if shutil.which("pre-commit") is None:
session.install("pre-commit")

Simply execute `nox -rs lint` to run all configured hooks.
"""
session.install("pre-commit")
session.run("pre-commit", "run", "--all-files", *session.posargs)
session.run("pre-commit", "run", "--all-files", *session.posargs, external=True)


def _run_tests(
Expand Down
41 changes: 23 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ authors = [
]
keywords = ["MQT", "quantum-computing", "qubo", "shortest-path", "design-automation"]
license = { file = "LICENSE" }
requires-python = ">=3.8"
requires-python = ">=3.9"
dynamic = ["version"]

dependencies = [
"importlib_resources>=5.0; python_version < '3.10'",
"qiskit>=1.0.0",
"joblib>=1.3.2",
"numpy>=1.26.4,<3.0; python_version > '3.11'", # some of our dependencies are not yet compatible with numpy 2.0
"numpy>=1.17.0,<2.0; python_version <= '3.11'", # some of our dependencies are not yet compatible with numpy 2.0
"numpy>=1.26; python_version >= '3.12'",
"numpy>=1.24; python_version >= '3.11'",
"numpy>=1.22",
"sympy>=1.13.1",
"matplotlib>=3.9.0; python_version > '3.11'",
"matplotlib>=3.7.0; python_version <= '3.11'",
"networkx>=2.8.8",
"python_tsp>=0.4.0",
"docplex>=2.25.236",
"qiskit_optimization>=0.6.0",
"tsplib95>=0.7.1",
Expand Down Expand Up @@ -61,20 +61,16 @@ classifiers = [
]

[project.optional-dependencies]
test = ["pytest>=7"]
test = ["pytest>=7.2"]
coverage = ["mqt.qubomaker[test]", "pytest-cov>=4"]
docs = [
"furo>=2023.08.17",
"sphinx>=7,<9",
"setuptools-scm>=8",
"furo>=2023.9.10",
"setuptools-scm>=8.1",
"sphinxcontrib-bibtex>=2.4.2",
"sphinx-copybutton",
"sphinx-hoverxref",
"pybtex>=0.24",
"ipython",
"sphinx-copybutton>=0.5",
"ipykernel",
"nbsphinx",
"sphinxext-opengraph",
"sphinxext-opengraph>=0.9",
"sphinx-autodoc-typehints",
"qiskit[visualization]",
]
Expand All @@ -92,15 +88,14 @@ Discussions = "https://github.com/cda-tum/mqt-qubomaker/discussions"
"mqt.qubomaker.pathfinder" = ["resources/*", "resources/constraints/*"]

[tool.pytest.ini_options]
minversion = "7.0"
minversion = "7.2"
testpaths = ["tests"]
addopts = ["-ra", "--strict-markers", "--strict-config", "--showlocals"]
log_cli_level = "INFO"
xfail_strict = true
filterwarnings = [
"error",
"ignore:.*invalid escape sequence.*::.*docplex.*",
"ignore:.*Qiskit with Python 3.8.*:DeprecationWarning:",
]

[tool.coverage]
Expand All @@ -115,20 +110,19 @@ report.exclude_also = [
[tool.mypy]
mypy_path = "$MYPY_CONFIG_FILE_DIR/src,$MYPY_CONFIG_FILE_DIR/stubs"
files = ["src", "tests"]
python_version = "3.8"
python_version = "3.9"
strict = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
warn_unreachable = true
explicit_package_bases = true
pretty = true

[[tool.mypy.overrides]]
module = ["types-Pillow", "jsonschema", "tsplib95.*", "ipywidgets.*", "IPython.*", "qiskit.*", "qiskit_algorithms.*", "matplotlib.*", "python_tsp.*", "networkx.*", "mqt.ddsim.*", "joblib.*", "qiskit_optimization.*", "docplex.*", "typing_extensions.*"]
module = ["types-Pillow", "jsonschema", "tsplib95.*", "ipywidgets.*", "IPython.*", "qiskit.*", "qiskit_algorithms.*", "matplotlib.*", "networkx.*", "mqt.ddsim.*", "joblib.*", "qiskit_optimization.*", "docplex.*", "typing_extensions.*", "numpy.*"]
ignore_missing_imports = true

[tool.ruff]
line-length = 120
extend-include = ["*.ipynb"]
preview = true
unsafe-fixes = true

Expand Down Expand Up @@ -197,3 +191,14 @@ isort.required-imports = ["from __future__ import annotations"]

[tool.ruff.lint.pydocstyle]
convention = "google"


[tool.typos]
default.extend-ignore-re = [
'"id": ".*",',
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$", # ignore line
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on", # ignore block
"NDArray",
]
[tool.typos.default.extend-words]
wille = "wille"
2 changes: 1 addition & 1 deletion src/mqt/qubomaker/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""A package for generating QUBO formulations automatically from a set of constraints QUBOs for different problem classes.
It allows users to create a `QUBOGenerator` object, and graudally add penalty terms and constraints to it.
It allows users to create a `QUBOGenerator` object, and gradually add penalty terms and constraints to it.
When done, the object can be used to construct a QUBO formulation of the project on multiple granularity levels.
## Available Subpackages
Expand Down
6 changes: 3 additions & 3 deletions src/mqt/qubomaker/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import TYPE_CHECKING, Tuple, Union
from typing import TYPE_CHECKING, Union, cast

import networkx as nx
import numpy as np
Expand All @@ -12,7 +12,7 @@
if TYPE_CHECKING:
from io import TextIOWrapper

Edge = Union[Tuple[int, int], Tuple[int, int, int], Tuple[int, int, float]]
Edge = Union[tuple[int, int], tuple[int, int, int], tuple[int, int, float]]


class Graph:
Expand Down Expand Up @@ -162,7 +162,7 @@ def __eq__(self, value: object) -> bool:
"""
if not isinstance(value, Graph):
return False
return np.array_equal(self.adjacency_matrix, value.adjacency_matrix)
return cast(bool, np.array_equal(self.adjacency_matrix, value.adjacency_matrix))

def __hash__(self) -> int:
"""Returns the hash of the graph.
Expand Down
Loading

0 comments on commit f1b9fdf

Please sign in to comment.