From 4f7766e597867625df5253e71b64b590629ad416 Mon Sep 17 00:00:00 2001 From: Aaron Abbott Date: Thu, 10 Feb 2022 19:42:15 +0000 Subject: [PATCH 1/2] Only check for public symbols in public packages --- scripts/public_symbols_checker.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/public_symbols_checker.py b/scripts/public_symbols_checker.py index 3be1c3ee8b9..d359008f1f7 100644 --- a/scripts/public_symbols_checker.py +++ b/scripts/public_symbols_checker.py @@ -34,10 +34,18 @@ def get_symbols(change_type, diff_lines_getter, prefix): ): b_file_path = diff_lines.b_blob.path + b_file_path_obj = Path(b_file_path) if ( - Path(b_file_path).suffix != ".py" + b_file_path_obj.suffix != ".py" or "opentelemetry" not in b_file_path + or any( + # single leading underscore + part[0] == "_" and part[1] != "_" + # tests directories + or part == "tests" + for part in b_file_path_obj.parts + ) ): continue From e9987e79a4bf276392a6c2f18d841e7ce3822372 Mon Sep 17 00:00:00 2001 From: Aaron Abbott Date: Thu, 10 Feb 2022 20:13:25 +0000 Subject: [PATCH 2/2] For demonstration only --- opentelemetry-api/tests/trace/test_status.py | 2 ++ opentelemetry-sdk/src/opentelemetry/sdk/_metrics/__init__.py | 2 ++ opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py | 2 ++ opentelemetry-sdk/src/opentelemetry/sdk/trace/testsfoo.py | 1 + 4 files changed, 7 insertions(+) create mode 100644 opentelemetry-sdk/src/opentelemetry/sdk/trace/testsfoo.py diff --git a/opentelemetry-api/tests/trace/test_status.py b/opentelemetry-api/tests/trace/test_status.py index 74da78d6c73..a6501790483 100644 --- a/opentelemetry-api/tests/trace/test_status.py +++ b/opentelemetry-api/tests/trace/test_status.py @@ -66,3 +66,5 @@ def test_description_and_non_error_status(self): ) self.assertIs(status.status_code, StatusCode.ERROR) self.assertEqual(status.description, "status description") + +Foo = "should not fail" diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/_metrics/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/_metrics/__init__.py index b3232b367e8..4d03b6edb90 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/_metrics/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/_metrics/__init__.py @@ -242,3 +242,5 @@ def get_meter( self._measurement_consumer, ) return self._meters[info] + +Foo = "Should not fail" diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py index c82fcb3927f..1431fec6cca 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py @@ -1165,3 +1165,5 @@ def force_flush(self, timeout_millis: int = 30000) -> bool: False if the timeout is exceeded, True otherwise. """ return self._active_span_processor.force_flush(timeout_millis) + +Foo = "should fail" diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/trace/testsfoo.py b/opentelemetry-sdk/src/opentelemetry/sdk/trace/testsfoo.py new file mode 100644 index 00000000000..c1ebdc152e4 --- /dev/null +++ b/opentelemetry-sdk/src/opentelemetry/sdk/trace/testsfoo.py @@ -0,0 +1 @@ +Foo = "should fail"