diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a8a34d73e..d223e5645 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -58,7 +58,7 @@ repos: # Python linting using ruff - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.3 + rev: v0.6.4 hooks: - id: ruff args: ["--fix", "--show-fixes"] @@ -69,11 +69,12 @@ repos: rev: v1.11.2 hooks: - id: mypy - files: ^(src/mqt|test/python) + files: ^(src/mqt|test/python|noxfile.py) args: [] additional_dependencies: - - pytest + - nox - pandas-stubs + - pytest # Also run Black on examples in the documentation - repo: https://github.com/adamchainz/blacken-docs @@ -107,7 +108,7 @@ repos: # Check for spelling - repo: https://github.com/crate-ci/typos - rev: v1.24.1 + rev: v1.24.5 hooks: - id: typos diff --git a/CMakeLists.txt b/CMakeLists.txt index c06e5c649..8024a1564 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,12 @@ # set required cmake version -cmake_minimum_required(VERSION 3.19...3.28) +cmake_minimum_required(VERSION 3.19...3.30) project( mqt-core LANGUAGES CXX DESCRIPTION "MQT Core - The Backbone of the Munich Quantum Toolkit") +# Add path for custom modules list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(cmake/StandardProjectSettings.cmake) @@ -84,10 +85,12 @@ if(BUILD_MQT_CORE_BENCHMARKS) endif() if(MQT_CORE_MASTER_PROJECT) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY) - add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P - ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) + if(NOT TARGET mqt-core-uninstall) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY) + add_custom_target(mqt-core-uninstall COMMAND ${CMAKE_COMMAND} -P + ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) + endif() else() set(mqt-core_FOUND TRUE diff --git a/pyproject.toml b/pyproject.toml index fa6b27f47..d47577384 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -160,7 +160,7 @@ report.exclude_also = [ [tool.mypy] -files = ["src/mqt", "test/python"] +files = ["src/mqt", "test/python", "noxfile.py"] mypy_path = ["$MYPY_CONFIG_FILE_DIR/src"] python_version = "3.8" warn_unused_configs = true diff --git a/src/circuit_optimizer/CircuitOptimizer.cpp b/src/circuit_optimizer/CircuitOptimizer.cpp index 9aa2f0c36..c908f0221 100644 --- a/src/circuit_optimizer/CircuitOptimizer.cpp +++ b/src/circuit_optimizer/CircuitOptimizer.cpp @@ -1272,10 +1272,11 @@ void replaceMCXWithMCZ( auto* compOp = dynamic_cast(op.get()); replaceMCXWithMCZ( compOp->begin(), [&compOp] { return compOp->end(); }, - [&compOp](auto it, auto&& op) { - return compOp->insert(it, std::forward(op)); + [&compOp](auto iter, auto&& operation) { + return compOp->insert(iter, + std::forward(operation)); }, - [&compOp](auto it) { return compOp->erase(it); }); + [&compOp](auto iter) { return compOp->erase(iter); }); } } } @@ -1668,7 +1669,7 @@ void elidePermutations(Iterator begin, const std::function& end, if (auto* compOp = dynamic_cast(op.get())) { elidePermutations( compOp->begin(), [&compOp]() { return compOp->end(); }, - [&compOp](auto it) { return compOp->erase(it); }, permutation); + [&compOp](auto iter) { return compOp->erase(iter); }, permutation); if (compOp->empty()) { it = erase(it); continue;