From 6c0d03821bac50df69f6c1e1c62b55dfd42517fa Mon Sep 17 00:00:00 2001 From: rwgk Date: Thu, 21 Dec 2023 14:51:38 -0800 Subject: [PATCH] Remove `pybind11-based` from generated module-level `__doc__`. Final minor cleanup step. The main change was cl/592058095. Last-minute codesearch: `pybind11.*__doc__ l:python case:yes` The only 4 matches are unrelated (pybind11/tests/test_modules.py). PiperOrigin-RevId: 592955483 --- clif/pybind11/generator.py | 3 +-- clif/testing/python/top_level_pass_test.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/clif/pybind11/generator.py b/clif/pybind11/generator.py index 85f22dfd..9ccb5cb1 100644 --- a/clif/pybind11/generator.py +++ b/clif/pybind11/generator.py @@ -193,8 +193,7 @@ def generate_from(self, ast: ast_pb2.AST): yield I + I + 'm.attr("__pyclif_codegen_mode__") = "pybind11";' for s in self._generate_import_modules(ast): yield I + s - yield I + I + ('m.doc() = "CLIF-generated pybind11-based module for ' - f'{ast.source}";') + yield I + I + f'm.doc() = "CLIF-generated module for {ast.source}";' if self._codegen_info.requires_status: yield I + I + ('pybind11::module_::import(' '"util.task.python.error");') diff --git a/clif/testing/python/top_level_pass_test.py b/clif/testing/python/top_level_pass_test.py index a7c28880..78e6ecb9 100644 --- a/clif/testing/python/top_level_pass_test.py +++ b/clif/testing/python/top_level_pass_test.py @@ -22,7 +22,7 @@ class TopLevelPassTest(absltest.TestCase): def testEmptyModule(self): self.assertRegexpMatches( # pylint: disable=deprecated-method top_level_pass.__doc__, - 'CLIF-generated .*module for .*top_level_pass.clif') + 'CLIF-generated module for .*top_level_pass.clif') self.assertIn(top_level_pass.__pyclif_codegen_mode__, ('c_api', 'pybind11'))