From 0161f744115c4e0b35c2a6f7e5aad6cdc81c95da Mon Sep 17 00:00:00 2001 From: Mudit Pandey Date: Fri, 24 Jan 2025 11:49:11 -0500 Subject: [PATCH 01/28] Update interface-unit-tests.yml handling of setting pytest warning levels --- .github/workflows/interface-unit-tests.yml | 84 ++++++++++++---------- 1 file changed, 47 insertions(+), 37 deletions(-) diff --git a/.github/workflows/interface-unit-tests.yml b/.github/workflows/interface-unit-tests.yml index 4157c85314c..503120a1dfd 100644 --- a/.github/workflows/interface-unit-tests.yml +++ b/.github/workflows/interface-unit-tests.yml @@ -89,7 +89,7 @@ jobs: default_runner: ubuntu-latest force_large_runner: ${{ inputs.use_large_runner }} - disable-fail-fast-wae: + warnings-as-errors-setup: needs: - determine_runner @@ -100,8 +100,18 @@ jobs: run: | echo "fail_fast=${{ contains(inputs.python_warning_level, 'default') && 'default' || 'error' }}" >> $GITHUB_OUTPUT + - name: Set pytest arguments for setting warnings level + id: pytest_warning_flags + run: | + if [ ${{ inputs.python_warning_level }} != "default" ]; then + echo "pytest_warning_args='-W ${{ inputs.python_warning_level }} --continue-on-collection-errors'" >> $GITHUB_OUTPUT + else + echo "pytest_warning_args=''" >> $GITHUB_OUTPUT + fi + outputs: fail_fast: ${{ steps.mat_fail_fast.outputs.fail_fast }} + pytest_warning_args: ${{ steps.pytest_warning_flags.outputs.pytest_warning_args }} setup-ci-load: needs: @@ -215,9 +225,9 @@ jobs: - setup-ci-load - determine_runner - default-dependency-versions - - disable-fail-fast-wae + - warnings-as-errors-setup strategy: - fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }} + fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }} max-parallel: >- ${{ fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).torch-tests @@ -241,7 +251,7 @@ jobs: ${{ needs.default-dependency-versions.outputs.pytorch-version }} ${{ inputs.additional_python_packages }} additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }} - pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }} + pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }} pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }} pytest_markers: torch and not qcut and not finite-diff and not param-shift requirements_file: ${{ github.event_name == 'schedule' && strategy.job-index == 0 && 'torch.txt' || '' }} @@ -252,9 +262,9 @@ jobs: - setup-ci-load - determine_runner - default-dependency-versions - - disable-fail-fast-wae + - warnings-as-errors-setup strategy: - fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }} + fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }} max-parallel: >- ${{ fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).autograd-tests @@ -277,7 +287,7 @@ jobs: additional_pip_packages: ${{ inputs.additional_python_packages }} additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }} pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }} - pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }} + pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }} pytest_markers: autograd and not qcut and not finite-diff and not param-shift @@ -286,9 +296,9 @@ jobs: - setup-ci-load - determine_runner - default-dependency-versions - - disable-fail-fast-wae + - warnings-as-errors-setup strategy: - fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }} + fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }} max-parallel: >- ${{ fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).tf-tests @@ -315,7 +325,7 @@ jobs: additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }} pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }} pytest_markers: tf and not qcut and not finite-diff and not param-shift - pytest_additional_args: --splits 3 --group ${{ matrix.group }} -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }} + pytest_additional_args: --splits 3 --group ${{ matrix.group }} ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }} pytest_durations_file_path: '.github/durations/tf_tests_durations.json' requirements_file: ${{ github.event_name == 'schedule' && strategy.job-index == 0 && 'tf.txt' || '' }} @@ -324,9 +334,9 @@ jobs: - setup-ci-load - determine_runner - default-dependency-versions - - disable-fail-fast-wae + - warnings-as-errors-setup strategy: - fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }} + fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }} max-parallel: >- ${{ fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).jax-tests @@ -353,7 +363,7 @@ jobs: additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }} pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }} pytest_markers: jax and not qcut and not finite-diff and not param-shift - pytest_additional_args: --dist=loadscope --splits 4 --group ${{ matrix.group }} -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }} + pytest_additional_args: --dist=loadscope --splits 4 --group ${{ matrix.group }} ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }} pytest_durations_file_path: '.github/durations/jax_tests_durations.json' requirements_file: ${{ github.event_name == 'schedule' && strategy.job-index == 0 && 'jax.txt' || '' }} @@ -363,9 +373,9 @@ jobs: - setup-ci-load - determine_runner - default-dependency-versions - - disable-fail-fast-wae + - warnings-as-errors-setup strategy: - fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }} + fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }} max-parallel: >- ${{ fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).core-tests @@ -390,7 +400,7 @@ jobs: additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }} pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }} pytest_markers: core and not qcut and not finite-diff and not param-shift - pytest_additional_args: --splits 6 --group ${{ matrix.group }} -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }} + pytest_additional_args: --splits 6 --group ${{ matrix.group }} ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }} pytest_durations_file_path: '.github/durations/core_tests_durations.json' requirements_file: ${{ github.event_name == 'schedule' && strategy.job-index == 0 && 'core.txt' || '' }} @@ -400,9 +410,9 @@ jobs: - setup-ci-load - determine_runner - default-dependency-versions - - disable-fail-fast-wae + - warnings-as-errors-setup strategy: - fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }} + fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }} max-parallel: >- ${{ fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).all-interfaces-tests @@ -430,7 +440,7 @@ jobs: additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }} pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }} pytest_markers: all_interfaces - pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }} + pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }} requirements_file: ${{ github.event_name == 'schedule' && strategy.job-index == 0 && 'all_interfaces.txt' || '' }} @@ -439,9 +449,9 @@ jobs: - setup-ci-load - determine_runner - default-dependency-versions - - disable-fail-fast-wae + - warnings-as-errors-setup strategy: - fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }} + fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }} max-parallel: >- ${{ fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).external-libraries-tests @@ -463,7 +473,7 @@ jobs: python_version: ${{ matrix.python-version }} pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }} pytest_markers: external - pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }} + pytest_additional_args:${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }} additional_pip_packages: | pyzx matplotlib stim quimb mitiq ply optax scipy-openblas32>=0.3.26 git+https://github.com/PennyLaneAI/pennylane-qiskit.git@master @@ -480,9 +490,9 @@ jobs: - setup-ci-load - determine_runner - default-dependency-versions - - disable-fail-fast-wae + - warnings-as-errors-setup strategy: - fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }} + fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }} max-parallel: >- ${{ fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).qcut-tests @@ -504,7 +514,7 @@ jobs: python_version: ${{ matrix.python-version }} pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }} pytest_markers: qcut - pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }} + pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }} additional_pip_packages: | kahypar==1.1.7 opt_einsum @@ -520,9 +530,9 @@ jobs: - setup-ci-load - determine_runner - default-dependency-versions - - disable-fail-fast-wae + - warnings-as-errors-setup strategy: - fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }} + fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }} max-parallel: >- ${{ fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).qchem-tests @@ -545,7 +555,7 @@ jobs: additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }} pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }} pytest_markers: qchem - pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }} + pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }} additional_pip_packages: | openfermionpyscf basis-set-exchange geometric scikit-learn ${{ inputs.additional_python_packages }} @@ -555,9 +565,9 @@ jobs: - setup-ci-load - determine_runner - default-dependency-versions - - disable-fail-fast-wae + - warnings-as-errors-setup strategy: - fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }} + fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }} max-parallel: >- ${{ fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).gradients-tests @@ -580,7 +590,7 @@ jobs: branch: ${{ inputs.branch }} coverage_artifact_name: gradients-${{ matrix.config.suite }}-coverage python_version: ${{ matrix.python-version }} - pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }} + pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }} additional_pip_packages: | ${{ needs.default-dependency-versions.outputs.jax-version }} ${{ needs.default-dependency-versions.outputs.tensorflow-version }} @@ -596,9 +606,9 @@ jobs: - setup-ci-load - determine_runner - default-dependency-versions - - disable-fail-fast-wae + - warnings-as-errors-setup strategy: - fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }} + fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }} max-parallel: >- ${{ fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).data-tests @@ -620,7 +630,7 @@ jobs: python_version: ${{ matrix.python-version }} additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }} pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }} - pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }} + pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }} pytest_markers: data additional_pip_packages: | h5py @@ -632,9 +642,9 @@ jobs: - setup-ci-load - determine_runner - default-dependency-versions - - disable-fail-fast-wae + - warnings-as-errors-setup strategy: - fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }} + fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }} max-parallel: >- ${{ fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).device-tests @@ -669,7 +679,7 @@ jobs: additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }} pytest_test_directory: pennylane/devices/tests pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }} - pytest_additional_args: --device=${{ matrix.config.device }} --shots=${{ matrix.config.shots }} -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }} + pytest_additional_args: --device=${{ matrix.config.device }} --shots=${{ matrix.config.shots }} ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }} upload-to-codecov: From 1bf1e59290e64688af5dad9234a4b5a281b33f81 Mon Sep 17 00:00:00 2001 From: Mudit Pandey Date: Fri, 24 Jan 2025 11:58:34 -0500 Subject: [PATCH 02/28] Minor whitespace fix --- .github/workflows/interface-unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/interface-unit-tests.yml b/.github/workflows/interface-unit-tests.yml index 503120a1dfd..84c4f3eefca 100644 --- a/.github/workflows/interface-unit-tests.yml +++ b/.github/workflows/interface-unit-tests.yml @@ -473,7 +473,7 @@ jobs: python_version: ${{ matrix.python-version }} pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }} pytest_markers: external - pytest_additional_args:${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }} + pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }} additional_pip_packages: | pyzx matplotlib stim quimb mitiq ply optax scipy-openblas32>=0.3.26 git+https://github.com/PennyLaneAI/pennylane-qiskit.git@master From 9f99f3ef875e02027919410094d0a356de3cbaff Mon Sep 17 00:00:00 2001 From: Mudit Pandey Date: Fri, 24 Jan 2025 12:08:18 -0500 Subject: [PATCH 03/28] Add quotes --- .github/workflows/interface-unit-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/interface-unit-tests.yml b/.github/workflows/interface-unit-tests.yml index 84c4f3eefca..fa7ab00f808 100644 --- a/.github/workflows/interface-unit-tests.yml +++ b/.github/workflows/interface-unit-tests.yml @@ -103,8 +103,8 @@ jobs: - name: Set pytest arguments for setting warnings level id: pytest_warning_flags run: | - if [ ${{ inputs.python_warning_level }} != "default" ]; then - echo "pytest_warning_args='-W ${{ inputs.python_warning_level }} --continue-on-collection-errors'" >> $GITHUB_OUTPUT + if [ "${{ inputs.python_warning_level }}" != "default" ]; then + echo "pytest_warning_args='-W "${{ inputs.python_warning_level }}" --continue-on-collection-errors'" >> $GITHUB_OUTPUT else echo "pytest_warning_args=''" >> $GITHUB_OUTPUT fi From 73f91479a9b00bf7c5539d5fef35451d2c0ec9b3 Mon Sep 17 00:00:00 2001 From: Mudit Pandey Date: Fri, 24 Jan 2025 12:15:33 -0500 Subject: [PATCH 04/28] Escape quotes --- .github/workflows/interface-unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/interface-unit-tests.yml b/.github/workflows/interface-unit-tests.yml index fa7ab00f808..57e8082d316 100644 --- a/.github/workflows/interface-unit-tests.yml +++ b/.github/workflows/interface-unit-tests.yml @@ -104,7 +104,7 @@ jobs: id: pytest_warning_flags run: | if [ "${{ inputs.python_warning_level }}" != "default" ]; then - echo "pytest_warning_args='-W "${{ inputs.python_warning_level }}" --continue-on-collection-errors'" >> $GITHUB_OUTPUT + echo "pytest_warning_args='-W \"${{ inputs.python_warning_level }}\" --continue-on-collection-errors'" >> $GITHUB_OUTPUT else echo "pytest_warning_args=''" >> $GITHUB_OUTPUT fi From 6eaaad73801b29d17a5b4523363152a5683e2140 Mon Sep 17 00:00:00 2001 From: Mudit Pandey Date: Fri, 24 Jan 2025 12:23:48 -0500 Subject: [PATCH 05/28] Another attempt --- .github/workflows/interface-unit-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/interface-unit-tests.yml b/.github/workflows/interface-unit-tests.yml index 57e8082d316..3ceb5bd09dc 100644 --- a/.github/workflows/interface-unit-tests.yml +++ b/.github/workflows/interface-unit-tests.yml @@ -97,6 +97,8 @@ jobs: steps: - name: Set fail-fast for WAE id: mat_fail_fast + env: + PYTEST_WARNING_ARGS: -W "${{ inputs.python_warning_level }}" --continue-on-collection-errors run: | echo "fail_fast=${{ contains(inputs.python_warning_level, 'default') && 'default' || 'error' }}" >> $GITHUB_OUTPUT @@ -104,7 +106,7 @@ jobs: id: pytest_warning_flags run: | if [ "${{ inputs.python_warning_level }}" != "default" ]; then - echo "pytest_warning_args='-W \"${{ inputs.python_warning_level }}\" --continue-on-collection-errors'" >> $GITHUB_OUTPUT + echo "pytest_warning_args=${PYTEST_WARNING_ARGS}" >> $GITHUB_OUTPUT else echo "pytest_warning_args=''" >> $GITHUB_OUTPUT fi From 539a2b0c6b4466c4ed27805d845f538c1eba81eb Mon Sep 17 00:00:00 2001 From: Mudit Pandey Date: Fri, 24 Jan 2025 12:26:59 -0500 Subject: [PATCH 06/28] fingers crossed --- .github/workflows/interface-unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/interface-unit-tests.yml b/.github/workflows/interface-unit-tests.yml index 3ceb5bd09dc..b9308847fd6 100644 --- a/.github/workflows/interface-unit-tests.yml +++ b/.github/workflows/interface-unit-tests.yml @@ -106,7 +106,7 @@ jobs: id: pytest_warning_flags run: | if [ "${{ inputs.python_warning_level }}" != "default" ]; then - echo "pytest_warning_args=${PYTEST_WARNING_ARGS}" >> $GITHUB_OUTPUT + echo "pytest_warning_args=$PYTEST_WARNING_ARGS" >> $GITHUB_OUTPUT else echo "pytest_warning_args=''" >> $GITHUB_OUTPUT fi From 03f857dde3b9f7d2acaefb42af441f68a381d187 Mon Sep 17 00:00:00 2001 From: Mudit Pandey Date: Fri, 24 Jan 2025 12:32:03 -0500 Subject: [PATCH 07/28] Debugging --- .github/workflows/interface-unit-tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/interface-unit-tests.yml b/.github/workflows/interface-unit-tests.yml index b9308847fd6..8713ebdbba2 100644 --- a/.github/workflows/interface-unit-tests.yml +++ b/.github/workflows/interface-unit-tests.yml @@ -106,11 +106,14 @@ jobs: id: pytest_warning_flags run: | if [ "${{ inputs.python_warning_level }}" != "default" ]; then - echo "pytest_warning_args=$PYTEST_WARNING_ARGS" >> $GITHUB_OUTPUT + pytest_warning_args=$PYTEST_WARNING_ARGS else - echo "pytest_warning_args=''" >> $GITHUB_OUTPUT + pytest_warning_args="" fi + echo "pytest_warning_args=$pytest_warning_args" >> $GITHUB_OUTPUT + echo $pytest_warning_args + outputs: fail_fast: ${{ steps.mat_fail_fast.outputs.fail_fast }} pytest_warning_args: ${{ steps.pytest_warning_flags.outputs.pytest_warning_args }} From b96693c56727310c10d70baad7c4ea37c27e5912 Mon Sep 17 00:00:00 2001 From: Mudit Pandey Date: Fri, 24 Jan 2025 12:38:35 -0500 Subject: [PATCH 08/28] Whitespace --- .github/workflows/interface-unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/interface-unit-tests.yml b/.github/workflows/interface-unit-tests.yml index 8713ebdbba2..cc348032dad 100644 --- a/.github/workflows/interface-unit-tests.yml +++ b/.github/workflows/interface-unit-tests.yml @@ -142,7 +142,7 @@ jobs: then cat >python_versions.json <<-EOF { - "default": ["3.10"] + "default": ["3.10"] } EOF else From d99c058ccef264c290305c53834c559805d15670 Mon Sep 17 00:00:00 2001 From: Mudit Pandey Date: Fri, 24 Jan 2025 12:39:24 -0500 Subject: [PATCH 09/28] Invert conditions --- .github/workflows/interface-unit-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/interface-unit-tests.yml b/.github/workflows/interface-unit-tests.yml index cc348032dad..9cee61281a6 100644 --- a/.github/workflows/interface-unit-tests.yml +++ b/.github/workflows/interface-unit-tests.yml @@ -105,10 +105,10 @@ jobs: - name: Set pytest arguments for setting warnings level id: pytest_warning_flags run: | - if [ "${{ inputs.python_warning_level }}" != "default" ]; then - pytest_warning_args=$PYTEST_WARNING_ARGS - else + if [ "${{ inputs.python_warning_level }}" == "default" ]; then pytest_warning_args="" + else + pytest_warning_args=$PYTEST_WARNING_ARGS fi echo "pytest_warning_args=$pytest_warning_args" >> $GITHUB_OUTPUT From a1d4aad9617788a02b85a134230fcddf342b2f17 Mon Sep 17 00:00:00 2001 From: Mudit Pandey Date: Fri, 24 Jan 2025 12:42:14 -0500 Subject: [PATCH 10/28] Debugging --- .github/workflows/interface-unit-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/interface-unit-tests.yml b/.github/workflows/interface-unit-tests.yml index 9cee61281a6..a65eb84efd9 100644 --- a/.github/workflows/interface-unit-tests.yml +++ b/.github/workflows/interface-unit-tests.yml @@ -113,6 +113,9 @@ jobs: echo "pytest_warning_args=$pytest_warning_args" >> $GITHUB_OUTPUT echo $pytest_warning_args + echo "hi" + echo $PYTEST_WARNING_ARGS + exit 1 outputs: fail_fast: ${{ steps.mat_fail_fast.outputs.fail_fast }} From 5449d4967df2c27e8a50dca618fb2e2a0fcb5185 Mon Sep 17 00:00:00 2001 From: Mudit Pandey Date: Fri, 24 Jan 2025 12:47:39 -0500 Subject: [PATCH 11/28] Fix env var usage --- .github/workflows/interface-unit-tests.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/interface-unit-tests.yml b/.github/workflows/interface-unit-tests.yml index a65eb84efd9..5770dd59669 100644 --- a/.github/workflows/interface-unit-tests.yml +++ b/.github/workflows/interface-unit-tests.yml @@ -97,26 +97,22 @@ jobs: steps: - name: Set fail-fast for WAE id: mat_fail_fast - env: - PYTEST_WARNING_ARGS: -W "${{ inputs.python_warning_level }}" --continue-on-collection-errors run: | echo "fail_fast=${{ contains(inputs.python_warning_level, 'default') && 'default' || 'error' }}" >> $GITHUB_OUTPUT - name: Set pytest arguments for setting warnings level id: pytest_warning_flags + env: + PYTEST_WARNING_ARGS: -W "${{ inputs.python_warning_level }}" --continue-on-collection-errors run: | - if [ "${{ inputs.python_warning_level }}" == "default" ]; then - pytest_warning_args="" + if [ "${{ inputs.python_warning_level }}" != "default" ]; then + echo "Setting pytest warning flags" + echo "pytest_warning_args=$PYTEST_WARNING_ARGS" >> $GITHUB_OUTPUT else - pytest_warning_args=$PYTEST_WARNING_ARGS + echo "No pytest warning flags needed" + echo "pytest_warning_args=''" >> $GITHUB_OUTPUT fi - echo "pytest_warning_args=$pytest_warning_args" >> $GITHUB_OUTPUT - echo $pytest_warning_args - echo "hi" - echo $PYTEST_WARNING_ARGS - exit 1 - outputs: fail_fast: ${{ steps.mat_fail_fast.outputs.fail_fast }} pytest_warning_args: ${{ steps.pytest_warning_flags.outputs.pytest_warning_args }} From a6c24fdd78ca99c8bb8630aa0a1b25339a280ca2 Mon Sep 17 00:00:00 2001 From: Mudit Pandey Date: Fri, 24 Jan 2025 16:35:11 -0500 Subject: [PATCH 12/28] Try removing single quotes --- .github/workflows/interface-unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/interface-unit-tests.yml b/.github/workflows/interface-unit-tests.yml index 5770dd59669..e0d7e4a01b0 100644 --- a/.github/workflows/interface-unit-tests.yml +++ b/.github/workflows/interface-unit-tests.yml @@ -110,7 +110,7 @@ jobs: echo "pytest_warning_args=$PYTEST_WARNING_ARGS" >> $GITHUB_OUTPUT else echo "No pytest warning flags needed" - echo "pytest_warning_args=''" >> $GITHUB_OUTPUT + echo "pytest_warning_args=" >> $GITHUB_OUTPUT fi outputs: From d927800a8f69e8d858f44f5b97b169c938b1f433 Mon Sep 17 00:00:00 2001 From: andrijapau Date: Mon, 27 Jan 2025 13:10:06 -0500 Subject: [PATCH 13/28] Trigger CI From 1e5210f03912e45f03a40dcdda6de71d790e47f8 Mon Sep 17 00:00:00 2001 From: andrijapau Date: Mon, 27 Jan 2025 13:12:01 -0500 Subject: [PATCH 14/28] test: Add dummy deprecation --- pennylane/ops/op_math/sum.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pennylane/ops/op_math/sum.py b/pennylane/ops/op_math/sum.py index 0dfdd8980f0..cd7bb10ca33 100644 --- a/pennylane/ops/op_math/sum.py +++ b/pennylane/ops/op_math/sum.py @@ -520,6 +520,7 @@ def compute_grouping(self, grouping_type="qwc", method="lf"): >>> op.grouping_indices ((2,), (0, 1)) """ + warnings.warn("This is a test", qml.PennyLaneDeprecationWarning) if not self.pauli_rep: raise ValueError("Cannot compute grouping for Sums containing non-Pauli operators.") From ce018e8532e958769445684964e31386bf5323b9 Mon Sep 17 00:00:00 2001 From: andrijapau Date: Mon, 27 Jan 2025 13:39:44 -0500 Subject: [PATCH 15/28] test: Add another deprecation to get all of the devices tests --- pennylane/workflow/qnode.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pennylane/workflow/qnode.py b/pennylane/workflow/qnode.py index 0929bc5bb8d..2540a1b394d 100644 --- a/pennylane/workflow/qnode.py +++ b/pennylane/workflow/qnode.py @@ -541,6 +541,11 @@ def __init__( if not isinstance(device, qml.devices.Device): device = qml.devices.LegacyDeviceFacade(device) + warnings.warn( + "This is yet another test.", + qml.PennyLaneDeprecationWarning, + ) + gradient_kwargs = gradient_kwargs or {} if kwargs: if any(k in qml.gradients.SUPPORTED_GRADIENT_KWARGS for k in list(kwargs.keys())): From 0a42133bb7619182f96319677378fb4cb6304de8 Mon Sep 17 00:00:00 2001 From: andrijapau Date: Mon, 27 Jan 2025 14:07:59 -0500 Subject: [PATCH 16/28] fix: Update pytest.ini --- pennylane/devices/tests/pytest.ini | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pennylane/devices/tests/pytest.ini b/pennylane/devices/tests/pytest.ini index 21b3865680d..ede4dbca5f3 100644 --- a/pennylane/devices/tests/pytest.ini +++ b/pennylane/devices/tests/pytest.ini @@ -1,3 +1,10 @@ [pytest] markers = skip_unsupported: skip a test if it uses an operation unsupported on a device +filterwarnings = + ignore::DeprecationWarning:autograd.numpy.numpy_wrapper + ignore:Casting complex values to real::autograd.numpy.numpy_wrapper + ignore:Casting complex values to real discards the imaginary part:UserWarning:torch.autograd + ignore:Call to deprecated create function:DeprecationWarning + ignore:the imp module is deprecated:DeprecationWarning + error::pennylane.PennyLaneDeprecationWarning \ No newline at end of file From aced108867561c05774203e6e1747f5adc871b88 Mon Sep 17 00:00:00 2001 From: andrijapau Date: Mon, 27 Jan 2025 14:08:10 -0500 Subject: [PATCH 17/28] fix: Update pytest.ini --- pennylane/devices/tests/pytest.ini | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pennylane/devices/tests/pytest.ini b/pennylane/devices/tests/pytest.ini index ede4dbca5f3..16a2ed9146a 100644 --- a/pennylane/devices/tests/pytest.ini +++ b/pennylane/devices/tests/pytest.ini @@ -2,9 +2,4 @@ markers = skip_unsupported: skip a test if it uses an operation unsupported on a device filterwarnings = - ignore::DeprecationWarning:autograd.numpy.numpy_wrapper - ignore:Casting complex values to real::autograd.numpy.numpy_wrapper - ignore:Casting complex values to real discards the imaginary part:UserWarning:torch.autograd - ignore:Call to deprecated create function:DeprecationWarning - ignore:the imp module is deprecated:DeprecationWarning error::pennylane.PennyLaneDeprecationWarning \ No newline at end of file From 8972255e0299808f152f5ec224968b65329b73da Mon Sep 17 00:00:00 2001 From: andrijapau Date: Mon, 27 Jan 2025 14:19:47 -0500 Subject: [PATCH 18/28] Revert "test: Add dummy deprecation" This reverts commit 1e5210f03912e45f03a40dcdda6de71d790e47f8. --- pennylane/ops/op_math/sum.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pennylane/ops/op_math/sum.py b/pennylane/ops/op_math/sum.py index cd7bb10ca33..0dfdd8980f0 100644 --- a/pennylane/ops/op_math/sum.py +++ b/pennylane/ops/op_math/sum.py @@ -520,7 +520,6 @@ def compute_grouping(self, grouping_type="qwc", method="lf"): >>> op.grouping_indices ((2,), (0, 1)) """ - warnings.warn("This is a test", qml.PennyLaneDeprecationWarning) if not self.pauli_rep: raise ValueError("Cannot compute grouping for Sums containing non-Pauli operators.") From 671994e65f4d7dfc96bb663bf77f8f049aef7532 Mon Sep 17 00:00:00 2001 From: andrijapau Date: Mon, 27 Jan 2025 14:19:55 -0500 Subject: [PATCH 19/28] Revert "test: Add another deprecation to get all of the devices tests" This reverts commit ce018e8532e958769445684964e31386bf5323b9. --- pennylane/workflow/qnode.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pennylane/workflow/qnode.py b/pennylane/workflow/qnode.py index 2540a1b394d..0929bc5bb8d 100644 --- a/pennylane/workflow/qnode.py +++ b/pennylane/workflow/qnode.py @@ -541,11 +541,6 @@ def __init__( if not isinstance(device, qml.devices.Device): device = qml.devices.LegacyDeviceFacade(device) - warnings.warn( - "This is yet another test.", - qml.PennyLaneDeprecationWarning, - ) - gradient_kwargs = gradient_kwargs or {} if kwargs: if any(k in qml.gradients.SUPPORTED_GRADIENT_KWARGS for k in list(kwargs.keys())): From 9fcf5d008e7679f6a13323783a72ba5accc5ded5 Mon Sep 17 00:00:00 2001 From: Andrija Paurevic <46359773+andrijapau@users.noreply.github.com> Date: Mon, 27 Jan 2025 14:20:26 -0500 Subject: [PATCH 20/28] Update pennylane/devices/tests/pytest.ini --- pennylane/devices/tests/pytest.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pennylane/devices/tests/pytest.ini b/pennylane/devices/tests/pytest.ini index 16a2ed9146a..8b7f5f5aff7 100644 --- a/pennylane/devices/tests/pytest.ini +++ b/pennylane/devices/tests/pytest.ini @@ -2,4 +2,5 @@ markers = skip_unsupported: skip a test if it uses an operation unsupported on a device filterwarnings = - error::pennylane.PennyLaneDeprecationWarning \ No newline at end of file + error::pennylane.PennyLaneDeprecationWarning + \ No newline at end of file From 4b1235251ce86fba1ef5b0abd8234d60310cf074 Mon Sep 17 00:00:00 2001 From: andrijapau Date: Mon, 27 Jan 2025 15:02:26 -0500 Subject: [PATCH 21/28] Trigger CI From 5a046434bf2e05733cc121fff6debeba89f1d90c Mon Sep 17 00:00:00 2001 From: andrijapau Date: Mon, 27 Jan 2025 16:44:01 -0500 Subject: [PATCH 22/28] Trigger CI From 850600122acfa2243dff8108cf0108645f8bf177 Mon Sep 17 00:00:00 2001 From: andrijapau Date: Tue, 28 Jan 2025 10:49:58 -0500 Subject: [PATCH 23/28] Trigger CI From f0c2cec6f39fa094b5e5576b5318a59e31148102 Mon Sep 17 00:00:00 2001 From: andrijapau Date: Tue, 28 Jan 2025 13:35:08 -0500 Subject: [PATCH 24/28] revert pytest.ini to what it was --- pennylane/devices/tests/pytest.ini | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pennylane/devices/tests/pytest.ini b/pennylane/devices/tests/pytest.ini index 8b7f5f5aff7..5a4ae34c8ae 100644 --- a/pennylane/devices/tests/pytest.ini +++ b/pennylane/devices/tests/pytest.ini @@ -1,6 +1,3 @@ [pytest] markers = - skip_unsupported: skip a test if it uses an operation unsupported on a device -filterwarnings = - error::pennylane.PennyLaneDeprecationWarning - \ No newline at end of file + skip_unsupported: skip a test if it uses an operation unsupported on a device \ No newline at end of file From 08903b4de3810d304e093a4b2fb9e6cb929acd05 Mon Sep 17 00:00:00 2001 From: andrijapau Date: Thu, 30 Jan 2025 10:52:10 -0500 Subject: [PATCH 25/28] Revert "revert pytest.ini to what it was" This reverts commit f0c2cec6f39fa094b5e5576b5318a59e31148102. --- pennylane/devices/tests/pytest.ini | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pennylane/devices/tests/pytest.ini b/pennylane/devices/tests/pytest.ini index 5a4ae34c8ae..8b7f5f5aff7 100644 --- a/pennylane/devices/tests/pytest.ini +++ b/pennylane/devices/tests/pytest.ini @@ -1,3 +1,6 @@ [pytest] markers = - skip_unsupported: skip a test if it uses an operation unsupported on a device \ No newline at end of file + skip_unsupported: skip a test if it uses an operation unsupported on a device +filterwarnings = + error::pennylane.PennyLaneDeprecationWarning + \ No newline at end of file From 5386f9c359b0a0f35fb655f8c8c95b6ffbfdf899 Mon Sep 17 00:00:00 2001 From: andrijapau Date: Thu, 30 Jan 2025 13:17:26 -0500 Subject: [PATCH 26/28] Revert "Revert "revert pytest.ini to what it was"" This reverts commit 08903b4de3810d304e093a4b2fb9e6cb929acd05. --- pennylane/devices/tests/pytest.ini | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pennylane/devices/tests/pytest.ini b/pennylane/devices/tests/pytest.ini index 8b7f5f5aff7..5a4ae34c8ae 100644 --- a/pennylane/devices/tests/pytest.ini +++ b/pennylane/devices/tests/pytest.ini @@ -1,6 +1,3 @@ [pytest] markers = - skip_unsupported: skip a test if it uses an operation unsupported on a device -filterwarnings = - error::pennylane.PennyLaneDeprecationWarning - \ No newline at end of file + skip_unsupported: skip a test if it uses an operation unsupported on a device \ No newline at end of file From bf5d1df79cb11e2c4f904ed047bdda19f14a3843 Mon Sep 17 00:00:00 2001 From: andrijapau Date: Mon, 3 Feb 2025 10:36:40 -0500 Subject: [PATCH 27/28] Trigger CI From 1ba716af1a888f8c47156e12be91e79a7fb172a6 Mon Sep 17 00:00:00 2001 From: Andrija Paurevic <46359773+andrijapau@users.noreply.github.com> Date: Mon, 3 Feb 2025 13:10:36 -0500 Subject: [PATCH 28/28] Update pennylane/devices/tests/pytest.ini Co-authored-by: Astral Cai --- pennylane/devices/tests/pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pennylane/devices/tests/pytest.ini b/pennylane/devices/tests/pytest.ini index 5a4ae34c8ae..21b3865680d 100644 --- a/pennylane/devices/tests/pytest.ini +++ b/pennylane/devices/tests/pytest.ini @@ -1,3 +1,3 @@ [pytest] markers = - skip_unsupported: skip a test if it uses an operation unsupported on a device \ No newline at end of file + skip_unsupported: skip a test if it uses an operation unsupported on a device