Skip to content

✨ Introduce Hatchling and dependency-groups #530

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

Merged
merged 29 commits into from
Apr 16, 2025
Merged

✨ Introduce Hatchling and dependency-groups #530

merged 29 commits into from
Apr 16, 2025

Conversation

nquetschlich
Copy link
Collaborator

resolved #524 and resolves #525

target_directory: str = "./",
target_filename: str = "",
qasm_format: str = "qasm3",
) -> bool: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.

Copilot Autofix

AI 3 months ago

To fix the problem, we need to replace the ellipsis (...) with the correct return type annotation for the function overload. The function get_indep_level has two overloads, one returning a QuantumCircuit and the other returning a bool. The ellipsis should be replaced with the appropriate return type annotation for the second overload.

Suggested changeset 1
src/mqt/bench/benchmark_generation.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/mqt/bench/benchmark_generation.py b/src/mqt/bench/benchmark_generation.py
--- a/src/mqt/bench/benchmark_generation.py
+++ b/src/mqt/bench/benchmark_generation.py
@@ -322,3 +322,3 @@
     qasm_format: str = "qasm3",
-) -> bool: ...
+) -> bool: pass
 
EOF
@@ -322,3 +322,3 @@
qasm_format: str = "qasm3",
) -> bool: ...
) -> bool: pass

Copilot is powered by AI and may make mistakes. Always verify output.
target_directory: str = "./",
target_filename: str = "",
qasm_format: str = "qasm3",
) -> QuantumCircuit: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.

Copilot Autofix

AI 3 months ago

To fix the problem, we need to remove the ellipsis (...) from the function overload definition. The ellipsis is not serving any purpose and is causing a "statement has no effect" error. Removing it will clean up the code and eliminate the error without changing the existing functionality.

Suggested changeset 1
src/mqt/bench/benchmark_generation.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/mqt/bench/benchmark_generation.py b/src/mqt/bench/benchmark_generation.py
--- a/src/mqt/bench/benchmark_generation.py
+++ b/src/mqt/bench/benchmark_generation.py
@@ -377,3 +377,3 @@
     qasm_format: str = "qasm3",
-) -> QuantumCircuit: ...
+) -> QuantumCircuit:
 
EOF
@@ -377,3 +377,3 @@
qasm_format: str = "qasm3",
) -> QuantumCircuit: ...
) -> QuantumCircuit:

Copilot is powered by AI and may make mistakes. Always verify output.
target_directory: str = "./",
target_filename: str = "",
qasm_format: str = "qasm3",
) -> bool: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.

Copilot Autofix

AI 3 months ago

To fix the problem, we need to remove the ellipsis (...) from line 392. This will eliminate the statement that has no effect and clean up the code. The ellipsis is not serving any purpose in this context, so its removal will not affect the existing functionality of the code.

Suggested changeset 1
src/mqt/bench/benchmark_generation.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/mqt/bench/benchmark_generation.py b/src/mqt/bench/benchmark_generation.py
--- a/src/mqt/bench/benchmark_generation.py
+++ b/src/mqt/bench/benchmark_generation.py
@@ -377,3 +377,3 @@
     qasm_format: str = "qasm3",
-) -> QuantumCircuit: ...
+) -> QuantumCircuit:
 
@@ -391,3 +391,3 @@
     qasm_format: str = "qasm3",
-) -> bool: ...
+) -> bool:
 
EOF
@@ -377,3 +377,3 @@
qasm_format: str = "qasm3",
) -> QuantumCircuit: ...
) -> QuantumCircuit:

@@ -391,3 +391,3 @@
qasm_format: str = "qasm3",
) -> bool: ...
) -> bool:

Copilot is powered by AI and may make mistakes. Always verify output.
target_directory: str = "./",
target_filename: str = "",
qasm_format: str = "qasm3",
) -> QuantumCircuit: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.

Copilot Autofix

AI 3 months ago

