Skip to content

Commit

Permalink
Remove pybind11-based from generated module-level __doc__.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rwgk committed Jan 22, 2024
1 parent 02843bb commit 6c0d038
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions clif/pybind11/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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");')
Expand Down
2 changes: 1 addition & 1 deletion clif/testing/python/top_level_pass_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))


Expand Down

0 comments on commit 6c0d038

Please sign in to comment.