From 828fb1c9a81d2016e6a04c5e2cf01f47aaa1d6b4 Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Tue, 14 May 2024 18:18:13 -0700 Subject: [PATCH 1/9] Release pins from all pytest-related packages --- dev_tools/requirements/deps/pytest.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dev_tools/requirements/deps/pytest.txt b/dev_tools/requirements/deps/pytest.txt index 2b75d64136c..82492658da6 100644 --- a/dev_tools/requirements/deps/pytest.txt +++ b/dev_tools/requirements/deps/pytest.txt @@ -2,18 +2,16 @@ pytest pytest-asyncio -# pytest-cov 4.1.0 discards line hits in subprocess (coverage failures in #6208) -pytest-cov~=3.0 +pytest-cov pytest-randomly -# Notebook >=6.4.8 + coverage > 6.2 hangs CI: https://github.com/quantumlib/Cirq/issues/4897 -coverage<=6.2 +coverage # for parallel testing notebooks -pytest-xdist~=2.2.0 +pytest-xdist filelock~=3.1 # For testing time specific logic -freezegun~=0.3.15 +freezegun # For test_metadata_distributions_after_deprecated_submodule importlib-metadata From d73e88032c43266adf1d589356677697d67c338b Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Tue, 14 May 2024 18:33:38 -0700 Subject: [PATCH 2/9] Update expected output from `pytest --cov` invocation Newer version of `coverage` does not output warning on `annotate`. --- dev_tools/bash_scripts_test.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/dev_tools/bash_scripts_test.py b/dev_tools/bash_scripts_test.py index 12f6e8bcfa8..7b99107eb4b 100644 --- a/dev_tools/bash_scripts_test.py +++ b/dev_tools/bash_scripts_test.py @@ -346,8 +346,6 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory): assert result.stdout == ( 'INTERCEPTED check/pytest ' '--cov --cov-config=dev_tools/conf/.coveragerc\n' - 'The annotate command will be removed in a future version.\n' - 'Get in touch if you still use it: ned@nedbatchelder.com\n' 'No data to report.\n' 'INTERCEPTED ' 'python dev_tools/check_incremental_coverage_annotations.py HEAD\n' @@ -372,8 +370,6 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory): assert result.stdout == ( 'INTERCEPTED check/pytest ' '--cov --cov-config=dev_tools/conf/.coveragerc\n' - 'The annotate command will be removed in a future version.\n' - 'Get in touch if you still use it: ned@nedbatchelder.com\n' 'No data to report.\n' 'INTERCEPTED ' 'python dev_tools/check_incremental_coverage_annotations.py main\n' @@ -390,8 +386,6 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory): assert result.stdout == ( 'INTERCEPTED check/pytest ' '--cov --cov-config=dev_tools/conf/.coveragerc\n' - 'The annotate command will be removed in a future version.\n' - 'Get in touch if you still use it: ned@nedbatchelder.com\n' 'No data to report.\n' 'INTERCEPTED ' 'python dev_tools/check_incremental_coverage_annotations.py origin/main\n' @@ -408,8 +402,6 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory): assert result.stdout == ( 'INTERCEPTED check/pytest ' '--cov --cov-config=dev_tools/conf/.coveragerc\n' - 'The annotate command will be removed in a future version.\n' - 'Get in touch if you still use it: ned@nedbatchelder.com\n' 'No data to report.\n' 'INTERCEPTED ' 'python dev_tools/check_incremental_coverage_annotations.py upstream/main\n' @@ -426,8 +418,6 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory): assert result.stdout == ( 'INTERCEPTED check/pytest ' '--cov --cov-config=dev_tools/conf/.coveragerc\n' - 'The annotate command will be removed in a future version.\n' - 'Get in touch if you still use it: ned@nedbatchelder.com\n' 'No data to report.\n' 'INTERCEPTED ' 'python dev_tools/check_incremental_coverage_annotations.py upstream/main\n' @@ -456,8 +446,6 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory): assert result.stdout == ( 'INTERCEPTED check/pytest ' '--cov --cov-config=dev_tools/conf/.coveragerc\n' - 'The annotate command will be removed in a future version.\n' - 'Get in touch if you still use it: ned@nedbatchelder.com\n' 'No data to report.\n' 'INTERCEPTED ' 'python dev_tools/check_incremental_coverage_annotations.py HEAD\n' @@ -474,8 +462,6 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory): assert result.stdout == ( 'INTERCEPTED check/pytest ' '--cov --cov-config=dev_tools/conf/.coveragerc\n' - 'The annotate command will be removed in a future version.\n' - 'Get in touch if you still use it: ned@nedbatchelder.com\n' 'No data to report.\n' 'INTERCEPTED ' 'python dev_tools/check_incremental_coverage_annotations.py main\n' @@ -499,8 +485,6 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory): assert result.stdout.startswith( 'INTERCEPTED check/pytest ' '--cov --cov-config=dev_tools/conf/.coveragerc\n' - 'The annotate command will be removed in a future version.\n' - 'Get in touch if you still use it: ned@nedbatchelder.com\n' 'No data to report.\n' 'INTERCEPTED ' 'python dev_tools/check_incremental_coverage_annotations.py ' From f221f6dc76c8d6ad4c22e8bf4cee0c438e6adb9f Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Thu, 16 May 2024 13:31:02 -0700 Subject: [PATCH 3/9] REVERT ME - temporarily activate ci-daily in pull requests --- .github/workflows/ci-daily.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci-daily.yml b/.github/workflows/ci-daily.yml index 4748c3d90c2..dbea4be6ac1 100644 --- a/.github/workflows/ci-daily.yml +++ b/.github/workflows/ci-daily.yml @@ -4,6 +4,10 @@ on: schedule: # Checks out main by default. - cron: '0 0 * * *' + # FIXME - for PR testing only, remove before merge + pull_request: + branches: + - main concurrency: group: ${{ github.workflow }} From 900d098f7560c90d34b5eace598170c0bed8b69a Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Thu, 16 May 2024 13:32:40 -0700 Subject: [PATCH 4/9] Run ci-daily with Python 3.12 in addition to 3.10, 3.11 --- .github/workflows/ci-daily.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-daily.yml b/.github/workflows/ci-daily.yml index dbea4be6ac1..baf4e069521 100644 --- a/.github/workflows/ci-daily.yml +++ b/.github/workflows/ci-daily.yml @@ -18,7 +18,7 @@ jobs: name: Pytest Ubuntu strategy: matrix: - python-version: ['3.10', '3.11'] + python-version: ['3.10', '3.11', '3.12'] runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 @@ -48,7 +48,7 @@ jobs: name: Pytest Windows strategy: matrix: - python-version: ['3.10', '3.11'] + python-version: ['3.10', '3.11', '3.12'] runs-on: windows-2019 steps: - uses: actions/checkout@v4 @@ -74,7 +74,7 @@ jobs: name: Pytest MacOS strategy: matrix: - python-version: ['3.10', '3.11'] + python-version: ['3.10', '3.11', '3.12'] # TODO(#6577): upgrade to macos-latest when it runs Python 3.10 runs-on: macos-13 steps: From 06b28fc4aa2c554d6b7aeb1559d8ad68189b3b87 Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Thu, 16 May 2024 14:23:33 -0700 Subject: [PATCH 5/9] Bump up ipykernel~=6.28 and papermill~=2.4 First minor releases that are compatible with Python 3.12: - ipykernel-6.28.0 - papermill-2.4.0 --- dev_tools/requirements/deps/notebook.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev_tools/requirements/deps/notebook.txt b/dev_tools/requirements/deps/notebook.txt index 84ec065de0e..4dfa276d5b3 100644 --- a/dev_tools/requirements/deps/notebook.txt +++ b/dev_tools/requirements/deps/notebook.txt @@ -4,10 +4,10 @@ notebook>=6.4.1,<=6.4.7 # https://github.com/nteract/papermill/issues/519 -ipykernel==5.3.4 +ipykernel~=6.28 # for executing notebooks in tests -papermill~=2.3.2 +papermill~=2.4 # for notebooks that do `pip install cirq-core[contrib]` -r ../../../cirq-core/cirq/contrib/requirements.txt From 26817c5fdbd691c88ae02693c810810192b6fedb Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Thu, 16 May 2024 14:53:40 -0700 Subject: [PATCH 6/9] Bump up coverage~=7.4 coverage-7.4.0 is the first minor release with restored annotate command. --- dev_tools/requirements/deps/pytest.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev_tools/requirements/deps/pytest.txt b/dev_tools/requirements/deps/pytest.txt index 82492658da6..88a0d316b41 100644 --- a/dev_tools/requirements/deps/pytest.txt +++ b/dev_tools/requirements/deps/pytest.txt @@ -4,7 +4,7 @@ pytest pytest-asyncio pytest-cov pytest-randomly -coverage +coverage~=7.4 # for parallel testing notebooks pytest-xdist From b6e7384b5687b325dd31f9c45346e0e2566463c8 Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Thu, 16 May 2024 15:00:38 -0700 Subject: [PATCH 7/9] Bump up notebook~=7.1 notebook-7.1.0 is the first minor releases compatible with Python 3.12. --- dev_tools/requirements/deps/notebook.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dev_tools/requirements/deps/notebook.txt b/dev_tools/requirements/deps/notebook.txt index 4dfa276d5b3..00b9bfd92a8 100644 --- a/dev_tools/requirements/deps/notebook.txt +++ b/dev_tools/requirements/deps/notebook.txt @@ -1,7 +1,6 @@ -r ipython.txt -# Notebook >=6.4.8 + coverage > 6.2 hangs CI: https://github.com/quantumlib/Cirq/issues/4897 -notebook>=6.4.1,<=6.4.7 +notebook~=7.1 # https://github.com/nteract/papermill/issues/519 ipykernel~=6.28 From 0b647b13183890f0aa31694427a2eaaab9974095 Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Wed, 12 Jun 2024 18:16:21 -0700 Subject: [PATCH 8/9] Remove temporary requirements on jupyter-related packages Not necessary after #6281. --- dev_tools/requirements/deps/notebook.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dev_tools/requirements/deps/notebook.txt b/dev_tools/requirements/deps/notebook.txt index dfd0edb613f..8fea53bb411 100644 --- a/dev_tools/requirements/deps/notebook.txt +++ b/dev_tools/requirements/deps/notebook.txt @@ -12,8 +12,3 @@ papermill~=2.6 # assumed to be part of colab seaborn~=0.12 - -# TODO(#6281) - remove below after the merge of #6281 -jupyterlab~=4.0.13 -jupyterlab-server~=2.24.0 -nbformat~=5.10.4 From c117a6c6830d0287de8fe3e912bb3dc126899263 Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Wed, 12 Jun 2024 18:46:14 -0700 Subject: [PATCH 9/9] Revert "REVERT ME - temporarily activate ci-daily in pull requests" This reverts commit f221f6dc76c8d6ad4c22e8bf4cee0c438e6adb9f. --- .github/workflows/ci-daily.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci-daily.yml b/.github/workflows/ci-daily.yml index baf4e069521..c607d820b07 100644 --- a/.github/workflows/ci-daily.yml +++ b/.github/workflows/ci-daily.yml @@ -4,10 +4,6 @@ on: schedule: # Checks out main by default. - cron: '0 0 * * *' - # FIXME - for PR testing only, remove before merge - pull_request: - branches: - - main concurrency: group: ${{ github.workflow }}