From 399df901324bec543247955a13b28bc41e6904db Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Sun, 15 Oct 2023 11:24:08 -0400 Subject: [PATCH 01/13] Separate pytest into two workflows Separate existing pytest workflow into a workflow for running tests and a workflow for calculating test coverage --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60c1d6d119d0..f4b12f2b4119 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,9 @@ jobs: --ignore=quantum/q_fourier_transform.py --ignore=project_euler/ --ignore=scripts/validate_solutions.py + - name: Check test coverage + run: pytest --cov-report=term-missing:skip-covered - --cov=. . + --cov=. - if: ${{ success() }} run: scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md From 3f52215d7c030bb9bc3fa7c932cbad2fc90ae0b7 Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Sun, 15 Oct 2023 11:42:04 -0400 Subject: [PATCH 02/13] Omit q_fourier_transform.py and validate_solutions.py from coverage reports q_fourier_transform.py and validate_solutions.py are already left out of testing, so they should be left out of coverage reports as well in order to not cause errors --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9c9262d77748..c4d77232fe01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -130,7 +130,9 @@ addopts = [ [tool.coverage.report] omit = [ ".env/*", - "project_euler/*" + "project_euler/*", + "quantum/q_fourier_transform.py", + "scripts/validate_solutions.py" ] sort = "Cover" From cf5e0913dd684b728573ee47a071f34f0c1a9e23 Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Sun, 15 Oct 2023 11:48:45 -0400 Subject: [PATCH 03/13] Update build.yml --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f4b12f2b4119..6aac09f5d72d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,8 +29,11 @@ jobs: --ignore=project_euler/ --ignore=scripts/validate_solutions.py - name: Check test coverage + # TODO: #8818 Re-enable quantum tests run: pytest --cov-report=term-missing:skip-covered --cov=. + --ignore=quantum/q_fourier_transform.py + --ignore=scripts/validate_solutions.py - if: ${{ success() }} run: scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md From 2681a0875d0f194e87b312d7543dfec491c494f1 Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Sun, 15 Oct 2023 11:59:04 -0400 Subject: [PATCH 04/13] Update build.yml --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6aac09f5d72d..8924b69af6a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,5 @@ jobs: run: pytest --cov-report=term-missing:skip-covered --cov=. - --ignore=quantum/q_fourier_transform.py - --ignore=scripts/validate_solutions.py - if: ${{ success() }} run: scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md From 8369cd9743c05bc2ac680c5372f067f27099be0d Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Sun, 15 Oct 2023 12:10:32 -0400 Subject: [PATCH 05/13] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8924b69af6a0..f404bd3269cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,6 @@ jobs: # TODO: #8818 Re-enable quantum tests run: pytest --cov-report=term-missing:skip-covered - --cov=. + --cov=. . - if: ${{ success() }} run: scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md From adc2ace5bfc199ce90eb0992007ed0fa69dfd5bb Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Sun, 15 Oct 2023 12:21:25 -0400 Subject: [PATCH 06/13] Update coverage confic in pyproject.toml Change [tool.coverage.report] to [tool.coverage.run]. The former omits files from only reporting, while the latter omits files from both measuring and reporting. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c4d77232fe01..8538763e11e4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -127,7 +127,7 @@ addopts = [ "--showlocals", ] -[tool.coverage.report] +[tool.coverage.run] omit = [ ".env/*", "project_euler/*", From 3f657cea256b6175f5bd3d3578b0f9d688c14338 Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Sun, 15 Oct 2023 12:41:05 -0400 Subject: [PATCH 07/13] Disable q_fourier_transform.py --- .github/workflows/build.yml | 6 ++---- pyproject.toml | 1 - ...ier_transform.py => q_fourier_transform.py.DISABLED.txt} | 0 3 files changed, 2 insertions(+), 5 deletions(-) rename quantum/{q_fourier_transform.py => q_fourier_transform.py.DISABLED.txt} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f404bd3269cc..5d3202d3db14 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,15 +23,13 @@ jobs: python -m pip install --upgrade pip setuptools six wheel python -m pip install pytest-cov -r requirements.txt - name: Run tests - # TODO: #8818 Re-enable quantum tests + # TODO: #8818 Re-enable quantum tests (files are currently disabled) run: pytest - --ignore=quantum/q_fourier_transform.py --ignore=project_euler/ --ignore=scripts/validate_solutions.py - name: Check test coverage - # TODO: #8818 Re-enable quantum tests run: pytest --cov-report=term-missing:skip-covered - --cov=. . + --cov=. - if: ${{ success() }} run: scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md diff --git a/pyproject.toml b/pyproject.toml index 8538763e11e4..e6b8fd45cfd8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -131,7 +131,6 @@ addopts = [ omit = [ ".env/*", "project_euler/*", - "quantum/q_fourier_transform.py", "scripts/validate_solutions.py" ] sort = "Cover" diff --git a/quantum/q_fourier_transform.py b/quantum/q_fourier_transform.py.DISABLED.txt similarity index 100% rename from quantum/q_fourier_transform.py rename to quantum/q_fourier_transform.py.DISABLED.txt From 57b9c3d9492e83a3b7e7bead049a8b82bfa09455 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Sun, 15 Oct 2023 16:41:19 +0000 Subject: [PATCH 08/13] updating DIRECTORY.md --- DIRECTORY.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index 6213f26b6d93..8cca758cc830 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -1111,9 +1111,6 @@ * Problem 800 * [Sol1](project_euler/problem_800/sol1.py) -## Quantum - * [Q Fourier Transform](quantum/q_fourier_transform.py) - ## Scheduling * [First Come First Served](scheduling/first_come_first_served.py) * [Highest Response Ratio Next](scheduling/highest_response_ratio_next.py) From 815cfc368743d113b4819c044b44a6f45b4cd908 Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Sun, 15 Oct 2023 12:47:33 -0400 Subject: [PATCH 09/13] Update pyproject.toml --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index e6b8fd45cfd8..f16ba0dd0b0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -133,6 +133,8 @@ omit = [ "project_euler/*", "scripts/validate_solutions.py" ] + +[tool.coverage.report] sort = "Cover" [tool.codespell] From 4eb8cd8d490e8e92ee904db1ba10c0b366e03e8c Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Sun, 15 Oct 2023 12:48:03 -0400 Subject: [PATCH 10/13] Update .github/workflows/build.yml Co-authored-by: Christian Clauss --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d3202d3db14..4c15427e40af 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: python -m pip install --upgrade pip setuptools six wheel python -m pip install pytest-cov -r requirements.txt - name: Run tests - # TODO: #8818 Re-enable quantum tests (files are currently disabled) + # TODO: #8818 Re-enable filenames ending with `.py.DISABLED`. run: pytest --ignore=project_euler/ --ignore=scripts/validate_solutions.py From 0e9d1e60144ce9cd63c89ee902b28676c43110e8 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Sun, 15 Oct 2023 17:14:42 +0000 Subject: [PATCH 11/13] updating DIRECTORY.md --- DIRECTORY.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index 8cca758cc830..ec901ea7e946 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -265,6 +265,7 @@ * [Postfix Evaluation](data_structures/stacks/postfix_evaluation.py) * [Prefix Evaluation](data_structures/stacks/prefix_evaluation.py) * [Stack](data_structures/stacks/stack.py) + * [Stack Using Two Queues](data_structures/stacks/stack_using_two_queues.py) * [Stack With Doubly Linked List](data_structures/stacks/stack_with_doubly_linked_list.py) * [Stack With Singly Linked List](data_structures/stacks/stack_with_singly_linked_list.py) * [Stock Span Problem](data_structures/stacks/stock_span_problem.py) @@ -791,7 +792,7 @@ ## Physics * [Altitude Pressure](physics/altitude_pressure.py) - * [Archimedes Principle](physics/archimedes_principle.py) + * [Archimedes Principle Of Buoyant Force](physics/archimedes_principle_of_buoyant_force.py) * [Basic Orbital Capture](physics/basic_orbital_capture.py) * [Casimir Effect](physics/casimir_effect.py) * [Centripetal Force](physics/centripetal_force.py) From 6204c6bdd3e5b07db04884d2600a74da38589ddd Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Sun, 15 Oct 2023 15:14:03 -0400 Subject: [PATCH 12/13] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c15427e40af..d141c7872d1c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,10 +26,10 @@ jobs: # TODO: #8818 Re-enable filenames ending with `.py.DISABLED`. run: pytest --ignore=project_euler/ - --ignore=scripts/validate_solutions.py + --ignore=scripts/validate_solutions.py . - name: Check test coverage run: pytest --cov-report=term-missing:skip-covered - --cov=. + --cov=. . - if: ${{ success() }} run: scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md From ca5a37566293aee0af793cb6776dc476abd315b6 Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Sun, 15 Oct 2023 15:46:40 -0400 Subject: [PATCH 13/13] Update build.yml --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d141c7872d1c..95c493553ae7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,8 @@ jobs: - name: Check test coverage run: pytest --cov-report=term-missing:skip-covered - --cov=. . + --cov=. + --ignore=project_euler/ + --ignore=scripts/validate_solutions.py . - if: ${{ success() }} run: scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md