From c1cc790ba1f87c98faeafc6deb866d53831f0392 Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Tue, 14 May 2024 13:30:54 -0700 Subject: [PATCH 1/6] 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 ff54976c0b67763df023dd280cb6e17965245377 Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Tue, 14 May 2024 23:46:30 -0700 Subject: [PATCH 2/6] Remove the ineffective `--no-clean` option This partially reverts #6593 --- dev_tools/packaging/isolated_packages_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev_tools/packaging/isolated_packages_test.py b/dev_tools/packaging/isolated_packages_test.py index 8c2d2865c4a..50b186f6b41 100644 --- a/dev_tools/packaging/isolated_packages_test.py +++ b/dev_tools/packaging/isolated_packages_test.py @@ -39,7 +39,7 @@ def test_isolated_packages(cloned_env, module): assert f'cirq-core=={module.version}' in module.install_requires result = shell_tools.run( - f"{env}/bin/pip install --no-clean ./{module.root} ./cirq-core".split(), + f"{env}/bin/pip install ./{module.root} ./cirq-core".split(), stderr=subprocess.PIPE, check=False, ) From 1238403ccb0bcd09b2c3f21827381c8e471aa50b Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Wed, 15 May 2024 11:45:22 -0700 Subject: [PATCH 3/6] Exclude cirq packages when comparing distributions before and after notebook test Cirq sources may be included in importlib.metadata.distributions. We exclude them from the check if pytest virtual environment changed. --- dev_tools/notebooks/notebook_test.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dev_tools/notebooks/notebook_test.py b/dev_tools/notebooks/notebook_test.py index 8c588fc1c5d..bcef1b0f991 100644 --- a/dev_tools/notebooks/notebook_test.py +++ b/dev_tools/notebooks/notebook_test.py @@ -26,6 +26,7 @@ import pytest from dev_tools import shell_tools +from dev_tools.modules import list_modules from dev_tools.notebooks import filter_notebooks, list_all_notebooks, rewrite_notebook from dev_tools.test_utils import only_on_posix @@ -63,9 +64,18 @@ def require_packages_not_changed(): Raise AssertionError if the pre-existing set of Python packages changes in any way. """ - packages_before = set((d.name, d.version) for d in importlib.metadata.distributions()) + cirq_packages = set(m.name for m in list_modules()).union(["cirq"]) + packages_before = set( + (d.name, d.version) + for d in importlib.metadata.distributions() + if d.name not in cirq_packages + ) yield - packages_after = set((d.name, d.version) for d in importlib.metadata.distributions()) + packages_after = set( + (d.name, d.version) + for d in importlib.metadata.distributions() + if d.name not in cirq_packages + ) assert packages_after == packages_before From 41863e5b4d47d645d0985b24a8c723cf4b10cb76 Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Wed, 15 May 2024 15:17:07 -0700 Subject: [PATCH 4/6] Use temporary copy of cirq-core in test_isolated_packages Avoid conflict between parallel builds of the cirq-core wheel. --- dev_tools/packaging/isolated_packages_test.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dev_tools/packaging/isolated_packages_test.py b/dev_tools/packaging/isolated_packages_test.py index 50b186f6b41..e30f4abc932 100644 --- a/dev_tools/packaging/isolated_packages_test.py +++ b/dev_tools/packaging/isolated_packages_test.py @@ -32,14 +32,22 @@ # the "isolation" fails and for example cirq-core would be on the PATH @mock.patch.dict(os.environ, {"PYTHONPATH": ""}) @pytest.mark.parametrize('module', list_modules(), ids=[m.name for m in list_modules()]) -def test_isolated_packages(cloned_env, module): +def test_isolated_packages(cloned_env, module, tmp_path): env = cloned_env("isolated_packages", *PACKAGES) if str(module.root) != "cirq-core": assert f'cirq-core=={module.version}' in module.install_requires + # TODO: Remove after upgrading package builds from setup.py to PEP-517 + # Create per-worker copy of cirq-core sources so that parallel builds + # of cirq-core wheel do not conflict. + opt_cirq_core = ( + [str(shutil.copytree("./cirq-core", tmp_path / "cirq-core"))] + if str(module.root) != "cirq-core" + else [] + ) result = shell_tools.run( - f"{env}/bin/pip install ./{module.root} ./cirq-core".split(), + [f"{env}/bin/pip", "install", f"./{module.root}", *opt_cirq_core], stderr=subprocess.PIPE, check=False, ) From cad05ec029e1dbb2a6613327f5387dc574636f7b Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Wed, 15 May 2024 23:58:13 -0700 Subject: [PATCH 5/6] Bump up seaborn~=0.12 seaborn-0.12.0 is the first version compatible with the current colormap API in the matplotlib. --- dev_tools/notebooks/isolated_notebook_test.py | 2 +- dev_tools/requirements/deps/notebook.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev_tools/notebooks/isolated_notebook_test.py b/dev_tools/notebooks/isolated_notebook_test.py index ee006d4ffba..66b8d276cc9 100644 --- a/dev_tools/notebooks/isolated_notebook_test.py +++ b/dev_tools/notebooks/isolated_notebook_test.py @@ -96,7 +96,7 @@ "papermill", "jupyter", # assumed to be part of colab - "seaborn~=0.11.1", + "seaborn~=0.12", ] diff --git a/dev_tools/requirements/deps/notebook.txt b/dev_tools/requirements/deps/notebook.txt index 12815f39353..84ec065de0e 100644 --- a/dev_tools/requirements/deps/notebook.txt +++ b/dev_tools/requirements/deps/notebook.txt @@ -13,4 +13,4 @@ papermill~=2.3.2 -r ../../../cirq-core/cirq/contrib/requirements.txt # assumed to be part of colab -seaborn~=0.11.1 +seaborn~=0.12 From 0cbc728013bd451f35b3350d91a1a468d436c7cd Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Thu, 16 May 2024 00:29:39 -0700 Subject: [PATCH 6/6] Revert "REVERT ME - temporarily activate ci-daily in pull requests" This reverts commit c1cc790ba1f87c98faeafc6deb866d53831f0392. --- .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 dbea4be6ac1..4748c3d90c2 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 }}