From 079069fbe9d9b30cf82695667ad183621121e848 Mon Sep 17 00:00:00 2001 From: Adam Zalcman Date: Tue, 14 Dec 2021 11:44:52 -0800 Subject: [PATCH 1/4] Ignore deprecation warnings from protobufs --- conftest.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/conftest.py b/conftest.py index 265a447d02c..8b78a0affe5 100644 --- a/conftest.py +++ b/conftest.py @@ -13,6 +13,21 @@ # limitations under the License. +def pytest_configure(config): + # Ignore deprecation warnings in python code generated from our protobuf definitions. + # Eventually, the warnings will be removed by upgrading protoc compiler. However, at + # the moment upgrading breaks TensorFlow Quantum and therefore is deferred. + for f in ( + "FieldDescriptor", + "Descriptor", + "EnumDescriptor", + "EnumValueDescriptor", + "FileDescriptor", + "OneofDescriptor" + ): + config.addinivalue_line("filterwarnings", f"ignore:Call to deprecated create function {f}") + + def pytest_addoption(parser): parser.addoption( "--rigetti-integration", From f5e7b127cccfa8b860a900d21308567187e0af00 Mon Sep 17 00:00:00 2001 From: Adam Zalcman Date: Tue, 14 Dec 2021 11:47:07 -0800 Subject: [PATCH 2/4] Add issue refs --- conftest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index 8b78a0affe5..be928604d20 100644 --- a/conftest.py +++ b/conftest.py @@ -16,7 +16,8 @@ def pytest_configure(config): # Ignore deprecation warnings in python code generated from our protobuf definitions. # Eventually, the warnings will be removed by upgrading protoc compiler. However, at - # the moment upgrading breaks TensorFlow Quantum and therefore is deferred. + # the moment upgrading breaks TensorFlow Quantum and therefore is deferred. See issues + # #4161 and #4737. for f in ( "FieldDescriptor", "Descriptor", From 31d836faa6da9623b7a471d914ece81bc79607c4 Mon Sep 17 00:00:00 2001 From: Adam Zalcman Date: Tue, 14 Dec 2021 11:48:22 -0800 Subject: [PATCH 3/4] format --- conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index be928604d20..3f6cf8393cc 100644 --- a/conftest.py +++ b/conftest.py @@ -24,7 +24,7 @@ def pytest_configure(config): "EnumDescriptor", "EnumValueDescriptor", "FileDescriptor", - "OneofDescriptor" + "OneofDescriptor", ): config.addinivalue_line("filterwarnings", f"ignore:Call to deprecated create function {f}") From 2c54f07e6c9966d1e3bc3dfc7586804c80a7d040 Mon Sep 17 00:00:00 2001 From: Adam Zalcman Date: Tue, 14 Dec 2021 12:55:08 -0800 Subject: [PATCH 4/4] Update comment --- conftest.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conftest.py b/conftest.py index 3f6cf8393cc..e74e741ee54 100644 --- a/conftest.py +++ b/conftest.py @@ -15,8 +15,7 @@ def pytest_configure(config): # Ignore deprecation warnings in python code generated from our protobuf definitions. - # Eventually, the warnings will be removed by upgrading protoc compiler. However, at - # the moment upgrading breaks TensorFlow Quantum and therefore is deferred. See issues + # Eventually, the warnings will be removed by upgrading protoc compiler. See issues # #4161 and #4737. for f in ( "FieldDescriptor",