To fix the problem, we need to replace the ... statement with a proper implementation or remove it if it is not needed. Since the ... is used in the context of type hinting for function overloads, it should be replaced with the pass statement, which is a no-op in Python and is more appropriate in this context.

  • Replace the ... statement with pass in the function overloads.
  • Ensure that the function overloads are correctly defined and do not contain any placeholder code.
Suggested changeset 1
src/mqt/bench/benchmark_generation.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/mqt/bench/benchmark_generation.py b/src/mqt/bench/benchmark_generation.py
--- a/src/mqt/bench/benchmark_generation.py
+++ b/src/mqt/bench/benchmark_generation.py
@@ -460,3 +460,3 @@
     qasm_format: str = "qasm3",
-) -> QuantumCircuit: ...
+) -> QuantumCircuit: pass
 
@@ -474,3 +474,3 @@
     qasm_format: str = "qasm3",
-) -> bool: ...
+) -> bool: pass
 
EOF
@@ -460,3 +460,3 @@
qasm_format: str = "qasm3",
) -> QuantumCircuit: ...
) -> QuantumCircuit: pass

@@ -474,3 +474,3 @@
qasm_format: str = "qasm3",
) -> bool: ...
) -> bool: pass

Copilot is powered by AI and may make mistakes. Always verify output.
target_directory: str = "./",
target_filename: str = "",
qasm_format: str = "qasm3",
) -> bool: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.

Copilot Autofix

AI 3 months ago

To fix the problem, we need to replace the ellipsis with a proper implementation or remove it if it serves no purpose. In this case, the ellipsis is used in the function signature of an overloaded function, which should have a proper return statement or implementation. Since the function is an overload, it should not have a body and should be replaced with the pass statement to indicate that it is intentionally left without a body.

Suggested changeset 1
src/mqt/bench/benchmark_generation.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/mqt/bench/benchmark_generation.py b/src/mqt/bench/benchmark_generation.py
--- a/src/mqt/bench/benchmark_generation.py
+++ b/src/mqt/bench/benchmark_generation.py
@@ -474,3 +474,3 @@
     qasm_format: str = "qasm3",
-) -> bool: ...
+) -> bool: pass
 
EOF
@@ -474,3 +474,3 @@
qasm_format: str = "qasm3",
) -> bool: ...
) -> bool: pass

Copilot is powered by AI and may make mistakes. Always verify output.
Copy link

codecov bot commented Apr 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.8%. Comparing base (8f3e6e4) to head (a8e683b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #530   +/-   ##
=====================================
  Coverage   91.8%   91.8%           
=====================================
  Files         34      34           
  Lines       1554    1554           
=====================================
  Hits        1428    1428           
  Misses       126     126           
Flag Coverage Δ
python 91.8% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@burgholzer burgholzer added dependencies Pull requests that update a dependency file python Pull requests that update Python code packaging Anything related to Python packaging refactor Anything related to refactoring the code base labels Apr 16, 2025
@burgholzer burgholzer added this to MQT Apr 16, 2025
@github-project-automation github-project-automation bot moved this to In Progress in MQT Apr 16, 2025
Copy link
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. I just added a couple of finishing touches. Once CI is green, this should be good to go 🚀

@burgholzer burgholzer enabled auto-merge (squash) April 16, 2025 16:49
@burgholzer burgholzer merged commit ad88108 into main Apr 16, 2025
19 checks passed
@burgholzer burgholzer deleted the hatchling branch April 16, 2025 16:58
@github-project-automation github-project-automation bot moved this from In Progress to Done in MQT Apr 16, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in MQT Applications Apr 16, 2025
simon1hofmann pushed a commit to simon1hofmann/mqt-bench that referenced this pull request May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file packaging Anything related to Python packaging python Pull requests that update Python code refactor Anything related to refactoring the code base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ Switch to hatchling as build backend ✨ Introduce PEP 735 dependency groups
2 participants