From 81a68d0c07f009a5c1ac2dd2b9915e6378972747 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 24 Jan 2025 01:02:41 +0000 Subject: [PATCH 1/2] docs: Minor documentation edits PiperOrigin-RevId: 719012138 Source-Link: https://github.com/googleapis/googleapis/commit/d196cb2d69e542020101d8a30f1e33497835a4f1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/900acb8906d3fa681136610bd5f335cef8f4368a Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFwcHMtc2NyaXB0LXR5cGUvLk93bEJvdC55YW1sIiwiaCI6IjkwMGFjYjg5MDZkM2ZhNjgxMTM2NjEwYmQ1ZjMzNWNlZjhmNDM2OGEifQ== --- .../calendar-py/.coveragerc | 13 + .../calendar-py/.flake8 | 33 ++ .../calendar-py/MANIFEST.in | 2 + .../calendar-py/README.rst | 49 +++ .../calendar-py/docs/_static/custom.css | 3 + .../calendar-py/docs/calendar/services_.rst | 4 + .../calendar-py/docs/calendar/types_.rst | 6 + .../calendar-py/docs/conf.py | 376 ++++++++++++++++++ .../calendar-py/docs/index.rst | 7 + .../apps/script/type/calendar/__init__.py | 30 ++ .../script/type/calendar/gapic_metadata.json | 7 + .../script/type/calendar/gapic_version.py | 16 + .../google/apps/script/type/calendar/py.typed | 2 + .../script/type/calendar/services/__init__.py | 15 + .../script/type/calendar/types/__init__.py | 26 ++ .../calendar/types/calendar_addon_manifest.py | 184 +++++++++ .../calendar-py/mypy.ini | 3 + .../calendar-py/noxfile.py | 280 +++++++++++++ .../scripts/fixup_calendar_keywords.py | 175 ++++++++ .../calendar-py/setup.py | 99 +++++ .../calendar-py/testing/constraints-3.10.txt | 7 + .../calendar-py/testing/constraints-3.11.txt | 7 + .../calendar-py/testing/constraints-3.12.txt | 7 + .../calendar-py/testing/constraints-3.13.txt | 7 + .../calendar-py/testing/constraints-3.7.txt | 11 + .../calendar-py/testing/constraints-3.8.txt | 7 + .../calendar-py/testing/constraints-3.9.txt | 7 + .../calendar-py/tests/__init__.py | 16 + .../calendar-py/tests/unit/__init__.py | 16 + .../calendar-py/tests/unit/gapic/__init__.py | 16 + .../tests/unit/gapic/calendar/__init__.py | 16 + .../docs-py/.coveragerc | 13 + .../google-apps-script-type/docs-py/.flake8 | 33 ++ .../docs-py/MANIFEST.in | 2 + .../docs-py/README.rst | 49 +++ .../docs-py/docs/_static/custom.css | 3 + .../docs-py/docs/conf.py | 376 ++++++++++++++++++ .../docs-py/docs/docs/services_.rst | 4 + .../docs-py/docs/docs/types_.rst | 6 + .../docs-py/docs/index.rst | 7 + .../google/apps/script/type/docs/__init__.py | 28 ++ .../apps/script/type/docs/gapic_metadata.json | 7 + .../apps/script/type/docs/gapic_version.py | 16 + .../google/apps/script/type/docs/py.typed | 2 + .../script/type/docs/services/__init__.py | 15 + .../apps/script/type/docs/types/__init__.py | 24 ++ .../type/docs/types/docs_addon_manifest.py | 74 ++++ .../google-apps-script-type/docs-py/mypy.ini | 3 + .../docs-py/noxfile.py | 280 +++++++++++++ .../docs-py/scripts/fixup_docs_keywords.py | 175 ++++++++ .../google-apps-script-type/docs-py/setup.py | 99 +++++ .../docs-py/testing/constraints-3.10.txt | 7 + .../docs-py/testing/constraints-3.11.txt | 7 + .../docs-py/testing/constraints-3.12.txt | 7 + .../docs-py/testing/constraints-3.13.txt | 7 + .../docs-py/testing/constraints-3.7.txt | 11 + .../docs-py/testing/constraints-3.8.txt | 7 + .../docs-py/testing/constraints-3.9.txt | 7 + .../docs-py/tests/__init__.py | 16 + .../docs-py/tests/unit/__init__.py | 16 + .../docs-py/tests/unit/gapic/__init__.py | 16 + .../docs-py/tests/unit/gapic/docs/__init__.py | 16 + .../drive-py/.coveragerc | 13 + .../google-apps-script-type/drive-py/.flake8 | 33 ++ .../drive-py/MANIFEST.in | 2 + .../drive-py/README.rst | 49 +++ .../drive-py/docs/_static/custom.css | 3 + .../drive-py/docs/conf.py | 376 ++++++++++++++++++ .../drive-py/docs/drive/services_.rst | 4 + .../drive-py/docs/drive/types_.rst | 6 + .../drive-py/docs/index.rst | 7 + .../google/apps/script/type/drive/__init__.py | 28 ++ .../script/type/drive/gapic_metadata.json | 7 + .../apps/script/type/drive/gapic_version.py | 16 + .../google/apps/script/type/drive/py.typed | 2 + .../script/type/drive/services/__init__.py | 15 + .../apps/script/type/drive/types/__init__.py | 24 ++ .../type/drive/types/drive_addon_manifest.py | 76 ++++ .../google-apps-script-type/drive-py/mypy.ini | 3 + .../drive-py/noxfile.py | 280 +++++++++++++ .../drive-py/scripts/fixup_drive_keywords.py | 175 ++++++++ .../google-apps-script-type/drive-py/setup.py | 99 +++++ .../drive-py/testing/constraints-3.10.txt | 7 + .../drive-py/testing/constraints-3.11.txt | 7 + .../drive-py/testing/constraints-3.12.txt | 7 + .../drive-py/testing/constraints-3.13.txt | 7 + .../drive-py/testing/constraints-3.7.txt | 11 + .../drive-py/testing/constraints-3.8.txt | 7 + .../drive-py/testing/constraints-3.9.txt | 7 + .../drive-py/tests/__init__.py | 16 + .../drive-py/tests/unit/__init__.py | 16 + .../drive-py/tests/unit/gapic/__init__.py | 16 + .../tests/unit/gapic/drive/__init__.py | 16 + .../gmail-py/.coveragerc | 13 + .../google-apps-script-type/gmail-py/.flake8 | 33 ++ .../gmail-py/MANIFEST.in | 2 + .../gmail-py/README.rst | 49 +++ .../gmail-py/docs/_static/custom.css | 3 + .../gmail-py/docs/conf.py | 376 ++++++++++++++++++ .../gmail-py/docs/gmail/services_.rst | 4 + .../gmail-py/docs/gmail/types_.rst | 6 + .../gmail-py/docs/index.rst | 7 + .../google/apps/script/type/gmail/__init__.py | 34 ++ .../script/type/gmail/gapic_metadata.json | 7 + .../apps/script/type/gmail/gapic_version.py | 16 + .../google/apps/script/type/gmail/py.typed | 2 + .../script/type/gmail/services/__init__.py | 15 + .../apps/script/type/gmail/types/__init__.py | 30 ++ .../type/gmail/types/gmail_addon_manifest.py | 232 +++++++++++ .../google-apps-script-type/gmail-py/mypy.ini | 3 + .../gmail-py/noxfile.py | 280 +++++++++++++ .../gmail-py/scripts/fixup_gmail_keywords.py | 175 ++++++++ .../google-apps-script-type/gmail-py/setup.py | 99 +++++ .../gmail-py/testing/constraints-3.10.txt | 7 + .../gmail-py/testing/constraints-3.11.txt | 7 + .../gmail-py/testing/constraints-3.12.txt | 7 + .../gmail-py/testing/constraints-3.13.txt | 7 + .../gmail-py/testing/constraints-3.7.txt | 11 + .../gmail-py/testing/constraints-3.8.txt | 7 + .../gmail-py/testing/constraints-3.9.txt | 7 + .../gmail-py/tests/__init__.py | 16 + .../gmail-py/tests/unit/__init__.py | 16 + .../gmail-py/tests/unit/gapic/__init__.py | 16 + .../tests/unit/gapic/gmail/__init__.py | 16 + .../sheets-py/.coveragerc | 13 + .../google-apps-script-type/sheets-py/.flake8 | 33 ++ .../sheets-py/MANIFEST.in | 2 + .../sheets-py/README.rst | 49 +++ .../sheets-py/docs/_static/custom.css | 3 + .../sheets-py/docs/conf.py | 376 ++++++++++++++++++ .../sheets-py/docs/index.rst | 7 + .../sheets-py/docs/sheets/services_.rst | 4 + .../sheets-py/docs/sheets/types_.rst | 6 + .../apps/script/type/sheets/__init__.py | 28 ++ .../script/type/sheets/gapic_metadata.json | 7 + .../apps/script/type/sheets/gapic_version.py | 16 + .../google/apps/script/type/sheets/py.typed | 2 + .../script/type/sheets/services/__init__.py | 15 + .../apps/script/type/sheets/types/__init__.py | 24 ++ .../sheets/types/sheets_addon_manifest.py | 74 ++++ .../sheets-py/mypy.ini | 3 + .../sheets-py/noxfile.py | 280 +++++++++++++ .../scripts/fixup_sheets_keywords.py | 175 ++++++++ .../sheets-py/setup.py | 99 +++++ .../sheets-py/testing/constraints-3.10.txt | 7 + .../sheets-py/testing/constraints-3.11.txt | 7 + .../sheets-py/testing/constraints-3.12.txt | 7 + .../sheets-py/testing/constraints-3.13.txt | 7 + .../sheets-py/testing/constraints-3.7.txt | 11 + .../sheets-py/testing/constraints-3.8.txt | 7 + .../sheets-py/testing/constraints-3.9.txt | 7 + .../sheets-py/tests/__init__.py | 16 + .../sheets-py/tests/unit/__init__.py | 16 + .../sheets-py/tests/unit/gapic/__init__.py | 16 + .../tests/unit/gapic/sheets/__init__.py | 16 + .../slides-py/.coveragerc | 13 + .../google-apps-script-type/slides-py/.flake8 | 33 ++ .../slides-py/MANIFEST.in | 2 + .../slides-py/README.rst | 49 +++ .../slides-py/docs/_static/custom.css | 3 + .../slides-py/docs/conf.py | 376 ++++++++++++++++++ .../slides-py/docs/index.rst | 7 + .../slides-py/docs/slides/services_.rst | 4 + .../slides-py/docs/slides/types_.rst | 6 + .../apps/script/type/slides/__init__.py | 28 ++ .../script/type/slides/gapic_metadata.json | 7 + .../apps/script/type/slides/gapic_version.py | 16 + .../google/apps/script/type/slides/py.typed | 2 + .../script/type/slides/services/__init__.py | 15 + .../apps/script/type/slides/types/__init__.py | 24 ++ .../slides/types/slides_addon_manifest.py | 74 ++++ .../slides-py/mypy.ini | 3 + .../slides-py/noxfile.py | 280 +++++++++++++ .../scripts/fixup_slides_keywords.py | 175 ++++++++ .../slides-py/setup.py | 99 +++++ .../slides-py/testing/constraints-3.10.txt | 7 + .../slides-py/testing/constraints-3.11.txt | 7 + .../slides-py/testing/constraints-3.12.txt | 7 + .../slides-py/testing/constraints-3.13.txt | 7 + .../slides-py/testing/constraints-3.7.txt | 11 + .../slides-py/testing/constraints-3.8.txt | 7 + .../slides-py/testing/constraints-3.9.txt | 7 + .../slides-py/tests/__init__.py | 16 + .../slides-py/tests/unit/__init__.py | 16 + .../slides-py/tests/unit/gapic/__init__.py | 16 + .../tests/unit/gapic/slides/__init__.py | 16 + .../type-py/.coveragerc | 13 + .../google-apps-script-type/type-py/.flake8 | 33 ++ .../type-py/MANIFEST.in | 2 + .../type-py/README.rst | 49 +++ .../type-py/docs/_static/custom.css | 3 + .../type-py/docs/conf.py | 376 ++++++++++++++++++ .../type-py/docs/index.rst | 7 + .../type-py/docs/type/services_.rst | 4 + .../type-py/docs/type/types_.rst | 6 + .../google/apps/script/type/__init__.py | 40 ++ .../apps/script/type/gapic_metadata.json | 7 + .../google/apps/script/type/gapic_version.py | 16 + .../type-py/google/apps/script/type/py.typed | 2 + .../apps/script/type/services/__init__.py | 15 + .../google/apps/script/type/types/__init__.py | 40 ++ .../script/type/types/addon_widget_set.py | 78 ++++ .../apps/script/type/types/extension_point.py | 139 +++++++ .../apps/script/type/types/script_manifest.py | 186 +++++++++ .../google-apps-script-type/type-py/mypy.ini | 3 + .../type-py/noxfile.py | 280 +++++++++++++ .../type-py/scripts/fixup_type_keywords.py | 175 ++++++++ .../google-apps-script-type/type-py/setup.py | 98 +++++ .../type-py/testing/constraints-3.10.txt | 6 + .../type-py/testing/constraints-3.11.txt | 6 + .../type-py/testing/constraints-3.12.txt | 6 + .../type-py/testing/constraints-3.13.txt | 6 + .../type-py/testing/constraints-3.7.txt | 10 + .../type-py/testing/constraints-3.8.txt | 6 + .../type-py/testing/constraints-3.9.txt | 6 + .../type-py/tests/__init__.py | 16 + .../type-py/tests/unit/__init__.py | 16 + .../type-py/tests/unit/gapic/__init__.py | 16 + .../type-py/tests/unit/gapic/type/__init__.py | 16 + 219 files changed, 9966 insertions(+) create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/.coveragerc create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/.flake8 create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/MANIFEST.in create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/README.rst create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/docs/_static/custom.css create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/services_.rst create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/types_.rst create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/docs/conf.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/docs/index.rst create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/mypy.ini create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/noxfile.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/scripts/fixup_calendar_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/setup.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.10.txt create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.11.txt create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.12.txt create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.13.txt create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.7.txt create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.8.txt create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.9.txt create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/tests/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/calendar/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/.coveragerc create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/.flake8 create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/MANIFEST.in create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/README.rst create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/docs/_static/custom.css create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/docs/conf.py create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/docs/docs/services_.rst create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/docs/docs/types_.rst create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/docs/index.rst create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/docs_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/mypy.ini create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/noxfile.py create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/scripts/fixup_docs_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/setup.py create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.10.txt create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.11.txt create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.12.txt create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.13.txt create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.7.txt create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.8.txt create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.9.txt create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/tests/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/tests/unit/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/docs/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/.coveragerc create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/.flake8 create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/MANIFEST.in create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/README.rst create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/docs/_static/custom.css create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/docs/conf.py create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/docs/drive/services_.rst create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/docs/drive/types_.rst create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/docs/index.rst create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/drive_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/mypy.ini create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/noxfile.py create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/scripts/fixup_drive_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/setup.py create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.10.txt create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.11.txt create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.12.txt create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.13.txt create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.7.txt create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.8.txt create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.9.txt create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/tests/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/tests/unit/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/drive/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/.coveragerc create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/.flake8 create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/MANIFEST.in create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/README.rst create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/docs/_static/custom.css create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/docs/conf.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/services_.rst create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/types_.rst create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/docs/index.rst create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/mypy.ini create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/noxfile.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/scripts/fixup_gmail_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/setup.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.10.txt create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.11.txt create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.12.txt create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.13.txt create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.7.txt create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.8.txt create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.9.txt create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/tests/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/gmail/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/.coveragerc create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/.flake8 create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/MANIFEST.in create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/README.rst create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/docs/_static/custom.css create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/docs/conf.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/docs/index.rst create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/services_.rst create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/types_.rst create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/mypy.ini create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/noxfile.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/scripts/fixup_sheets_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/setup.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.10.txt create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.11.txt create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.12.txt create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.13.txt create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.7.txt create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.8.txt create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.9.txt create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/tests/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/sheets/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/.coveragerc create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/.flake8 create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/MANIFEST.in create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/README.rst create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/docs/_static/custom.css create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/docs/conf.py create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/docs/index.rst create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/docs/slides/services_.rst create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/docs/slides/types_.rst create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/slides_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/mypy.ini create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/noxfile.py create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/scripts/fixup_slides_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/setup.py create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.10.txt create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.11.txt create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.12.txt create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.13.txt create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.7.txt create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.8.txt create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.9.txt create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/tests/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/tests/unit/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/slides/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/.coveragerc create mode 100644 owl-bot-staging/google-apps-script-type/type-py/.flake8 create mode 100644 owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in create mode 100644 owl-bot-staging/google-apps-script-type/type-py/README.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/conf.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/index.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/type/services_.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/type/types_.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/mypy.ini create mode 100644 owl-bot-staging/google-apps-script-type/type-py/noxfile.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/setup.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.13.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/.coveragerc b/owl-bot-staging/google-apps-script-type/calendar-py/.coveragerc new file mode 100644 index 000000000000..d4b802b28cd6 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/apps/script/type/calendar/__init__.py + google/apps/script/type/calendar/gapic_version.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/.flake8 b/owl-bot-staging/google-apps-script-type/calendar-py/.flake8 new file mode 100644 index 000000000000..29227d4cf419 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/calendar-py/MANIFEST.in new file mode 100644 index 000000000000..cf01681dbb35 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/apps/script/type/calendar *.py +recursive-include google/apps/script/type/calendar *.py diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/README.rst b/owl-bot-staging/google-apps-script-type/calendar-py/README.rst new file mode 100644 index 000000000000..199f54ef3956 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Apps Script Type Calendar API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Apps Script Type Calendar API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/calendar-py/docs/_static/custom.css new file mode 100644 index 000000000000..06423be0b592 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/docs/_static/custom.css @@ -0,0 +1,3 @@ +dl.field-list > dt { + min-width: 100px +} diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/services_.rst b/owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/services_.rst new file mode 100644 index 000000000000..3f8cdc1e081a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/services_.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Calendar API +================================================== +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/types_.rst b/owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/types_.rst new file mode 100644 index 000000000000..5d78802c53ab --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/types_.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Calendar API +=============================================== + +.. automodule:: google.apps.script.type.calendar.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/calendar-py/docs/conf.py new file mode 100644 index 000000000000..04d0bec0d90a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# google-apps-script-type-calendar documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-apps-script-type-calendar" +copyright = u"2023, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Apps Script Type Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-apps-script-type-calendar-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-apps-script-type-calendar.tex", + u"google-apps-script-type-calendar Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-apps-script-type-calendar", + u"Google Apps Script Type Calendar Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-apps-script-type-calendar", + u"google-apps-script-type-calendar Documentation", + author, + "google-apps-script-type-calendar", + "GAPIC library for Google Apps Script Type Calendar API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/calendar-py/docs/index.rst new file mode 100644 index 000000000000..e0b99eedd868 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + calendar/services_ + calendar/types_ diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/__init__.py b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/__init__.py new file mode 100644 index 000000000000..d1d87a00493a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/__init__.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.calendar import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.calendar_addon_manifest import CalendarAddOnManifest +from .types.calendar_addon_manifest import CalendarExtensionPoint +from .types.calendar_addon_manifest import ConferenceSolution + +__all__ = ( +'CalendarAddOnManifest', +'CalendarExtensionPoint', +'ConferenceSolution', +) diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_metadata.json new file mode 100644 index 000000000000..c2cc763ffc99 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.calendar", + "protoPackage": "google.apps.script.type.calendar", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_version.py b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_version.py new file mode 100644 index 000000000000..558c8aab67c5 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/py.typed b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/py.typed new file mode 100644 index 000000000000..c8179d505670 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-calendar package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/services/__init__.py b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/services/__init__.py new file mode 100644 index 000000000000..8f6cf068242c --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/__init__.py b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/__init__.py new file mode 100644 index 000000000000..ac7d7a5dbc8e --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .calendar_addon_manifest import ( + CalendarAddOnManifest, + CalendarExtensionPoint, + ConferenceSolution, +) + +__all__ = ( + 'CalendarAddOnManifest', + 'CalendarExtensionPoint', + 'ConferenceSolution', +) diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py new file mode 100644 index 000000000000..5ed3da0536fe --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py @@ -0,0 +1,184 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.calendar', + manifest={ + 'CalendarAddOnManifest', + 'ConferenceSolution', + 'CalendarExtensionPoint', + }, +) + + +class CalendarAddOnManifest(proto.Message): + r"""Calendar add-on manifest. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + Defines an endpoint that will be executed contexts that + don't match a declared contextual trigger. Any cards + generated by this function will always be available to the + user, but may be eclipsed by contextual content when this + add-on declares more targeted triggers. + + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + conference_solution (MutableSequence[google.apps.script.type.calendar.types.ConferenceSolution]): + Defines conference solutions provided by this + add-on. + create_settings_url_function (str): + An endpoint to execute that creates a URL to + the add-on's settings page. + event_open_trigger (google.apps.script.type.calendar.types.CalendarExtensionPoint): + An endpoint to trigger when an event is + opened (viewed/edited). + event_update_trigger (google.apps.script.type.calendar.types.CalendarExtensionPoint): + An endpoint to trigger when the open event is + updated. + current_event_access (google.apps.script.type.calendar.types.CalendarAddOnManifest.EventAccess): + Define the level of data access when an event + addon is triggered. + """ + class EventAccess(proto.Enum): + r"""An enum defining the level of data access event triggers + require. + + Values: + UNSPECIFIED (0): + Default value when nothing is set for + EventAccess. + METADATA (1): + METADATA gives event triggers the permission + to access the metadata of events such as event + id and calendar id. + READ (3): + READ gives event triggers access to all + provided event fields including the metadata, + attendees, and conference data. + WRITE (4): + WRITE gives event triggers access to the + metadata of events and the ability to perform + all actions, including adding attendees and + setting conference data. + READ_WRITE (5): + READ_WRITE gives event triggers access to all provided event + fields including the metadata, attendees, and conference + data and the ability to perform all actions. + """ + UNSPECIFIED = 0 + METADATA = 1 + READ = 3 + WRITE = 4 + READ_WRITE = 5 + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=6, + message=extension_point.HomepageExtensionPoint, + ) + conference_solution: MutableSequence['ConferenceSolution'] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message='ConferenceSolution', + ) + create_settings_url_function: str = proto.Field( + proto.STRING, + number=5, + ) + event_open_trigger: 'CalendarExtensionPoint' = proto.Field( + proto.MESSAGE, + number=10, + message='CalendarExtensionPoint', + ) + event_update_trigger: 'CalendarExtensionPoint' = proto.Field( + proto.MESSAGE, + number=11, + message='CalendarExtensionPoint', + ) + current_event_access: EventAccess = proto.Field( + proto.ENUM, + number=12, + enum=EventAccess, + ) + + +class ConferenceSolution(proto.Message): + r"""Defines conference related values. + + Attributes: + on_create_function (str): + Required. The endpoint to call when + ConferenceData should be created. + id (str): + Required. IDs should be unique across + ConferenceSolutions within one add-on, but this + is not strictly enforced. It is up to the add-on + developer to assign them uniquely, otherwise the + wrong ConferenceSolution may be used when the + add-on is triggered. While the developer may + change the display name of an add-on, the ID + should not be changed. + name (str): + Required. The display name of the + ConferenceSolution. + logo_url (str): + Required. The URL for the logo image of the + ConferenceSolution. + """ + + on_create_function: str = proto.Field( + proto.STRING, + number=1, + ) + id: str = proto.Field( + proto.STRING, + number=4, + ) + name: str = proto.Field( + proto.STRING, + number=5, + ) + logo_url: str = proto.Field( + proto.STRING, + number=6, + ) + + +class CalendarExtensionPoint(proto.Message): + r"""Common format for declaring a calendar add-on's triggers. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/mypy.ini b/owl-bot-staging/google-apps-script-type/calendar-py/mypy.ini new file mode 100644 index 000000000000..574c5aed394b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/noxfile.py b/owl-bot-staging/google-apps-script-type/calendar-py/noxfile.py new file mode 100644 index 000000000000..01e4b523b2a1 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/noxfile.py @@ -0,0 +1,280 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os +import pathlib +import re +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", + "3.12", + "3.13", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = 'google-apps-script-type-calendar' + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.13" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "prerelease_deps", +] + +@nox.session(python=ALL_PYTHON) +@nox.parametrize( + "protobuf_implementation", + [ "python", "upb", "cpp" ], +) +def unit(session, protobuf_implementation): + """Run the unit test suite.""" + + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + session.skip("cpp implementation is not supported in python 3.11+") + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.', "-c", f"testing/constraints-{session.python}.txt") + + # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. + # The 'cpp' implementation requires Protobuf<4. + if protobuf_implementation == "cpp": + session.install("protobuf<4") + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/calendar/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)), + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) + +@nox.session(python=ALL_PYTHON[-1]) +@nox.parametrize( + "protobuf_implementation", + [ "python", "upb", "cpp" ], +) +def prerelease_deps(session, protobuf_implementation): + """Run the unit test suite against pre-release versions of dependencies.""" + + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + session.skip("cpp implementation is not supported in python 3.11+") + + # Install test environment dependencies + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + + # Install the package without dependencies + session.install('-e', '.', '--no-deps') + + # We test the minimum dependency versions using the minimum Python + # version so the lowest python runtime that we test has a corresponding constraints + # file, located at `testing/constraints--.txt`, which contains all of the + # dependencies and extras. + with open( + CURRENT_DIRECTORY + / "testing" + / f"constraints-{ALL_PYTHON[0]}.txt", + encoding="utf-8", + ) as constraints_file: + constraints_text = constraints_file.read() + + # Ignore leading whitespace and comment lines. + constraints_deps = [ + match.group(1) + for match in re.finditer( + r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE + ) + ] + + session.install(*constraints_deps) + + prerel_deps = [ + "googleapis-common-protos", + "google-api-core", + "google-auth", + # Exclude grpcio!=1.67.0rc1 which does not support python 3.13 + "grpcio!=1.67.0rc1", + "grpcio-status", + "protobuf", + "proto-plus", + ] + + for dep in prerel_deps: + session.install("--pre", "--no-deps", "--upgrade", dep) + + # Remaining dependencies + other_deps = [ + "requests", + ] + session.install(*other_deps) + + # Print out prerelease package versions + + session.run("python", "-c", "import google.api_core; print(google.api_core.__version__)") + session.run("python", "-c", "import google.auth; print(google.auth.__version__)") + session.run("python", "-c", "import grpc; print(grpc.__version__)") + session.run( + "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" + ) + session.run( + "python", "-c", "import proto; print(proto.__version__)" + ) + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/calendar/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)), + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install( + 'mypy', + 'types-requests', + 'types-protobuf' + ) + session.install('.') + session.run( + 'mypy', + '-p', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==7.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/scripts/fixup_calendar_keywords.py b/owl-bot-staging/google-apps-script-type/calendar-py/scripts/fixup_calendar_keywords.py new file mode 100644 index 000000000000..d64f207f6571 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/scripts/fixup_calendar_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class calendarCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=calendarCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the calendar client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/setup.py b/owl-bot-staging/google-apps-script-type/calendar-py/setup.py new file mode 100644 index 000000000000..c990d342e9ca --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/setup.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import io +import os +import re + +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = 'google-apps-script-type-calendar' + + +description = "Google Apps Script Type Calendar API client library" + +version = None + +with open(os.path.join(package_root, 'google/apps/script/type/calendar/gapic_version.py')) as fp: + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert (len(version_candidates) == 1) + version = version_candidates[0] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + # Exclude incompatible versions of `google-auth` + # See https://github.com/googleapis/google-cloud-python/issues/12364 + "google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0", + "proto-plus >= 1.22.3, <2.0.0dev", + "proto-plus >= 1.25.0, <2.0.0dev; python_version >= '3.13'", + "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "google-apps-script-type >= 0.2.0, <1.0.0dev", +] +extras = { +} +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-apps-script-type-calendar" + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: + readme = readme_file.read() + +packages = [ + package + for package in setuptools.find_namespace_packages() + if package.startswith("google") +] + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url=url, + classifiers=[ + release_status, + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Operating System :: OS Independent", + "Topic :: Internet", + ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + install_requires=dependencies, + extras_require=extras, + include_package_data=True, + zip_safe=False, +) diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.10.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.10.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.11.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.11.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.12.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.12.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.13.txt b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.13.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.13.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.7.txt new file mode 100644 index 000000000000..add339dc78f3 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.7.txt @@ -0,0 +1,11 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.1 +google-auth==2.14.1 +proto-plus==1.22.3 +protobuf==3.20.2 +google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.8.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.9.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/calendar-py/tests/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/calendar/__init__.py b/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/calendar/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/calendar/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/docs-py/.coveragerc b/owl-bot-staging/google-apps-script-type/docs-py/.coveragerc new file mode 100644 index 000000000000..ead63ec35413 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/apps/script/type/docs/__init__.py + google/apps/script/type/docs/gapic_version.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/docs-py/.flake8 b/owl-bot-staging/google-apps-script-type/docs-py/.flake8 new file mode 100644 index 000000000000..29227d4cf419 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/google-apps-script-type/docs-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/docs-py/MANIFEST.in new file mode 100644 index 000000000000..8089481e3476 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/apps/script/type/docs *.py +recursive-include google/apps/script/type/docs *.py diff --git a/owl-bot-staging/google-apps-script-type/docs-py/README.rst b/owl-bot-staging/google-apps-script-type/docs-py/README.rst new file mode 100644 index 000000000000..bddbe0cafc22 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Apps Script Type Docs API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Apps Script Type Docs API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/docs-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/docs-py/docs/_static/custom.css new file mode 100644 index 000000000000..06423be0b592 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/docs/_static/custom.css @@ -0,0 +1,3 @@ +dl.field-list > dt { + min-width: 100px +} diff --git a/owl-bot-staging/google-apps-script-type/docs-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/docs-py/docs/conf.py new file mode 100644 index 000000000000..7a78f2b65064 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# google-apps-script-type-docs documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-apps-script-type-docs" +copyright = u"2023, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Apps Script Type Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-apps-script-type-docs-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-apps-script-type-docs.tex", + u"google-apps-script-type-docs Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-apps-script-type-docs", + u"Google Apps Script Type Docs Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-apps-script-type-docs", + u"google-apps-script-type-docs Documentation", + author, + "google-apps-script-type-docs", + "GAPIC library for Google Apps Script Type Docs API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/docs-py/docs/docs/services_.rst b/owl-bot-staging/google-apps-script-type/docs-py/docs/docs/services_.rst new file mode 100644 index 000000000000..4af412e533c2 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/docs/docs/services_.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Docs API +============================================== +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/docs-py/docs/docs/types_.rst b/owl-bot-staging/google-apps-script-type/docs-py/docs/docs/types_.rst new file mode 100644 index 000000000000..3f47df031446 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/docs/docs/types_.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Docs API +=========================================== + +.. automodule:: google.apps.script.type.docs.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/docs-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/docs-py/docs/index.rst new file mode 100644 index 000000000000..71c7ab401b5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + docs/services_ + docs/types_ diff --git a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/__init__.py b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/__init__.py new file mode 100644 index 000000000000..830145843a05 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.docs import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.docs_addon_manifest import DocsAddOnManifest +from .types.docs_addon_manifest import DocsExtensionPoint + +__all__ = ( +'DocsAddOnManifest', +'DocsExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_metadata.json new file mode 100644 index 000000000000..5df2a0423a5e --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.docs", + "protoPackage": "google.apps.script.type.docs", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_version.py b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_version.py new file mode 100644 index 000000000000..558c8aab67c5 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/py.typed b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/py.typed new file mode 100644 index 000000000000..a954439caa66 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-docs package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/services/__init__.py b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/services/__init__.py new file mode 100644 index 000000000000..8f6cf068242c --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/__init__.py b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/__init__.py new file mode 100644 index 000000000000..ecd61fa7655c --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .docs_addon_manifest import ( + DocsAddOnManifest, + DocsExtensionPoint, +) + +__all__ = ( + 'DocsAddOnManifest', + 'DocsExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/docs_addon_manifest.py b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/docs_addon_manifest.py new file mode 100644 index 000000000000..99b6f2fe6eb6 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/docs_addon_manifest.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.docs', + manifest={ + 'DocsAddOnManifest', + 'DocsExtensionPoint', + }, +) + + +class DocsAddOnManifest(proto.Message): + r"""Docs add-on manifest. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + on_file_scope_granted_trigger (google.apps.script.type.docs.types.DocsExtensionPoint): + Endpoint to execute when file scope + authorization is granted for this document/user + pair. + """ + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=1, + message=extension_point.HomepageExtensionPoint, + ) + on_file_scope_granted_trigger: 'DocsExtensionPoint' = proto.Field( + proto.MESSAGE, + number=2, + message='DocsExtensionPoint', + ) + + +class DocsExtensionPoint(proto.Message): + r"""Common format for declaring a Docs add-on's triggers. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/docs-py/mypy.ini b/owl-bot-staging/google-apps-script-type/docs-py/mypy.ini new file mode 100644 index 000000000000..574c5aed394b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/docs-py/noxfile.py b/owl-bot-staging/google-apps-script-type/docs-py/noxfile.py new file mode 100644 index 000000000000..3de287c814ce --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/noxfile.py @@ -0,0 +1,280 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os +import pathlib +import re +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", + "3.12", + "3.13", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = 'google-apps-script-type-docs' + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.13" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "prerelease_deps", +] + +@nox.session(python=ALL_PYTHON) +@nox.parametrize( + "protobuf_implementation", + [ "python", "upb", "cpp" ], +) +def unit(session, protobuf_implementation): + """Run the unit test suite.""" + + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + session.skip("cpp implementation is not supported in python 3.11+") + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.', "-c", f"testing/constraints-{session.python}.txt") + + # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. + # The 'cpp' implementation requires Protobuf<4. + if protobuf_implementation == "cpp": + session.install("protobuf<4") + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/docs/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)), + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) + +@nox.session(python=ALL_PYTHON[-1]) +@nox.parametrize( + "protobuf_implementation", + [ "python", "upb", "cpp" ], +) +def prerelease_deps(session, protobuf_implementation): + """Run the unit test suite against pre-release versions of dependencies.""" + + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + session.skip("cpp implementation is not supported in python 3.11+") + + # Install test environment dependencies + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + + # Install the package without dependencies + session.install('-e', '.', '--no-deps') + + # We test the minimum dependency versions using the minimum Python + # version so the lowest python runtime that we test has a corresponding constraints + # file, located at `testing/constraints--.txt`, which contains all of the + # dependencies and extras. + with open( + CURRENT_DIRECTORY + / "testing" + / f"constraints-{ALL_PYTHON[0]}.txt", + encoding="utf-8", + ) as constraints_file: + constraints_text = constraints_file.read() + + # Ignore leading whitespace and comment lines. + constraints_deps = [ + match.group(1) + for match in re.finditer( + r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE + ) + ] + + session.install(*constraints_deps) + + prerel_deps = [ + "googleapis-common-protos", + "google-api-core", + "google-auth", + # Exclude grpcio!=1.67.0rc1 which does not support python 3.13 + "grpcio!=1.67.0rc1", + "grpcio-status", + "protobuf", + "proto-plus", + ] + + for dep in prerel_deps: + session.install("--pre", "--no-deps", "--upgrade", dep) + + # Remaining dependencies + other_deps = [ + "requests", + ] + session.install(*other_deps) + + # Print out prerelease package versions + + session.run("python", "-c", "import google.api_core; print(google.api_core.__version__)") + session.run("python", "-c", "import google.auth; print(google.auth.__version__)") + session.run("python", "-c", "import grpc; print(grpc.__version__)") + session.run( + "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" + ) + session.run( + "python", "-c", "import proto; print(proto.__version__)" + ) + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/docs/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)), + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install( + 'mypy', + 'types-requests', + 'types-protobuf' + ) + session.install('.') + session.run( + 'mypy', + '-p', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==7.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) diff --git a/owl-bot-staging/google-apps-script-type/docs-py/scripts/fixup_docs_keywords.py b/owl-bot-staging/google-apps-script-type/docs-py/scripts/fixup_docs_keywords.py new file mode 100644 index 000000000000..be23874516be --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/scripts/fixup_docs_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class docsCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=docsCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the docs client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/docs-py/setup.py b/owl-bot-staging/google-apps-script-type/docs-py/setup.py new file mode 100644 index 000000000000..ba9da3a74275 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/setup.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import io +import os +import re + +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = 'google-apps-script-type-docs' + + +description = "Google Apps Script Type Docs API client library" + +version = None + +with open(os.path.join(package_root, 'google/apps/script/type/docs/gapic_version.py')) as fp: + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert (len(version_candidates) == 1) + version = version_candidates[0] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + # Exclude incompatible versions of `google-auth` + # See https://github.com/googleapis/google-cloud-python/issues/12364 + "google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0", + "proto-plus >= 1.22.3, <2.0.0dev", + "proto-plus >= 1.25.0, <2.0.0dev; python_version >= '3.13'", + "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "google-apps-script-type >= 0.2.0, <1.0.0dev", +] +extras = { +} +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-apps-script-type-docs" + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: + readme = readme_file.read() + +packages = [ + package + for package in setuptools.find_namespace_packages() + if package.startswith("google") +] + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url=url, + classifiers=[ + release_status, + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Operating System :: OS Independent", + "Topic :: Internet", + ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + install_requires=dependencies, + extras_require=extras, + include_package_data=True, + zip_safe=False, +) diff --git a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.10.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.10.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.11.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.11.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.12.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.12.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.13.txt b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.13.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.13.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.7.txt new file mode 100644 index 000000000000..add339dc78f3 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.7.txt @@ -0,0 +1,11 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.1 +google-auth==2.14.1 +proto-plus==1.22.3 +protobuf==3.20.2 +google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.8.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.9.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/docs-py/tests/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/docs/__init__.py b/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/docs/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/docs/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/drive-py/.coveragerc b/owl-bot-staging/google-apps-script-type/drive-py/.coveragerc new file mode 100644 index 000000000000..ab4cf2da754a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/apps/script/type/drive/__init__.py + google/apps/script/type/drive/gapic_version.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/drive-py/.flake8 b/owl-bot-staging/google-apps-script-type/drive-py/.flake8 new file mode 100644 index 000000000000..29227d4cf419 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/google-apps-script-type/drive-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/drive-py/MANIFEST.in new file mode 100644 index 000000000000..22ebbed5ba4a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/apps/script/type/drive *.py +recursive-include google/apps/script/type/drive *.py diff --git a/owl-bot-staging/google-apps-script-type/drive-py/README.rst b/owl-bot-staging/google-apps-script-type/drive-py/README.rst new file mode 100644 index 000000000000..a9662a9269da --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Apps Script Type Drive API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Apps Script Type Drive API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/drive-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/drive-py/docs/_static/custom.css new file mode 100644 index 000000000000..06423be0b592 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/docs/_static/custom.css @@ -0,0 +1,3 @@ +dl.field-list > dt { + min-width: 100px +} diff --git a/owl-bot-staging/google-apps-script-type/drive-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/drive-py/docs/conf.py new file mode 100644 index 000000000000..1fb0c88d2776 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# google-apps-script-type-drive documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-apps-script-type-drive" +copyright = u"2023, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Apps Script Type Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-apps-script-type-drive-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-apps-script-type-drive.tex", + u"google-apps-script-type-drive Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-apps-script-type-drive", + u"Google Apps Script Type Drive Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-apps-script-type-drive", + u"google-apps-script-type-drive Documentation", + author, + "google-apps-script-type-drive", + "GAPIC library for Google Apps Script Type Drive API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/drive-py/docs/drive/services_.rst b/owl-bot-staging/google-apps-script-type/drive-py/docs/drive/services_.rst new file mode 100644 index 000000000000..8ff18c898331 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/docs/drive/services_.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Drive API +=============================================== +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/drive-py/docs/drive/types_.rst b/owl-bot-staging/google-apps-script-type/drive-py/docs/drive/types_.rst new file mode 100644 index 000000000000..b7b1423eb9ea --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/docs/drive/types_.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Drive API +============================================ + +.. automodule:: google.apps.script.type.drive.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/drive-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/drive-py/docs/index.rst new file mode 100644 index 000000000000..40bbf9bbf385 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + drive/services_ + drive/types_ diff --git a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/__init__.py b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/__init__.py new file mode 100644 index 000000000000..81c6edc23042 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.drive import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.drive_addon_manifest import DriveAddOnManifest +from .types.drive_addon_manifest import DriveExtensionPoint + +__all__ = ( +'DriveAddOnManifest', +'DriveExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_metadata.json new file mode 100644 index 000000000000..89577093651d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.drive", + "protoPackage": "google.apps.script.type.drive", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_version.py b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_version.py new file mode 100644 index 000000000000..558c8aab67c5 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/py.typed b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/py.typed new file mode 100644 index 000000000000..bbb573f18f73 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-drive package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/services/__init__.py b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/services/__init__.py new file mode 100644 index 000000000000..8f6cf068242c --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/__init__.py b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/__init__.py new file mode 100644 index 000000000000..ff483e337dc3 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .drive_addon_manifest import ( + DriveAddOnManifest, + DriveExtensionPoint, +) + +__all__ = ( + 'DriveAddOnManifest', + 'DriveExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/drive_addon_manifest.py b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/drive_addon_manifest.py new file mode 100644 index 000000000000..6e527c067ac8 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/drive_addon_manifest.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.drive', + manifest={ + 'DriveAddOnManifest', + 'DriveExtensionPoint', + }, +) + + +class DriveAddOnManifest(proto.Message): + r"""Drive add-on manifest. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + on_items_selected_trigger (google.apps.script.type.drive.types.DriveExtensionPoint): + Corresponds to behvior that should execute + when items are selected in relevant Drive view + (e.g. the My Drive Doclist). + """ + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=1, + message=extension_point.HomepageExtensionPoint, + ) + on_items_selected_trigger: 'DriveExtensionPoint' = proto.Field( + proto.MESSAGE, + number=2, + message='DriveExtensionPoint', + ) + + +class DriveExtensionPoint(proto.Message): + r"""A generic extension point with common features, e.g. + something that simply needs a corresponding run function to + work. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/drive-py/mypy.ini b/owl-bot-staging/google-apps-script-type/drive-py/mypy.ini new file mode 100644 index 000000000000..574c5aed394b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/drive-py/noxfile.py b/owl-bot-staging/google-apps-script-type/drive-py/noxfile.py new file mode 100644 index 000000000000..b878757baded --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/noxfile.py @@ -0,0 +1,280 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os +import pathlib +import re +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", + "3.12", + "3.13", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = 'google-apps-script-type-drive' + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.13" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "prerelease_deps", +] + +@nox.session(python=ALL_PYTHON) +@nox.parametrize( + "protobuf_implementation", + [ "python", "upb", "cpp" ], +) +def unit(session, protobuf_implementation): + """Run the unit test suite.""" + + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + session.skip("cpp implementation is not supported in python 3.11+") + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.', "-c", f"testing/constraints-{session.python}.txt") + + # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. + # The 'cpp' implementation requires Protobuf<4. + if protobuf_implementation == "cpp": + session.install("protobuf<4") + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/drive/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)), + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) + +@nox.session(python=ALL_PYTHON[-1]) +@nox.parametrize( + "protobuf_implementation", + [ "python", "upb", "cpp" ], +) +def prerelease_deps(session, protobuf_implementation): + """Run the unit test suite against pre-release versions of dependencies.""" + + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + session.skip("cpp implementation is not supported in python 3.11+") + + # Install test environment dependencies + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + + # Install the package without dependencies + session.install('-e', '.', '--no-deps') + + # We test the minimum dependency versions using the minimum Python + # version so the lowest python runtime that we test has a corresponding constraints + # file, located at `testing/constraints--.txt`, which contains all of the + # dependencies and extras. + with open( + CURRENT_DIRECTORY + / "testing" + / f"constraints-{ALL_PYTHON[0]}.txt", + encoding="utf-8", + ) as constraints_file: + constraints_text = constraints_file.read() + + # Ignore leading whitespace and comment lines. + constraints_deps = [ + match.group(1) + for match in re.finditer( + r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE + ) + ] + + session.install(*constraints_deps) + + prerel_deps = [ + "googleapis-common-protos", + "google-api-core", + "google-auth", + # Exclude grpcio!=1.67.0rc1 which does not support python 3.13 + "grpcio!=1.67.0rc1", + "grpcio-status", + "protobuf", + "proto-plus", + ] + + for dep in prerel_deps: + session.install("--pre", "--no-deps", "--upgrade", dep) + + # Remaining dependencies + other_deps = [ + "requests", + ] + session.install(*other_deps) + + # Print out prerelease package versions + + session.run("python", "-c", "import google.api_core; print(google.api_core.__version__)") + session.run("python", "-c", "import google.auth; print(google.auth.__version__)") + session.run("python", "-c", "import grpc; print(grpc.__version__)") + session.run( + "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" + ) + session.run( + "python", "-c", "import proto; print(proto.__version__)" + ) + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/drive/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)), + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install( + 'mypy', + 'types-requests', + 'types-protobuf' + ) + session.install('.') + session.run( + 'mypy', + '-p', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==7.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) diff --git a/owl-bot-staging/google-apps-script-type/drive-py/scripts/fixup_drive_keywords.py b/owl-bot-staging/google-apps-script-type/drive-py/scripts/fixup_drive_keywords.py new file mode 100644 index 000000000000..a92982a8da38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/scripts/fixup_drive_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class driveCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=driveCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the drive client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/drive-py/setup.py b/owl-bot-staging/google-apps-script-type/drive-py/setup.py new file mode 100644 index 000000000000..d5cba87f8977 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/setup.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import io +import os +import re + +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = 'google-apps-script-type-drive' + + +description = "Google Apps Script Type Drive API client library" + +version = None + +with open(os.path.join(package_root, 'google/apps/script/type/drive/gapic_version.py')) as fp: + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert (len(version_candidates) == 1) + version = version_candidates[0] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + # Exclude incompatible versions of `google-auth` + # See https://github.com/googleapis/google-cloud-python/issues/12364 + "google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0", + "proto-plus >= 1.22.3, <2.0.0dev", + "proto-plus >= 1.25.0, <2.0.0dev; python_version >= '3.13'", + "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "google-apps-script-type >= 0.2.0, <1.0.0dev", +] +extras = { +} +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-apps-script-type-drive" + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: + readme = readme_file.read() + +packages = [ + package + for package in setuptools.find_namespace_packages() + if package.startswith("google") +] + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url=url, + classifiers=[ + release_status, + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Operating System :: OS Independent", + "Topic :: Internet", + ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + install_requires=dependencies, + extras_require=extras, + include_package_data=True, + zip_safe=False, +) diff --git a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.10.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.10.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.11.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.11.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.12.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.12.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.13.txt b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.13.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.13.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.7.txt new file mode 100644 index 000000000000..add339dc78f3 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.7.txt @@ -0,0 +1,11 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.1 +google-auth==2.14.1 +proto-plus==1.22.3 +protobuf==3.20.2 +google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.8.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.9.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/drive-py/tests/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/drive/__init__.py b/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/drive/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/drive/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/.coveragerc b/owl-bot-staging/google-apps-script-type/gmail-py/.coveragerc new file mode 100644 index 000000000000..7a2aa0a8bb10 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/apps/script/type/gmail/__init__.py + google/apps/script/type/gmail/gapic_version.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/.flake8 b/owl-bot-staging/google-apps-script-type/gmail-py/.flake8 new file mode 100644 index 000000000000..29227d4cf419 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/gmail-py/MANIFEST.in new file mode 100644 index 000000000000..a7ee24e07f5d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/apps/script/type/gmail *.py +recursive-include google/apps/script/type/gmail *.py diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/README.rst b/owl-bot-staging/google-apps-script-type/gmail-py/README.rst new file mode 100644 index 000000000000..bb9177599c32 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Apps Script Type Gmail API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Apps Script Type Gmail API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/gmail-py/docs/_static/custom.css new file mode 100644 index 000000000000..06423be0b592 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/docs/_static/custom.css @@ -0,0 +1,3 @@ +dl.field-list > dt { + min-width: 100px +} diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/gmail-py/docs/conf.py new file mode 100644 index 000000000000..40f02d15f276 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# google-apps-script-type-gmail documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-apps-script-type-gmail" +copyright = u"2023, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Apps Script Type Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-apps-script-type-gmail-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-apps-script-type-gmail.tex", + u"google-apps-script-type-gmail Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-apps-script-type-gmail", + u"Google Apps Script Type Gmail Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-apps-script-type-gmail", + u"google-apps-script-type-gmail Documentation", + author, + "google-apps-script-type-gmail", + "GAPIC library for Google Apps Script Type Gmail API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/services_.rst b/owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/services_.rst new file mode 100644 index 000000000000..7df066840e3f --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/services_.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Gmail API +=============================================== +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/types_.rst b/owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/types_.rst new file mode 100644 index 000000000000..bc0bef9f5807 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/types_.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Gmail API +============================================ + +.. automodule:: google.apps.script.type.gmail.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/gmail-py/docs/index.rst new file mode 100644 index 000000000000..dced9c1a3e1b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + gmail/services_ + gmail/types_ diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/__init__.py b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/__init__.py new file mode 100644 index 000000000000..2c9981a54a80 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/__init__.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.gmail import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.gmail_addon_manifest import ComposeTrigger +from .types.gmail_addon_manifest import ContextualTrigger +from .types.gmail_addon_manifest import GmailAddOnManifest +from .types.gmail_addon_manifest import UnconditionalTrigger +from .types.gmail_addon_manifest import UniversalAction + +__all__ = ( +'ComposeTrigger', +'ContextualTrigger', +'GmailAddOnManifest', +'UnconditionalTrigger', +'UniversalAction', +) diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_metadata.json new file mode 100644 index 000000000000..7733a14a8ce4 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.gmail", + "protoPackage": "google.apps.script.type.gmail", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_version.py b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_version.py new file mode 100644 index 000000000000..558c8aab67c5 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/py.typed b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/py.typed new file mode 100644 index 000000000000..0906e16feda1 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-gmail package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/services/__init__.py b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/services/__init__.py new file mode 100644 index 000000000000..8f6cf068242c --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/__init__.py b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/__init__.py new file mode 100644 index 000000000000..e75f6f7a8e16 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/__init__.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .gmail_addon_manifest import ( + ComposeTrigger, + ContextualTrigger, + GmailAddOnManifest, + UnconditionalTrigger, + UniversalAction, +) + +__all__ = ( + 'ComposeTrigger', + 'ContextualTrigger', + 'GmailAddOnManifest', + 'UnconditionalTrigger', + 'UniversalAction', +) diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py new file mode 100644 index 000000000000..6fd365c3f729 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py @@ -0,0 +1,232 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.gmail', + manifest={ + 'GmailAddOnManifest', + 'UniversalAction', + 'ComposeTrigger', + 'ContextualTrigger', + 'UnconditionalTrigger', + }, +) + + +class GmailAddOnManifest(proto.Message): + r"""Properties customizing the appearance and execution of a + Gmail add-on. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + Defines an endpoint that will be executed in contexts that + don't match a declared contextual trigger. Any cards + generated by this function will always be available to the + user, but may be eclipsed by contextual content when this + add-on declares more targeted triggers. + + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + contextual_triggers (MutableSequence[google.apps.script.type.gmail.types.ContextualTrigger]): + Defines the set of conditions that trigger + the add-on. + universal_actions (MutableSequence[google.apps.script.type.gmail.types.UniversalAction]): + Defines set of `universal + actions `__ for + the add-on. The user triggers universal actions from the + add-on toolbar menu. + compose_trigger (google.apps.script.type.gmail.types.ComposeTrigger): + Defines the compose time trigger for a + compose time add-on. This is the trigger that + causes an add-on to take action when the user is + composing an email. + All compose time addons are required to have the + gmail.addons.current.action.compose scope even + though it might not edit the draft. + authorization_check_function (str): + The name of an endpoint that verifies that + the add-on has all the required third-party + authorizations, by probing the third-party APIs. + If the probe fails, the function should throw an + exception to initiate the authorization flow. + This function is called before each invocation + of the add-on, in order to ensure a smooth user + experience. + """ + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=14, + message=extension_point.HomepageExtensionPoint, + ) + contextual_triggers: MutableSequence['ContextualTrigger'] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message='ContextualTrigger', + ) + universal_actions: MutableSequence['UniversalAction'] = proto.RepeatedField( + proto.MESSAGE, + number=4, + message='UniversalAction', + ) + compose_trigger: 'ComposeTrigger' = proto.Field( + proto.MESSAGE, + number=12, + message='ComposeTrigger', + ) + authorization_check_function: str = proto.Field( + proto.STRING, + number=7, + ) + + +class UniversalAction(proto.Message): + r"""An action that is always available in the add-on toolbar menu + regardless of message context. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + text (str): + Required. User-visible text describing the + action, for example, "Add a new contact.". + open_link (str): + A link that is opened by Gmail when the user + triggers the action. + + This field is a member of `oneof`_ ``action_type``. + run_function (str): + An endpoint that is called when the user triggers the + action. See the `universal actions + guide `__ for + details. + + This field is a member of `oneof`_ ``action_type``. + """ + + text: str = proto.Field( + proto.STRING, + number=1, + ) + open_link: str = proto.Field( + proto.STRING, + number=2, + oneof='action_type', + ) + run_function: str = proto.Field( + proto.STRING, + number=3, + oneof='action_type', + ) + + +class ComposeTrigger(proto.Message): + r"""A trigger that activates when user is composing an email. + + Attributes: + actions (MutableSequence[google.apps.script.type.types.MenuItemExtensionPoint]): + Defines the set of actions for compose time + add-on. These are actions that user can trigger + on a compose time addon. + draft_access (google.apps.script.type.gmail.types.ComposeTrigger.DraftAccess): + Define the level of data access when a + compose time addon is triggered. + """ + class DraftAccess(proto.Enum): + r"""An enum defining the level of data access this compose + trigger requires. + + Values: + UNSPECIFIED (0): + Default value when nothing is set for + DraftAccess. + NONE (1): + NONE means compose trigger won't be able to + access any data of the draft when a compose + addon is triggered. + METADATA (2): + METADATA gives compose trigger the permission + to access the metadata of the draft when a + compose addon is triggered. This includes the + audience list (To/cc list) of a draft message. + """ + UNSPECIFIED = 0 + NONE = 1 + METADATA = 2 + + actions: MutableSequence[extension_point.MenuItemExtensionPoint] = proto.RepeatedField( + proto.MESSAGE, + number=5, + message=extension_point.MenuItemExtensionPoint, + ) + draft_access: DraftAccess = proto.Field( + proto.ENUM, + number=4, + enum=DraftAccess, + ) + + +class ContextualTrigger(proto.Message): + r"""Defines a trigger that fires when the open email meets a + specific criteria. When the trigger fires, it executes a + specific endpoint, usually in order to create new cards and + update the UI. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + unconditional (google.apps.script.type.gmail.types.UnconditionalTrigger): + UnconditionalTriggers are executed when any + mail message is opened. + + This field is a member of `oneof`_ ``trigger``. + on_trigger_function (str): + Required. The name of the endpoint to call + when a message matches the trigger. + """ + + unconditional: 'UnconditionalTrigger' = proto.Field( + proto.MESSAGE, + number=1, + oneof='trigger', + message='UnconditionalTrigger', + ) + on_trigger_function: str = proto.Field( + proto.STRING, + number=4, + ) + + +class UnconditionalTrigger(proto.Message): + r"""A trigger that fires when any email message is opened. + """ + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/mypy.ini b/owl-bot-staging/google-apps-script-type/gmail-py/mypy.ini new file mode 100644 index 000000000000..574c5aed394b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/noxfile.py b/owl-bot-staging/google-apps-script-type/gmail-py/noxfile.py new file mode 100644 index 000000000000..e7d5a0c09ae6 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/noxfile.py @@ -0,0 +1,280 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os +import pathlib +import re +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", + "3.12", + "3.13", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = 'google-apps-script-type-gmail' + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.13" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "prerelease_deps", +] + +@nox.session(python=ALL_PYTHON) +@nox.parametrize( + "protobuf_implementation", + [ "python", "upb", "cpp" ], +) +def unit(session, protobuf_implementation): + """Run the unit test suite.""" + + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + session.skip("cpp implementation is not supported in python 3.11+") + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.', "-c", f"testing/constraints-{session.python}.txt") + + # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. + # The 'cpp' implementation requires Protobuf<4. + if protobuf_implementation == "cpp": + session.install("protobuf<4") + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/gmail/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)), + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) + +@nox.session(python=ALL_PYTHON[-1]) +@nox.parametrize( + "protobuf_implementation", + [ "python", "upb", "cpp" ], +) +def prerelease_deps(session, protobuf_implementation): + """Run the unit test suite against pre-release versions of dependencies.""" + + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + session.skip("cpp implementation is not supported in python 3.11+") + + # Install test environment dependencies + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + + # Install the package without dependencies + session.install('-e', '.', '--no-deps') + + # We test the minimum dependency versions using the minimum Python + # version so the lowest python runtime that we test has a corresponding constraints + # file, located at `testing/constraints--.txt`, which contains all of the + # dependencies and extras. + with open( + CURRENT_DIRECTORY + / "testing" + / f"constraints-{ALL_PYTHON[0]}.txt", + encoding="utf-8", + ) as constraints_file: + constraints_text = constraints_file.read() + + # Ignore leading whitespace and comment lines. + constraints_deps = [ + match.group(1) + for match in re.finditer( + r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE + ) + ] + + session.install(*constraints_deps) + + prerel_deps = [ + "googleapis-common-protos", + "google-api-core", + "google-auth", + # Exclude grpcio!=1.67.0rc1 which does not support python 3.13 + "grpcio!=1.67.0rc1", + "grpcio-status", + "protobuf", + "proto-plus", + ] + + for dep in prerel_deps: + session.install("--pre", "--no-deps", "--upgrade", dep) + + # Remaining dependencies + other_deps = [ + "requests", + ] + session.install(*other_deps) + + # Print out prerelease package versions + + session.run("python", "-c", "import google.api_core; print(google.api_core.__version__)") + session.run("python", "-c", "import google.auth; print(google.auth.__version__)") + session.run("python", "-c", "import grpc; print(grpc.__version__)") + session.run( + "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" + ) + session.run( + "python", "-c", "import proto; print(proto.__version__)" + ) + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/gmail/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)), + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install( + 'mypy', + 'types-requests', + 'types-protobuf' + ) + session.install('.') + session.run( + 'mypy', + '-p', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==7.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/scripts/fixup_gmail_keywords.py b/owl-bot-staging/google-apps-script-type/gmail-py/scripts/fixup_gmail_keywords.py new file mode 100644 index 000000000000..16c727b4022b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/scripts/fixup_gmail_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class gmailCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=gmailCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the gmail client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/setup.py b/owl-bot-staging/google-apps-script-type/gmail-py/setup.py new file mode 100644 index 000000000000..519b10ea18ac --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/setup.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import io +import os +import re + +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = 'google-apps-script-type-gmail' + + +description = "Google Apps Script Type Gmail API client library" + +version = None + +with open(os.path.join(package_root, 'google/apps/script/type/gmail/gapic_version.py')) as fp: + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert (len(version_candidates) == 1) + version = version_candidates[0] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + # Exclude incompatible versions of `google-auth` + # See https://github.com/googleapis/google-cloud-python/issues/12364 + "google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0", + "proto-plus >= 1.22.3, <2.0.0dev", + "proto-plus >= 1.25.0, <2.0.0dev; python_version >= '3.13'", + "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "google-apps-script-type >= 0.2.0, <1.0.0dev", +] +extras = { +} +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-apps-script-type-gmail" + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: + readme = readme_file.read() + +packages = [ + package + for package in setuptools.find_namespace_packages() + if package.startswith("google") +] + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url=url, + classifiers=[ + release_status, + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Operating System :: OS Independent", + "Topic :: Internet", + ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + install_requires=dependencies, + extras_require=extras, + include_package_data=True, + zip_safe=False, +) diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.10.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.10.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.11.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.11.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.12.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.12.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.13.txt b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.13.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.13.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.7.txt new file mode 100644 index 000000000000..add339dc78f3 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.7.txt @@ -0,0 +1,11 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.1 +google-auth==2.14.1 +proto-plus==1.22.3 +protobuf==3.20.2 +google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.8.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.9.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/gmail-py/tests/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/gmail/__init__.py b/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/gmail/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/gmail/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/.coveragerc b/owl-bot-staging/google-apps-script-type/sheets-py/.coveragerc new file mode 100644 index 000000000000..718f27f1463e --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/apps/script/type/sheets/__init__.py + google/apps/script/type/sheets/gapic_version.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/.flake8 b/owl-bot-staging/google-apps-script-type/sheets-py/.flake8 new file mode 100644 index 000000000000..29227d4cf419 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/sheets-py/MANIFEST.in new file mode 100644 index 000000000000..fb187de1bffd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/apps/script/type/sheets *.py +recursive-include google/apps/script/type/sheets *.py diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/README.rst b/owl-bot-staging/google-apps-script-type/sheets-py/README.rst new file mode 100644 index 000000000000..2e72a247fb1d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Apps Script Type Sheets API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Apps Script Type Sheets API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/sheets-py/docs/_static/custom.css new file mode 100644 index 000000000000..06423be0b592 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/docs/_static/custom.css @@ -0,0 +1,3 @@ +dl.field-list > dt { + min-width: 100px +} diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/sheets-py/docs/conf.py new file mode 100644 index 000000000000..2e352e909927 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# google-apps-script-type-sheets documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-apps-script-type-sheets" +copyright = u"2023, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Apps Script Type Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-apps-script-type-sheets-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-apps-script-type-sheets.tex", + u"google-apps-script-type-sheets Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-apps-script-type-sheets", + u"Google Apps Script Type Sheets Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-apps-script-type-sheets", + u"google-apps-script-type-sheets Documentation", + author, + "google-apps-script-type-sheets", + "GAPIC library for Google Apps Script Type Sheets API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/sheets-py/docs/index.rst new file mode 100644 index 000000000000..faf2d612dfab --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + sheets/services_ + sheets/types_ diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/services_.rst b/owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/services_.rst new file mode 100644 index 000000000000..8015dea9d07c --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/services_.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Sheets API +================================================ +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/types_.rst b/owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/types_.rst new file mode 100644 index 000000000000..299268839314 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/types_.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Sheets API +============================================= + +.. automodule:: google.apps.script.type.sheets.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/__init__.py b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/__init__.py new file mode 100644 index 000000000000..ed6a03c38311 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.sheets import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.sheets_addon_manifest import SheetsAddOnManifest +from .types.sheets_addon_manifest import SheetsExtensionPoint + +__all__ = ( +'SheetsAddOnManifest', +'SheetsExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_metadata.json new file mode 100644 index 000000000000..f43947aa567d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.sheets", + "protoPackage": "google.apps.script.type.sheets", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_version.py b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_version.py new file mode 100644 index 000000000000..558c8aab67c5 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/py.typed b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/py.typed new file mode 100644 index 000000000000..4744d49c1dd6 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-sheets package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/services/__init__.py b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/services/__init__.py new file mode 100644 index 000000000000..8f6cf068242c --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/__init__.py b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/__init__.py new file mode 100644 index 000000000000..1ace157701d5 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .sheets_addon_manifest import ( + SheetsAddOnManifest, + SheetsExtensionPoint, +) + +__all__ = ( + 'SheetsAddOnManifest', + 'SheetsExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py new file mode 100644 index 000000000000..821633e97739 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.sheets', + manifest={ + 'SheetsAddOnManifest', + 'SheetsExtensionPoint', + }, +) + + +class SheetsAddOnManifest(proto.Message): + r"""Sheets add-on manifest. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + on_file_scope_granted_trigger (google.apps.script.type.sheets.types.SheetsExtensionPoint): + Endpoint to execute when file scope + authorization is granted for this document/user + pair. + """ + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=3, + message=extension_point.HomepageExtensionPoint, + ) + on_file_scope_granted_trigger: 'SheetsExtensionPoint' = proto.Field( + proto.MESSAGE, + number=5, + message='SheetsExtensionPoint', + ) + + +class SheetsExtensionPoint(proto.Message): + r"""Common format for declaring a Sheets add-on's triggers. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/mypy.ini b/owl-bot-staging/google-apps-script-type/sheets-py/mypy.ini new file mode 100644 index 000000000000..574c5aed394b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/noxfile.py b/owl-bot-staging/google-apps-script-type/sheets-py/noxfile.py new file mode 100644 index 000000000000..0b6727124b33 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/noxfile.py @@ -0,0 +1,280 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os +import pathlib +import re +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", + "3.12", + "3.13", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = 'google-apps-script-type-sheets' + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.13" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "prerelease_deps", +] + +@nox.session(python=ALL_PYTHON) +@nox.parametrize( + "protobuf_implementation", + [ "python", "upb", "cpp" ], +) +def unit(session, protobuf_implementation): + """Run the unit test suite.""" + + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + session.skip("cpp implementation is not supported in python 3.11+") + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.', "-c", f"testing/constraints-{session.python}.txt") + + # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. + # The 'cpp' implementation requires Protobuf<4. + if protobuf_implementation == "cpp": + session.install("protobuf<4") + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/sheets/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)), + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) + +@nox.session(python=ALL_PYTHON[-1]) +@nox.parametrize( + "protobuf_implementation", + [ "python", "upb", "cpp" ], +) +def prerelease_deps(session, protobuf_implementation): + """Run the unit test suite against pre-release versions of dependencies.""" + + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + session.skip("cpp implementation is not supported in python 3.11+") + + # Install test environment dependencies + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + + # Install the package without dependencies + session.install('-e', '.', '--no-deps') + + # We test the minimum dependency versions using the minimum Python + # version so the lowest python runtime that we test has a corresponding constraints + # file, located at `testing/constraints--.txt`, which contains all of the + # dependencies and extras. + with open( + CURRENT_DIRECTORY + / "testing" + / f"constraints-{ALL_PYTHON[0]}.txt", + encoding="utf-8", + ) as constraints_file: + constraints_text = constraints_file.read() + + # Ignore leading whitespace and comment lines. + constraints_deps = [ + match.group(1) + for match in re.finditer( + r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE + ) + ] + + session.install(*constraints_deps) + + prerel_deps = [ + "googleapis-common-protos", + "google-api-core", + "google-auth", + # Exclude grpcio!=1.67.0rc1 which does not support python 3.13 + "grpcio!=1.67.0rc1", + "grpcio-status", + "protobuf", + "proto-plus", + ] + + for dep in prerel_deps: + session.install("--pre", "--no-deps", "--upgrade", dep) + + # Remaining dependencies + other_deps = [ + "requests", + ] + session.install(*other_deps) + + # Print out prerelease package versions + + session.run("python", "-c", "import google.api_core; print(google.api_core.__version__)") + session.run("python", "-c", "import google.auth; print(google.auth.__version__)") + session.run("python", "-c", "import grpc; print(grpc.__version__)") + session.run( + "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" + ) + session.run( + "python", "-c", "import proto; print(proto.__version__)" + ) + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/sheets/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)), + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install( + 'mypy', + 'types-requests', + 'types-protobuf' + ) + session.install('.') + session.run( + 'mypy', + '-p', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==7.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/scripts/fixup_sheets_keywords.py b/owl-bot-staging/google-apps-script-type/sheets-py/scripts/fixup_sheets_keywords.py new file mode 100644 index 000000000000..fbe6129df8d6 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/scripts/fixup_sheets_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class sheetsCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=sheetsCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the sheets client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/setup.py b/owl-bot-staging/google-apps-script-type/sheets-py/setup.py new file mode 100644 index 000000000000..d32957d80930 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/setup.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import io +import os +import re + +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = 'google-apps-script-type-sheets' + + +description = "Google Apps Script Type Sheets API client library" + +version = None + +with open(os.path.join(package_root, 'google/apps/script/type/sheets/gapic_version.py')) as fp: + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert (len(version_candidates) == 1) + version = version_candidates[0] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + # Exclude incompatible versions of `google-auth` + # See https://github.com/googleapis/google-cloud-python/issues/12364 + "google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0", + "proto-plus >= 1.22.3, <2.0.0dev", + "proto-plus >= 1.25.0, <2.0.0dev; python_version >= '3.13'", + "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "google-apps-script-type >= 0.2.0, <1.0.0dev", +] +extras = { +} +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-apps-script-type-sheets" + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: + readme = readme_file.read() + +packages = [ + package + for package in setuptools.find_namespace_packages() + if package.startswith("google") +] + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url=url, + classifiers=[ + release_status, + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Operating System :: OS Independent", + "Topic :: Internet", + ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + install_requires=dependencies, + extras_require=extras, + include_package_data=True, + zip_safe=False, +) diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.10.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.10.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.11.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.11.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.12.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.12.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.13.txt b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.13.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.13.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.7.txt new file mode 100644 index 000000000000..add339dc78f3 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.7.txt @@ -0,0 +1,11 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.1 +google-auth==2.14.1 +proto-plus==1.22.3 +protobuf==3.20.2 +google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.8.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.9.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/sheets-py/tests/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/sheets/__init__.py b/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/sheets/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/sheets/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/slides-py/.coveragerc b/owl-bot-staging/google-apps-script-type/slides-py/.coveragerc new file mode 100644 index 000000000000..5b06ae94a652 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/apps/script/type/slides/__init__.py + google/apps/script/type/slides/gapic_version.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/slides-py/.flake8 b/owl-bot-staging/google-apps-script-type/slides-py/.flake8 new file mode 100644 index 000000000000..29227d4cf419 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/google-apps-script-type/slides-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/slides-py/MANIFEST.in new file mode 100644 index 000000000000..017124b78953 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/apps/script/type/slides *.py +recursive-include google/apps/script/type/slides *.py diff --git a/owl-bot-staging/google-apps-script-type/slides-py/README.rst b/owl-bot-staging/google-apps-script-type/slides-py/README.rst new file mode 100644 index 000000000000..8baf4a9e8a16 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Apps Script Type Slides API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Apps Script Type Slides API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/slides-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/slides-py/docs/_static/custom.css new file mode 100644 index 000000000000..06423be0b592 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/docs/_static/custom.css @@ -0,0 +1,3 @@ +dl.field-list > dt { + min-width: 100px +} diff --git a/owl-bot-staging/google-apps-script-type/slides-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/slides-py/docs/conf.py new file mode 100644 index 000000000000..36da64433d39 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# google-apps-script-type-slides documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-apps-script-type-slides" +copyright = u"2023, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Apps Script Type Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-apps-script-type-slides-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-apps-script-type-slides.tex", + u"google-apps-script-type-slides Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-apps-script-type-slides", + u"Google Apps Script Type Slides Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-apps-script-type-slides", + u"google-apps-script-type-slides Documentation", + author, + "google-apps-script-type-slides", + "GAPIC library for Google Apps Script Type Slides API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/slides-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/slides-py/docs/index.rst new file mode 100644 index 000000000000..969889deba80 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + slides/services_ + slides/types_ diff --git a/owl-bot-staging/google-apps-script-type/slides-py/docs/slides/services_.rst b/owl-bot-staging/google-apps-script-type/slides-py/docs/slides/services_.rst new file mode 100644 index 000000000000..ab06ee6547e5 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/docs/slides/services_.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Slides API +================================================ +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/slides-py/docs/slides/types_.rst b/owl-bot-staging/google-apps-script-type/slides-py/docs/slides/types_.rst new file mode 100644 index 000000000000..8d074bd3c493 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/docs/slides/types_.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Slides API +============================================= + +.. automodule:: google.apps.script.type.slides.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/__init__.py b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/__init__.py new file mode 100644 index 000000000000..e4bea875c73a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.slides import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.slides_addon_manifest import SlidesAddOnManifest +from .types.slides_addon_manifest import SlidesExtensionPoint + +__all__ = ( +'SlidesAddOnManifest', +'SlidesExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_metadata.json new file mode 100644 index 000000000000..dff8f8bbc7bf --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.slides", + "protoPackage": "google.apps.script.type.slides", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_version.py b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_version.py new file mode 100644 index 000000000000..558c8aab67c5 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/py.typed b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/py.typed new file mode 100644 index 000000000000..eee2788b4c55 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-slides package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/services/__init__.py b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/services/__init__.py new file mode 100644 index 000000000000..8f6cf068242c --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/__init__.py b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/__init__.py new file mode 100644 index 000000000000..4bb7f183eb35 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .slides_addon_manifest import ( + SlidesAddOnManifest, + SlidesExtensionPoint, +) + +__all__ = ( + 'SlidesAddOnManifest', + 'SlidesExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/slides_addon_manifest.py b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/slides_addon_manifest.py new file mode 100644 index 000000000000..035f075e0aa9 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/slides_addon_manifest.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.slides', + manifest={ + 'SlidesAddOnManifest', + 'SlidesExtensionPoint', + }, +) + + +class SlidesAddOnManifest(proto.Message): + r"""Slides add-on manifest. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + on_file_scope_granted_trigger (google.apps.script.type.slides.types.SlidesExtensionPoint): + Endpoint to execute when file scope + authorization is granted for this document/user + pair. + """ + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=1, + message=extension_point.HomepageExtensionPoint, + ) + on_file_scope_granted_trigger: 'SlidesExtensionPoint' = proto.Field( + proto.MESSAGE, + number=2, + message='SlidesExtensionPoint', + ) + + +class SlidesExtensionPoint(proto.Message): + r"""Common format for declaring a Slides add-on's triggers. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/slides-py/mypy.ini b/owl-bot-staging/google-apps-script-type/slides-py/mypy.ini new file mode 100644 index 000000000000..574c5aed394b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/slides-py/noxfile.py b/owl-bot-staging/google-apps-script-type/slides-py/noxfile.py new file mode 100644 index 000000000000..1ae29a5a13f9 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/noxfile.py @@ -0,0 +1,280 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os +import pathlib +import re +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", + "3.12", + "3.13", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = 'google-apps-script-type-slides' + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.13" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "prerelease_deps", +] + +@nox.session(python=ALL_PYTHON) +@nox.parametrize( + "protobuf_implementation", + [ "python", "upb", "cpp" ], +) +def unit(session, protobuf_implementation): + """Run the unit test suite.""" + + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + session.skip("cpp implementation is not supported in python 3.11+") + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.', "-c", f"testing/constraints-{session.python}.txt") + + # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. + # The 'cpp' implementation requires Protobuf<4. + if protobuf_implementation == "cpp": + session.install("protobuf<4") + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/slides/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)), + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) + +@nox.session(python=ALL_PYTHON[-1]) +@nox.parametrize( + "protobuf_implementation", + [ "python", "upb", "cpp" ], +) +def prerelease_deps(session, protobuf_implementation): + """Run the unit test suite against pre-release versions of dependencies.""" + + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + session.skip("cpp implementation is not supported in python 3.11+") + + # Install test environment dependencies + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + + # Install the package without dependencies + session.install('-e', '.', '--no-deps') + + # We test the minimum dependency versions using the minimum Python + # version so the lowest python runtime that we test has a corresponding constraints + # file, located at `testing/constraints--.txt`, which contains all of the + # dependencies and extras. + with open( + CURRENT_DIRECTORY + / "testing" + / f"constraints-{ALL_PYTHON[0]}.txt", + encoding="utf-8", + ) as constraints_file: + constraints_text = constraints_file.read() + + # Ignore leading whitespace and comment lines. + constraints_deps = [ + match.group(1) + for match in re.finditer( + r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE + ) + ] + + session.install(*constraints_deps) + + prerel_deps = [ + "googleapis-common-protos", + "google-api-core", + "google-auth", + # Exclude grpcio!=1.67.0rc1 which does not support python 3.13 + "grpcio!=1.67.0rc1", + "grpcio-status", + "protobuf", + "proto-plus", + ] + + for dep in prerel_deps: + session.install("--pre", "--no-deps", "--upgrade", dep) + + # Remaining dependencies + other_deps = [ + "requests", + ] + session.install(*other_deps) + + # Print out prerelease package versions + + session.run("python", "-c", "import google.api_core; print(google.api_core.__version__)") + session.run("python", "-c", "import google.auth; print(google.auth.__version__)") + session.run("python", "-c", "import grpc; print(grpc.__version__)") + session.run( + "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" + ) + session.run( + "python", "-c", "import proto; print(proto.__version__)" + ) + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/slides/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)), + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install( + 'mypy', + 'types-requests', + 'types-protobuf' + ) + session.install('.') + session.run( + 'mypy', + '-p', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==7.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) diff --git a/owl-bot-staging/google-apps-script-type/slides-py/scripts/fixup_slides_keywords.py b/owl-bot-staging/google-apps-script-type/slides-py/scripts/fixup_slides_keywords.py new file mode 100644 index 000000000000..def800859700 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/scripts/fixup_slides_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class slidesCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=slidesCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the slides client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/slides-py/setup.py b/owl-bot-staging/google-apps-script-type/slides-py/setup.py new file mode 100644 index 000000000000..00244faf89a1 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/setup.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import io +import os +import re + +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = 'google-apps-script-type-slides' + + +description = "Google Apps Script Type Slides API client library" + +version = None + +with open(os.path.join(package_root, 'google/apps/script/type/slides/gapic_version.py')) as fp: + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert (len(version_candidates) == 1) + version = version_candidates[0] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + # Exclude incompatible versions of `google-auth` + # See https://github.com/googleapis/google-cloud-python/issues/12364 + "google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0", + "proto-plus >= 1.22.3, <2.0.0dev", + "proto-plus >= 1.25.0, <2.0.0dev; python_version >= '3.13'", + "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "google-apps-script-type >= 0.2.0, <1.0.0dev", +] +extras = { +} +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-apps-script-type-slides" + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: + readme = readme_file.read() + +packages = [ + package + for package in setuptools.find_namespace_packages() + if package.startswith("google") +] + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url=url, + classifiers=[ + release_status, + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Operating System :: OS Independent", + "Topic :: Internet", + ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + install_requires=dependencies, + extras_require=extras, + include_package_data=True, + zip_safe=False, +) diff --git a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.10.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.10.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.11.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.11.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.12.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.12.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.13.txt b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.13.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.13.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.7.txt new file mode 100644 index 000000000000..add339dc78f3 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.7.txt @@ -0,0 +1,11 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.1 +google-auth==2.14.1 +proto-plus==1.22.3 +protobuf==3.20.2 +google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.8.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.9.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/slides-py/tests/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/slides/__init__.py b/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/slides/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/slides/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/.coveragerc b/owl-bot-staging/google-apps-script-type/type-py/.coveragerc new file mode 100644 index 000000000000..5c23a812e920 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/apps/script/type/__init__.py + google/apps/script/type/gapic_version.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/type-py/.flake8 b/owl-bot-staging/google-apps-script-type/type-py/.flake8 new file mode 100644 index 000000000000..29227d4cf419 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in new file mode 100644 index 000000000000..9cf19ae251ad --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/apps/script/type *.py +recursive-include google/apps/script/type *.py diff --git a/owl-bot-staging/google-apps-script-type/type-py/README.rst b/owl-bot-staging/google-apps-script-type/type-py/README.rst new file mode 100644 index 000000000000..77f60bb3ab2b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Apps Script Type API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Apps Script Type API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css new file mode 100644 index 000000000000..06423be0b592 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css @@ -0,0 +1,3 @@ +dl.field-list > dt { + min-width: 100px +} diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/type-py/docs/conf.py new file mode 100644 index 000000000000..cd25894b268b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# google-apps-script-type documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-apps-script-type" +copyright = u"2023, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Apps Script Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-apps-script-type-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-apps-script-type.tex", + u"google-apps-script-type Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-apps-script-type", + u"Google Apps Script Type Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-apps-script-type", + u"google-apps-script-type Documentation", + author, + "google-apps-script-type", + "GAPIC library for Google Apps Script Type API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/index.rst new file mode 100644 index 000000000000..2605a730d688 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + type/services_ + type/types_ diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/type/services_.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/type/services_.rst new file mode 100644 index 000000000000..2d0581ddccc7 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/type/services_.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type API +========================================= +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/type/types_.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/type/types_.rst new file mode 100644 index 000000000000..1076ae59ac52 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/type/types_.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type API +====================================== + +.. automodule:: google.apps.script.type.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py new file mode 100644 index 000000000000..82fdefc66de1 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.addon_widget_set import AddOnWidgetSet +from .types.extension_point import HomepageExtensionPoint +from .types.extension_point import MenuItemExtensionPoint +from .types.extension_point import UniversalActionExtensionPoint +from .types.script_manifest import CommonAddOnManifest +from .types.script_manifest import HttpOptions +from .types.script_manifest import LayoutProperties +from .types.script_manifest import HttpAuthorizationHeader + +__all__ = ( +'AddOnWidgetSet', +'CommonAddOnManifest', +'HomepageExtensionPoint', +'HttpAuthorizationHeader', +'HttpOptions', +'LayoutProperties', +'MenuItemExtensionPoint', +'UniversalActionExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json new file mode 100644 index 000000000000..ba4a361d1caf --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type", + "protoPackage": "google.apps.script.type", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py new file mode 100644 index 000000000000..558c8aab67c5 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed new file mode 100644 index 000000000000..04b9596b161d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py new file mode 100644 index 000000000000..8f6cf068242c --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py new file mode 100644 index 000000000000..b6dc0acdc19e --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .addon_widget_set import ( + AddOnWidgetSet, +) +from .extension_point import ( + HomepageExtensionPoint, + MenuItemExtensionPoint, + UniversalActionExtensionPoint, +) +from .script_manifest import ( + CommonAddOnManifest, + HttpOptions, + LayoutProperties, + HttpAuthorizationHeader, +) + +__all__ = ( + 'AddOnWidgetSet', + 'HomepageExtensionPoint', + 'MenuItemExtensionPoint', + 'UniversalActionExtensionPoint', + 'CommonAddOnManifest', + 'HttpOptions', + 'LayoutProperties', + 'HttpAuthorizationHeader', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py new file mode 100644 index 000000000000..34c30061c3f0 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + + +__protobuf__ = proto.module( + package='google.apps.script.type', + manifest={ + 'AddOnWidgetSet', + }, +) + + +class AddOnWidgetSet(proto.Message): + r"""The widget subset used by an add-on. + + Attributes: + used_widgets (MutableSequence[google.apps.script.type.types.AddOnWidgetSet.WidgetType]): + The list of widgets used in an add-on. + """ + class WidgetType(proto.Enum): + r"""The Widget type. DEFAULT is the basic widget set. + + Values: + WIDGET_TYPE_UNSPECIFIED (0): + The default widget set. + DATE_PICKER (1): + The date picker. + STYLED_BUTTONS (2): + Styled buttons include filled buttons and + disabled buttons. + PERSISTENT_FORMS (3): + Persistent forms allow persisting form values + during actions. + FIXED_FOOTER (4): + Fixed footer in card. + UPDATE_SUBJECT_AND_RECIPIENTS (5): + Update the subject and recipients of a draft. + GRID_WIDGET (6): + The grid widget. + ADDON_COMPOSE_UI_ACTION (7): + A Gmail add-on action that applies to the + addon compose UI. + """ + WIDGET_TYPE_UNSPECIFIED = 0 + DATE_PICKER = 1 + STYLED_BUTTONS = 2 + PERSISTENT_FORMS = 3 + FIXED_FOOTER = 4 + UPDATE_SUBJECT_AND_RECIPIENTS = 5 + GRID_WIDGET = 6 + ADDON_COMPOSE_UI_ACTION = 7 + + used_widgets: MutableSequence[WidgetType] = proto.RepeatedField( + proto.ENUM, + number=1, + enum=WidgetType, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py new file mode 100644 index 000000000000..5686dee1df2c --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py @@ -0,0 +1,139 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.protobuf import wrappers_pb2 # type: ignore + + +__protobuf__ = proto.module( + package='google.apps.script.type', + manifest={ + 'MenuItemExtensionPoint', + 'HomepageExtensionPoint', + 'UniversalActionExtensionPoint', + }, +) + + +class MenuItemExtensionPoint(proto.Message): + r"""Common format for declaring a menu item, or button, that + appears within a host app. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + label (str): + Required. User-visible text describing the + action taken by activating this extension point. + For example, "Insert invoice". + logo_url (str): + The URL for the logo image shown in the + add-on toolbar. + If not set, defaults to the add-on's primary + logo URL. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + label: str = proto.Field( + proto.STRING, + number=2, + ) + logo_url: str = proto.Field( + proto.STRING, + number=3, + ) + + +class HomepageExtensionPoint(proto.Message): + r"""Common format for declaring an add-on's home-page view. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + enabled (google.protobuf.wrappers_pb2.BoolValue): + Optional. If set to ``false``, disable the home-page view in + this context. + + Defaults to ``true`` if unset. + + If an add-ons custom home-page view is disabled, an + autogenerated overview card will be provided for users + instead. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + enabled: wrappers_pb2.BoolValue = proto.Field( + proto.MESSAGE, + number=2, + message=wrappers_pb2.BoolValue, + ) + + +class UniversalActionExtensionPoint(proto.Message): + r"""Format for declaring a universal action menu item extension + point. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + label (str): + Required. User-visible text describing the + action taken by activating this extension point, + for example, "Add a new contact". + open_link (str): + URL to be opened by the UniversalAction. + + This field is a member of `oneof`_ ``action_type``. + run_function (str): + Endpoint to be run by the UniversalAction. + + This field is a member of `oneof`_ ``action_type``. + """ + + label: str = proto.Field( + proto.STRING, + number=1, + ) + open_link: str = proto.Field( + proto.STRING, + number=2, + oneof='action_type', + ) + run_function: str = proto.Field( + proto.STRING, + number=3, + oneof='action_type', + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py new file mode 100644 index 000000000000..7478eb72346a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py @@ -0,0 +1,186 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import addon_widget_set +from google.apps.script.type.types import extension_point +from google.protobuf import struct_pb2 # type: ignore + + +__protobuf__ = proto.module( + package='google.apps.script.type', + manifest={ + 'HttpAuthorizationHeader', + 'CommonAddOnManifest', + 'LayoutProperties', + 'HttpOptions', + }, +) + + +class HttpAuthorizationHeader(proto.Enum): + r"""Authorization header sent in add-on HTTP requests + + Values: + HTTP_AUTHORIZATION_HEADER_UNSPECIFIED (0): + Default value, equivalent to ``SYSTEM_ID_TOKEN`` + SYSTEM_ID_TOKEN (1): + Send an ID token for the project-specific + Google Workspace add-ons system service account + (default) + USER_ID_TOKEN (2): + Send an ID token for the end user + NONE (3): + Do not send an Authentication header + """ + HTTP_AUTHORIZATION_HEADER_UNSPECIFIED = 0 + SYSTEM_ID_TOKEN = 1 + USER_ID_TOKEN = 2 + NONE = 3 + + +class CommonAddOnManifest(proto.Message): + r"""Add-on configuration that is shared across all add-on host + applications. + + Attributes: + name (str): + Required. The display name of the add-on. + logo_url (str): + Required. The URL for the logo image shown in + the add-on toolbar. + layout_properties (google.apps.script.type.types.LayoutProperties): + Common layout properties for the add-on + cards. + add_on_widget_set (google.apps.script.type.types.AddOnWidgetSet): + The widgets used in the add-on. If this field + is not specified, it indicates that default set + is used. + use_locale_from_app (bool): + Whether to pass locale information from host + app. + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + Defines an endpoint that will be executed in + any context, in any host. Any cards generated by + this function will always be available to the + user, but may be eclipsed by contextual content + when this add-on declares more targeted + triggers. + universal_actions (MutableSequence[google.apps.script.type.types.UniversalActionExtensionPoint]): + Defines a list of extension points in the + universal action menu which serves as a setting + menu for the add-on. The extension point can be + link URL to open or an endpoint to execute as a + form submission. + open_link_url_prefixes (google.protobuf.struct_pb2.ListValue): + An OpenLink action can only use a URL with an HTTPS, MAILTO + or TEL scheme. For HTTPS links, the URL must also + `match `__ + one of the prefixes specified in this whitelist. If the + prefix omits the scheme, HTTPS is assumed. Notice that HTTP + links are automatically rewritten to HTTPS links. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + logo_url: str = proto.Field( + proto.STRING, + number=2, + ) + layout_properties: 'LayoutProperties' = proto.Field( + proto.MESSAGE, + number=3, + message='LayoutProperties', + ) + add_on_widget_set: addon_widget_set.AddOnWidgetSet = proto.Field( + proto.MESSAGE, + number=4, + message=addon_widget_set.AddOnWidgetSet, + ) + use_locale_from_app: bool = proto.Field( + proto.BOOL, + number=5, + ) + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=6, + message=extension_point.HomepageExtensionPoint, + ) + universal_actions: MutableSequence[extension_point.UniversalActionExtensionPoint] = proto.RepeatedField( + proto.MESSAGE, + number=7, + message=extension_point.UniversalActionExtensionPoint, + ) + open_link_url_prefixes: struct_pb2.ListValue = proto.Field( + proto.MESSAGE, + number=8, + message=struct_pb2.ListValue, + ) + + +class LayoutProperties(proto.Message): + r"""Card layout properties shared across all add-on host + applications. + + Attributes: + primary_color (str): + The primary color of the add-on. It sets the + color of toolbar. If no primary color is set + explicitly, the default value provided by the + framework is used. + secondary_color (str): + The secondary color of the add-on. It sets + the color of buttons. If primary color is set + but no secondary color is set, the secondary + color is the same as the primary color. If + neither primary color nor secondary color is + set, the default value provided by the framework + is used. + """ + + primary_color: str = proto.Field( + proto.STRING, + number=1, + ) + secondary_color: str = proto.Field( + proto.STRING, + number=2, + ) + + +class HttpOptions(proto.Message): + r"""Options for sending requests to add-on HTTP endpoints + + Attributes: + authorization_header (google.apps.script.type.types.HttpAuthorizationHeader): + Configuration for the token sent in the HTTP + Authorization header + """ + + authorization_header: 'HttpAuthorizationHeader' = proto.Field( + proto.ENUM, + number=1, + enum='HttpAuthorizationHeader', + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/mypy.ini b/owl-bot-staging/google-apps-script-type/type-py/mypy.ini new file mode 100644 index 000000000000..574c5aed394b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/type-py/noxfile.py b/owl-bot-staging/google-apps-script-type/type-py/noxfile.py new file mode 100644 index 000000000000..68e1928c917c --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/noxfile.py @@ -0,0 +1,280 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os +import pathlib +import re +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", + "3.12", + "3.13", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = 'google-apps-script-type' + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.13" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "prerelease_deps", +] + +@nox.session(python=ALL_PYTHON) +@nox.parametrize( + "protobuf_implementation", + [ "python", "upb", "cpp" ], +) +def unit(session, protobuf_implementation): + """Run the unit test suite.""" + + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + session.skip("cpp implementation is not supported in python 3.11+") + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.', "-c", f"testing/constraints-{session.python}.txt") + + # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. + # The 'cpp' implementation requires Protobuf<4. + if protobuf_implementation == "cpp": + session.install("protobuf<4") + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)), + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) + +@nox.session(python=ALL_PYTHON[-1]) +@nox.parametrize( + "protobuf_implementation", + [ "python", "upb", "cpp" ], +) +def prerelease_deps(session, protobuf_implementation): + """Run the unit test suite against pre-release versions of dependencies.""" + + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + session.skip("cpp implementation is not supported in python 3.11+") + + # Install test environment dependencies + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + + # Install the package without dependencies + session.install('-e', '.', '--no-deps') + + # We test the minimum dependency versions using the minimum Python + # version so the lowest python runtime that we test has a corresponding constraints + # file, located at `testing/constraints--.txt`, which contains all of the + # dependencies and extras. + with open( + CURRENT_DIRECTORY + / "testing" + / f"constraints-{ALL_PYTHON[0]}.txt", + encoding="utf-8", + ) as constraints_file: + constraints_text = constraints_file.read() + + # Ignore leading whitespace and comment lines. + constraints_deps = [ + match.group(1) + for match in re.finditer( + r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE + ) + ] + + session.install(*constraints_deps) + + prerel_deps = [ + "googleapis-common-protos", + "google-api-core", + "google-auth", + # Exclude grpcio!=1.67.0rc1 which does not support python 3.13 + "grpcio!=1.67.0rc1", + "grpcio-status", + "protobuf", + "proto-plus", + ] + + for dep in prerel_deps: + session.install("--pre", "--no-deps", "--upgrade", dep) + + # Remaining dependencies + other_deps = [ + "requests", + ] + session.install(*other_deps) + + # Print out prerelease package versions + + session.run("python", "-c", "import google.api_core; print(google.api_core.__version__)") + session.run("python", "-c", "import google.auth; print(google.auth.__version__)") + session.run("python", "-c", "import grpc; print(grpc.__version__)") + session.run( + "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" + ) + session.run( + "python", "-c", "import proto; print(proto.__version__)" + ) + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)), + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install( + 'mypy', + 'types-requests', + 'types-protobuf' + ) + session.install('.') + session.run( + 'mypy', + '-p', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==7.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py new file mode 100644 index 000000000000..bae51b8ecbd3 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class typeCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=typeCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the type client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/setup.py b/owl-bot-staging/google-apps-script-type/type-py/setup.py new file mode 100644 index 000000000000..9a60f0e18cdc --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/setup.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import io +import os +import re + +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = 'google-apps-script-type' + + +description = "Google Apps Script Type API client library" + +version = None + +with open(os.path.join(package_root, 'google/apps/script/type/gapic_version.py')) as fp: + version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) + assert (len(version_candidates) == 1) + version = version_candidates[0] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + # Exclude incompatible versions of `google-auth` + # See https://github.com/googleapis/google-cloud-python/issues/12364 + "google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0", + "proto-plus >= 1.22.3, <2.0.0dev", + "proto-plus >= 1.25.0, <2.0.0dev; python_version >= '3.13'", + "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", +] +extras = { +} +url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-apps-script-type" + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: + readme = readme_file.read() + +packages = [ + package + for package in setuptools.find_namespace_packages() + if package.startswith("google") +] + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url=url, + classifiers=[ + release_status, + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Operating System :: OS Independent", + "Topic :: Internet", + ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + install_requires=dependencies, + extras_require=extras, + include_package_data=True, + zip_safe=False, +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt new file mode 100644 index 000000000000..ed7f9aed2559 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt new file mode 100644 index 000000000000..ed7f9aed2559 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt new file mode 100644 index 000000000000..ed7f9aed2559 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.13.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.13.txt new file mode 100644 index 000000000000..ed7f9aed2559 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.13.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt new file mode 100644 index 000000000000..fc812592b0ee --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt @@ -0,0 +1,10 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.1 +google-auth==2.14.1 +proto-plus==1.22.3 +protobuf==3.20.2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt new file mode 100644 index 000000000000..ed7f9aed2559 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt new file mode 100644 index 000000000000..ed7f9aed2559 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py new file mode 100644 index 000000000000..7b3de3117f38 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# From 2c161a78d410c47a66bd8ea4440f937ebd479563 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 24 Jan 2025 01:06:06 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../calendar-py/.coveragerc | 13 - .../calendar-py/.flake8 | 33 -- .../calendar-py/MANIFEST.in | 2 - .../calendar-py/README.rst | 49 --- .../calendar-py/docs/_static/custom.css | 3 - .../calendar-py/docs/calendar/services_.rst | 4 - .../calendar-py/docs/calendar/types_.rst | 6 - .../calendar-py/docs/conf.py | 376 ------------------ .../calendar-py/docs/index.rst | 7 - .../apps/script/type/calendar/__init__.py | 30 -- .../script/type/calendar/gapic_metadata.json | 7 - .../script/type/calendar/gapic_version.py | 16 - .../google/apps/script/type/calendar/py.typed | 2 - .../script/type/calendar/services/__init__.py | 15 - .../script/type/calendar/types/__init__.py | 26 -- .../calendar/types/calendar_addon_manifest.py | 184 --------- .../calendar-py/mypy.ini | 3 - .../calendar-py/noxfile.py | 280 ------------- .../scripts/fixup_calendar_keywords.py | 175 -------- .../calendar-py/setup.py | 99 ----- .../calendar-py/testing/constraints-3.10.txt | 7 - .../calendar-py/testing/constraints-3.11.txt | 7 - .../calendar-py/testing/constraints-3.12.txt | 7 - .../calendar-py/testing/constraints-3.13.txt | 7 - .../calendar-py/testing/constraints-3.7.txt | 11 - .../calendar-py/testing/constraints-3.8.txt | 7 - .../calendar-py/testing/constraints-3.9.txt | 7 - .../calendar-py/tests/__init__.py | 16 - .../calendar-py/tests/unit/__init__.py | 16 - .../calendar-py/tests/unit/gapic/__init__.py | 16 - .../tests/unit/gapic/calendar/__init__.py | 16 - .../docs-py/.coveragerc | 13 - .../google-apps-script-type/docs-py/.flake8 | 33 -- .../docs-py/MANIFEST.in | 2 - .../docs-py/README.rst | 49 --- .../docs-py/docs/_static/custom.css | 3 - .../docs-py/docs/conf.py | 376 ------------------ .../docs-py/docs/docs/services_.rst | 4 - .../docs-py/docs/docs/types_.rst | 6 - .../docs-py/docs/index.rst | 7 - .../google/apps/script/type/docs/__init__.py | 28 -- .../apps/script/type/docs/gapic_metadata.json | 7 - .../apps/script/type/docs/gapic_version.py | 16 - .../google/apps/script/type/docs/py.typed | 2 - .../script/type/docs/services/__init__.py | 15 - .../apps/script/type/docs/types/__init__.py | 24 -- .../type/docs/types/docs_addon_manifest.py | 74 ---- .../google-apps-script-type/docs-py/mypy.ini | 3 - .../docs-py/noxfile.py | 280 ------------- .../docs-py/scripts/fixup_docs_keywords.py | 175 -------- .../google-apps-script-type/docs-py/setup.py | 99 ----- .../docs-py/testing/constraints-3.10.txt | 7 - .../docs-py/testing/constraints-3.11.txt | 7 - .../docs-py/testing/constraints-3.12.txt | 7 - .../docs-py/testing/constraints-3.13.txt | 7 - .../docs-py/testing/constraints-3.7.txt | 11 - .../docs-py/testing/constraints-3.8.txt | 7 - .../docs-py/testing/constraints-3.9.txt | 7 - .../docs-py/tests/__init__.py | 16 - .../docs-py/tests/unit/__init__.py | 16 - .../docs-py/tests/unit/gapic/__init__.py | 16 - .../docs-py/tests/unit/gapic/docs/__init__.py | 16 - .../drive-py/.coveragerc | 13 - .../google-apps-script-type/drive-py/.flake8 | 33 -- .../drive-py/MANIFEST.in | 2 - .../drive-py/README.rst | 49 --- .../drive-py/docs/_static/custom.css | 3 - .../drive-py/docs/conf.py | 376 ------------------ .../drive-py/docs/drive/services_.rst | 4 - .../drive-py/docs/drive/types_.rst | 6 - .../drive-py/docs/index.rst | 7 - .../google/apps/script/type/drive/__init__.py | 28 -- .../script/type/drive/gapic_metadata.json | 7 - .../apps/script/type/drive/gapic_version.py | 16 - .../google/apps/script/type/drive/py.typed | 2 - .../script/type/drive/services/__init__.py | 15 - .../apps/script/type/drive/types/__init__.py | 24 -- .../type/drive/types/drive_addon_manifest.py | 76 ---- .../google-apps-script-type/drive-py/mypy.ini | 3 - .../drive-py/noxfile.py | 280 ------------- .../drive-py/scripts/fixup_drive_keywords.py | 175 -------- .../google-apps-script-type/drive-py/setup.py | 99 ----- .../drive-py/testing/constraints-3.10.txt | 7 - .../drive-py/testing/constraints-3.11.txt | 7 - .../drive-py/testing/constraints-3.12.txt | 7 - .../drive-py/testing/constraints-3.13.txt | 7 - .../drive-py/testing/constraints-3.7.txt | 11 - .../drive-py/testing/constraints-3.8.txt | 7 - .../drive-py/testing/constraints-3.9.txt | 7 - .../drive-py/tests/__init__.py | 16 - .../drive-py/tests/unit/__init__.py | 16 - .../drive-py/tests/unit/gapic/__init__.py | 16 - .../tests/unit/gapic/drive/__init__.py | 16 - .../gmail-py/.coveragerc | 13 - .../google-apps-script-type/gmail-py/.flake8 | 33 -- .../gmail-py/MANIFEST.in | 2 - .../gmail-py/README.rst | 49 --- .../gmail-py/docs/_static/custom.css | 3 - .../gmail-py/docs/conf.py | 376 ------------------ .../gmail-py/docs/gmail/services_.rst | 4 - .../gmail-py/docs/gmail/types_.rst | 6 - .../gmail-py/docs/index.rst | 7 - .../google/apps/script/type/gmail/__init__.py | 34 -- .../script/type/gmail/gapic_metadata.json | 7 - .../apps/script/type/gmail/gapic_version.py | 16 - .../google/apps/script/type/gmail/py.typed | 2 - .../script/type/gmail/services/__init__.py | 15 - .../apps/script/type/gmail/types/__init__.py | 30 -- .../type/gmail/types/gmail_addon_manifest.py | 232 ----------- .../google-apps-script-type/gmail-py/mypy.ini | 3 - .../gmail-py/noxfile.py | 280 ------------- .../gmail-py/scripts/fixup_gmail_keywords.py | 175 -------- .../google-apps-script-type/gmail-py/setup.py | 99 ----- .../gmail-py/testing/constraints-3.10.txt | 7 - .../gmail-py/testing/constraints-3.11.txt | 7 - .../gmail-py/testing/constraints-3.12.txt | 7 - .../gmail-py/testing/constraints-3.13.txt | 7 - .../gmail-py/testing/constraints-3.7.txt | 11 - .../gmail-py/testing/constraints-3.8.txt | 7 - .../gmail-py/testing/constraints-3.9.txt | 7 - .../gmail-py/tests/__init__.py | 16 - .../gmail-py/tests/unit/__init__.py | 16 - .../gmail-py/tests/unit/gapic/__init__.py | 16 - .../tests/unit/gapic/gmail/__init__.py | 16 - .../sheets-py/.coveragerc | 13 - .../google-apps-script-type/sheets-py/.flake8 | 33 -- .../sheets-py/MANIFEST.in | 2 - .../sheets-py/README.rst | 49 --- .../sheets-py/docs/_static/custom.css | 3 - .../sheets-py/docs/conf.py | 376 ------------------ .../sheets-py/docs/index.rst | 7 - .../sheets-py/docs/sheets/services_.rst | 4 - .../sheets-py/docs/sheets/types_.rst | 6 - .../apps/script/type/sheets/__init__.py | 28 -- .../script/type/sheets/gapic_metadata.json | 7 - .../apps/script/type/sheets/gapic_version.py | 16 - .../google/apps/script/type/sheets/py.typed | 2 - .../script/type/sheets/services/__init__.py | 15 - .../apps/script/type/sheets/types/__init__.py | 24 -- .../sheets/types/sheets_addon_manifest.py | 74 ---- .../sheets-py/mypy.ini | 3 - .../sheets-py/noxfile.py | 280 ------------- .../scripts/fixup_sheets_keywords.py | 175 -------- .../sheets-py/setup.py | 99 ----- .../sheets-py/testing/constraints-3.10.txt | 7 - .../sheets-py/testing/constraints-3.11.txt | 7 - .../sheets-py/testing/constraints-3.12.txt | 7 - .../sheets-py/testing/constraints-3.13.txt | 7 - .../sheets-py/testing/constraints-3.7.txt | 11 - .../sheets-py/testing/constraints-3.8.txt | 7 - .../sheets-py/testing/constraints-3.9.txt | 7 - .../sheets-py/tests/__init__.py | 16 - .../sheets-py/tests/unit/__init__.py | 16 - .../sheets-py/tests/unit/gapic/__init__.py | 16 - .../tests/unit/gapic/sheets/__init__.py | 16 - .../slides-py/.coveragerc | 13 - .../google-apps-script-type/slides-py/.flake8 | 33 -- .../slides-py/MANIFEST.in | 2 - .../slides-py/README.rst | 49 --- .../slides-py/docs/_static/custom.css | 3 - .../slides-py/docs/conf.py | 376 ------------------ .../slides-py/docs/index.rst | 7 - .../slides-py/docs/slides/services_.rst | 4 - .../slides-py/docs/slides/types_.rst | 6 - .../apps/script/type/slides/__init__.py | 28 -- .../script/type/slides/gapic_metadata.json | 7 - .../apps/script/type/slides/gapic_version.py | 16 - .../google/apps/script/type/slides/py.typed | 2 - .../script/type/slides/services/__init__.py | 15 - .../apps/script/type/slides/types/__init__.py | 24 -- .../slides/types/slides_addon_manifest.py | 74 ---- .../slides-py/mypy.ini | 3 - .../slides-py/noxfile.py | 280 ------------- .../scripts/fixup_slides_keywords.py | 175 -------- .../slides-py/setup.py | 99 ----- .../slides-py/testing/constraints-3.10.txt | 7 - .../slides-py/testing/constraints-3.11.txt | 7 - .../slides-py/testing/constraints-3.12.txt | 7 - .../slides-py/testing/constraints-3.13.txt | 7 - .../slides-py/testing/constraints-3.7.txt | 11 - .../slides-py/testing/constraints-3.8.txt | 7 - .../slides-py/testing/constraints-3.9.txt | 7 - .../slides-py/tests/__init__.py | 16 - .../slides-py/tests/unit/__init__.py | 16 - .../slides-py/tests/unit/gapic/__init__.py | 16 - .../tests/unit/gapic/slides/__init__.py | 16 - .../type-py/.coveragerc | 13 - .../google-apps-script-type/type-py/.flake8 | 33 -- .../type-py/MANIFEST.in | 2 - .../type-py/README.rst | 49 --- .../type-py/docs/_static/custom.css | 3 - .../type-py/docs/conf.py | 376 ------------------ .../type-py/docs/index.rst | 7 - .../type-py/docs/type/services_.rst | 4 - .../type-py/docs/type/types_.rst | 6 - .../google/apps/script/type/__init__.py | 40 -- .../apps/script/type/gapic_metadata.json | 7 - .../google/apps/script/type/gapic_version.py | 16 - .../type-py/google/apps/script/type/py.typed | 2 - .../apps/script/type/services/__init__.py | 15 - .../google/apps/script/type/types/__init__.py | 40 -- .../script/type/types/addon_widget_set.py | 78 ---- .../apps/script/type/types/extension_point.py | 139 ------- .../apps/script/type/types/script_manifest.py | 186 --------- .../google-apps-script-type/type-py/mypy.ini | 3 - .../type-py/noxfile.py | 280 ------------- .../type-py/scripts/fixup_type_keywords.py | 175 -------- .../google-apps-script-type/type-py/setup.py | 98 ----- .../type-py/testing/constraints-3.10.txt | 6 - .../type-py/testing/constraints-3.11.txt | 6 - .../type-py/testing/constraints-3.12.txt | 6 - .../type-py/testing/constraints-3.13.txt | 6 - .../type-py/testing/constraints-3.7.txt | 10 - .../type-py/testing/constraints-3.8.txt | 6 - .../type-py/testing/constraints-3.9.txt | 6 - .../type-py/tests/__init__.py | 16 - .../type-py/tests/unit/__init__.py | 16 - .../type-py/tests/unit/gapic/__init__.py | 16 - .../type-py/tests/unit/gapic/type/__init__.py | 16 - .../script/type/calendar/gapic_version.py | 2 +- .../apps/script/type/docs/gapic_version.py | 2 +- .../apps/script/type/drive/gapic_version.py | 2 +- .../google/apps/script/type/gapic_version.py | 2 +- .../apps/script/type/gmail/gapic_version.py | 2 +- .../apps/script/type/sheets/gapic_version.py | 2 +- .../apps/script/type/slides/gapic_version.py | 2 +- .../apps/script/type/types/script_manifest.py | 2 +- 227 files changed, 8 insertions(+), 9974 deletions(-) delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/.coveragerc delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/.flake8 delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/MANIFEST.in delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/README.rst delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/docs/_static/custom.css delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/services_.rst delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/types_.rst delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/docs/conf.py delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/docs/index.rst delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_metadata.json delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_version.py delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/py.typed delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/services/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/mypy.ini delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/noxfile.py delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/scripts/fixup_calendar_keywords.py delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/setup.py delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.10.txt delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.11.txt delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.12.txt delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.13.txt delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.7.txt delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.8.txt delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.9.txt delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/tests/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/calendar/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/.coveragerc delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/.flake8 delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/MANIFEST.in delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/README.rst delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/docs/_static/custom.css delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/docs/conf.py delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/docs/docs/services_.rst delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/docs/docs/types_.rst delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/docs/index.rst delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_metadata.json delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_version.py delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/py.typed delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/services/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/docs_addon_manifest.py delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/mypy.ini delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/noxfile.py delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/scripts/fixup_docs_keywords.py delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/setup.py delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.10.txt delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.11.txt delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.12.txt delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.13.txt delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.7.txt delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.8.txt delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.9.txt delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/tests/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/tests/unit/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/docs/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/.coveragerc delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/.flake8 delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/MANIFEST.in delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/README.rst delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/docs/_static/custom.css delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/docs/conf.py delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/docs/drive/services_.rst delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/docs/drive/types_.rst delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/docs/index.rst delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_metadata.json delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_version.py delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/py.typed delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/services/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/drive_addon_manifest.py delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/mypy.ini delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/noxfile.py delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/scripts/fixup_drive_keywords.py delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/setup.py delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.10.txt delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.11.txt delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.12.txt delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.13.txt delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.7.txt delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.8.txt delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.9.txt delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/tests/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/tests/unit/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/drive/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/.coveragerc delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/.flake8 delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/MANIFEST.in delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/README.rst delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/docs/_static/custom.css delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/docs/conf.py delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/services_.rst delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/types_.rst delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/docs/index.rst delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_metadata.json delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_version.py delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/py.typed delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/services/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/mypy.ini delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/noxfile.py delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/scripts/fixup_gmail_keywords.py delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/setup.py delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.10.txt delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.11.txt delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.12.txt delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.13.txt delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.7.txt delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.8.txt delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.9.txt delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/tests/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/gmail/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/.coveragerc delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/.flake8 delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/MANIFEST.in delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/README.rst delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/docs/_static/custom.css delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/docs/conf.py delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/docs/index.rst delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/services_.rst delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/types_.rst delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_metadata.json delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_version.py delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/py.typed delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/services/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/mypy.ini delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/noxfile.py delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/scripts/fixup_sheets_keywords.py delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/setup.py delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.10.txt delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.11.txt delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.12.txt delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.13.txt delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.7.txt delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.8.txt delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.9.txt delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/tests/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/sheets/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/.coveragerc delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/.flake8 delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/MANIFEST.in delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/README.rst delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/docs/_static/custom.css delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/docs/conf.py delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/docs/index.rst delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/docs/slides/services_.rst delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/docs/slides/types_.rst delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_metadata.json delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_version.py delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/py.typed delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/services/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/slides_addon_manifest.py delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/mypy.ini delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/noxfile.py delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/scripts/fixup_slides_keywords.py delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/setup.py delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.10.txt delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.11.txt delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.12.txt delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.13.txt delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.7.txt delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.8.txt delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.9.txt delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/tests/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/tests/unit/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/slides/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/.coveragerc delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/.flake8 delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/README.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/conf.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/index.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/type/services_.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/type/types_.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/mypy.ini delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/noxfile.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/setup.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.13.txt delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/.coveragerc b/owl-bot-staging/google-apps-script-type/calendar-py/.coveragerc deleted file mode 100644 index d4b802b28cd6..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/.coveragerc +++ /dev/null @@ -1,13 +0,0 @@ -[run] -branch = True - -[report] -show_missing = True -omit = - google/apps/script/type/calendar/__init__.py - google/apps/script/type/calendar/gapic_version.py -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/.flake8 b/owl-bot-staging/google-apps-script-type/calendar-py/.flake8 deleted file mode 100644 index 29227d4cf419..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/.flake8 +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - **/services/** - **/types/** - *_pb2.py - - # Standard linting exemptions. - **/.nox/** - __pycache__, - .git, - *.pyc, - conf.py diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/calendar-py/MANIFEST.in deleted file mode 100644 index cf01681dbb35..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -recursive-include google/apps/script/type/calendar *.py -recursive-include google/apps/script/type/calendar *.py diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/README.rst b/owl-bot-staging/google-apps-script-type/calendar-py/README.rst deleted file mode 100644 index 199f54ef3956..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/README.rst +++ /dev/null @@ -1,49 +0,0 @@ -Python Client for Google Apps Script Type Calendar API -================================================= - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. Enable the Google Apps Script Type Calendar API. -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - python3 -m venv - source /bin/activate - /bin/pip install /path/to/library - - -Windows -^^^^^^^ - -.. code-block:: console - - python3 -m venv - \Scripts\activate - \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/calendar-py/docs/_static/custom.css deleted file mode 100644 index 06423be0b592..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/docs/_static/custom.css +++ /dev/null @@ -1,3 +0,0 @@ -dl.field-list > dt { - min-width: 100px -} diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/services_.rst b/owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/services_.rst deleted file mode 100644 index 3f8cdc1e081a..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/services_.rst +++ /dev/null @@ -1,4 +0,0 @@ -Services for Google Apps Script Type Calendar API -================================================== -.. toctree:: - :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/types_.rst b/owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/types_.rst deleted file mode 100644 index 5d78802c53ab..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/docs/calendar/types_.rst +++ /dev/null @@ -1,6 +0,0 @@ -Types for Google Apps Script Type Calendar API -=============================================== - -.. automodule:: google.apps.script.type.calendar.types - :members: - :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/calendar-py/docs/conf.py deleted file mode 100644 index 04d0bec0d90a..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/docs/conf.py +++ /dev/null @@ -1,376 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# -# google-apps-script-type-calendar documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "4.0.1" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The root toctree document. -root_doc = "index" - -# General information about the project. -project = u"google-apps-script-type-calendar" -copyright = u"2023, Google, LLC" -author = u"Google APIs" # TODO: autogenerate this bit - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = 'en' - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Apps Script Type Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-apps-script-type-calendar-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - # 'preamble': '', - # Latex figure (float) alignment - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - root_doc, - "google-apps-script-type-calendar.tex", - u"google-apps-script-type-calendar Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - root_doc, - "google-apps-script-type-calendar", - u"Google Apps Script Type Calendar Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - root_doc, - "google-apps-script-type-calendar", - u"google-apps-script-type-calendar Documentation", - author, - "google-apps-script-type-calendar", - "GAPIC library for Google Apps Script Type Calendar API", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("http://requests.kennethreitz.org/en/stable/", None), - "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), - "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/calendar-py/docs/index.rst deleted file mode 100644 index e0b99eedd868..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/docs/index.rst +++ /dev/null @@ -1,7 +0,0 @@ -API Reference -------------- -.. toctree:: - :maxdepth: 2 - - calendar/services_ - calendar/types_ diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/__init__.py b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/__init__.py deleted file mode 100644 index d1d87a00493a..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from google.apps.script.type.calendar import gapic_version as package_version - -__version__ = package_version.__version__ - - - -from .types.calendar_addon_manifest import CalendarAddOnManifest -from .types.calendar_addon_manifest import CalendarExtensionPoint -from .types.calendar_addon_manifest import ConferenceSolution - -__all__ = ( -'CalendarAddOnManifest', -'CalendarExtensionPoint', -'ConferenceSolution', -) diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_metadata.json deleted file mode 100644 index c2cc763ffc99..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_metadata.json +++ /dev/null @@ -1,7 +0,0 @@ - { - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "python", - "libraryPackage": "google.apps.script.type.calendar", - "protoPackage": "google.apps.script.type.calendar", - "schema": "1.0" -} diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_version.py b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_version.py deleted file mode 100644 index 558c8aab67c5..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/gapic_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/py.typed b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/py.typed deleted file mode 100644 index c8179d505670..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-apps-script-type-calendar package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/services/__init__.py b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/services/__init__.py deleted file mode 100644 index 8f6cf068242c..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/__init__.py b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/__init__.py deleted file mode 100644 index ac7d7a5dbc8e..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from .calendar_addon_manifest import ( - CalendarAddOnManifest, - CalendarExtensionPoint, - ConferenceSolution, -) - -__all__ = ( - 'CalendarAddOnManifest', - 'CalendarExtensionPoint', - 'ConferenceSolution', -) diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py b/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py deleted file mode 100644 index 5ed3da0536fe..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py +++ /dev/null @@ -1,184 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.apps.script.type.types import extension_point - - -__protobuf__ = proto.module( - package='google.apps.script.type.calendar', - manifest={ - 'CalendarAddOnManifest', - 'ConferenceSolution', - 'CalendarExtensionPoint', - }, -) - - -class CalendarAddOnManifest(proto.Message): - r"""Calendar add-on manifest. - - Attributes: - homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): - Defines an endpoint that will be executed contexts that - don't match a declared contextual trigger. Any cards - generated by this function will always be available to the - user, but may be eclipsed by contextual content when this - add-on declares more targeted triggers. - - If present, this overrides the configuration from - ``addOns.common.homepageTrigger``. - conference_solution (MutableSequence[google.apps.script.type.calendar.types.ConferenceSolution]): - Defines conference solutions provided by this - add-on. - create_settings_url_function (str): - An endpoint to execute that creates a URL to - the add-on's settings page. - event_open_trigger (google.apps.script.type.calendar.types.CalendarExtensionPoint): - An endpoint to trigger when an event is - opened (viewed/edited). - event_update_trigger (google.apps.script.type.calendar.types.CalendarExtensionPoint): - An endpoint to trigger when the open event is - updated. - current_event_access (google.apps.script.type.calendar.types.CalendarAddOnManifest.EventAccess): - Define the level of data access when an event - addon is triggered. - """ - class EventAccess(proto.Enum): - r"""An enum defining the level of data access event triggers - require. - - Values: - UNSPECIFIED (0): - Default value when nothing is set for - EventAccess. - METADATA (1): - METADATA gives event triggers the permission - to access the metadata of events such as event - id and calendar id. - READ (3): - READ gives event triggers access to all - provided event fields including the metadata, - attendees, and conference data. - WRITE (4): - WRITE gives event triggers access to the - metadata of events and the ability to perform - all actions, including adding attendees and - setting conference data. - READ_WRITE (5): - READ_WRITE gives event triggers access to all provided event - fields including the metadata, attendees, and conference - data and the ability to perform all actions. - """ - UNSPECIFIED = 0 - METADATA = 1 - READ = 3 - WRITE = 4 - READ_WRITE = 5 - - homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( - proto.MESSAGE, - number=6, - message=extension_point.HomepageExtensionPoint, - ) - conference_solution: MutableSequence['ConferenceSolution'] = proto.RepeatedField( - proto.MESSAGE, - number=3, - message='ConferenceSolution', - ) - create_settings_url_function: str = proto.Field( - proto.STRING, - number=5, - ) - event_open_trigger: 'CalendarExtensionPoint' = proto.Field( - proto.MESSAGE, - number=10, - message='CalendarExtensionPoint', - ) - event_update_trigger: 'CalendarExtensionPoint' = proto.Field( - proto.MESSAGE, - number=11, - message='CalendarExtensionPoint', - ) - current_event_access: EventAccess = proto.Field( - proto.ENUM, - number=12, - enum=EventAccess, - ) - - -class ConferenceSolution(proto.Message): - r"""Defines conference related values. - - Attributes: - on_create_function (str): - Required. The endpoint to call when - ConferenceData should be created. - id (str): - Required. IDs should be unique across - ConferenceSolutions within one add-on, but this - is not strictly enforced. It is up to the add-on - developer to assign them uniquely, otherwise the - wrong ConferenceSolution may be used when the - add-on is triggered. While the developer may - change the display name of an add-on, the ID - should not be changed. - name (str): - Required. The display name of the - ConferenceSolution. - logo_url (str): - Required. The URL for the logo image of the - ConferenceSolution. - """ - - on_create_function: str = proto.Field( - proto.STRING, - number=1, - ) - id: str = proto.Field( - proto.STRING, - number=4, - ) - name: str = proto.Field( - proto.STRING, - number=5, - ) - logo_url: str = proto.Field( - proto.STRING, - number=6, - ) - - -class CalendarExtensionPoint(proto.Message): - r"""Common format for declaring a calendar add-on's triggers. - - Attributes: - run_function (str): - Required. The endpoint to execute when this - extension point is activated. - """ - - run_function: str = proto.Field( - proto.STRING, - number=1, - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/mypy.ini b/owl-bot-staging/google-apps-script-type/calendar-py/mypy.ini deleted file mode 100644 index 574c5aed394b..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/mypy.ini +++ /dev/null @@ -1,3 +0,0 @@ -[mypy] -python_version = 3.7 -namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/noxfile.py b/owl-bot-staging/google-apps-script-type/calendar-py/noxfile.py deleted file mode 100644 index 01e4b523b2a1..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/noxfile.py +++ /dev/null @@ -1,280 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import os -import pathlib -import re -import shutil -import subprocess -import sys - - -import nox # type: ignore - -ALL_PYTHON = [ - "3.7", - "3.8", - "3.9", - "3.10", - "3.11", - "3.12", - "3.13", -] - -CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() - -LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" -PACKAGE_NAME = 'google-apps-script-type-calendar' - -BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] -DEFAULT_PYTHON_VERSION = "3.13" - -nox.sessions = [ - "unit", - "cover", - "mypy", - "check_lower_bounds" - # exclude update_lower_bounds from default - "docs", - "blacken", - "lint", - "prerelease_deps", -] - -@nox.session(python=ALL_PYTHON) -@nox.parametrize( - "protobuf_implementation", - [ "python", "upb", "cpp" ], -) -def unit(session, protobuf_implementation): - """Run the unit test suite.""" - - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): - session.skip("cpp implementation is not supported in python 3.11+") - - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - session.install('-e', '.', "-c", f"testing/constraints-{session.python}.txt") - - # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. - # The 'cpp' implementation requires Protobuf<4. - if protobuf_implementation == "cpp": - session.install("protobuf<4") - - session.run( - 'py.test', - '--quiet', - '--cov=google/apps/script/type/calendar/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)), - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) - -@nox.session(python=ALL_PYTHON[-1]) -@nox.parametrize( - "protobuf_implementation", - [ "python", "upb", "cpp" ], -) -def prerelease_deps(session, protobuf_implementation): - """Run the unit test suite against pre-release versions of dependencies.""" - - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): - session.skip("cpp implementation is not supported in python 3.11+") - - # Install test environment dependencies - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - - # Install the package without dependencies - session.install('-e', '.', '--no-deps') - - # We test the minimum dependency versions using the minimum Python - # version so the lowest python runtime that we test has a corresponding constraints - # file, located at `testing/constraints--.txt`, which contains all of the - # dependencies and extras. - with open( - CURRENT_DIRECTORY - / "testing" - / f"constraints-{ALL_PYTHON[0]}.txt", - encoding="utf-8", - ) as constraints_file: - constraints_text = constraints_file.read() - - # Ignore leading whitespace and comment lines. - constraints_deps = [ - match.group(1) - for match in re.finditer( - r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE - ) - ] - - session.install(*constraints_deps) - - prerel_deps = [ - "googleapis-common-protos", - "google-api-core", - "google-auth", - # Exclude grpcio!=1.67.0rc1 which does not support python 3.13 - "grpcio!=1.67.0rc1", - "grpcio-status", - "protobuf", - "proto-plus", - ] - - for dep in prerel_deps: - session.install("--pre", "--no-deps", "--upgrade", dep) - - # Remaining dependencies - other_deps = [ - "requests", - ] - session.install(*other_deps) - - # Print out prerelease package versions - - session.run("python", "-c", "import google.api_core; print(google.api_core.__version__)") - session.run("python", "-c", "import google.auth; print(google.auth.__version__)") - session.run("python", "-c", "import grpc; print(grpc.__version__)") - session.run( - "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" - ) - session.run( - "python", "-c", "import proto; print(proto.__version__)" - ) - - session.run( - 'py.test', - '--quiet', - '--cov=google/apps/script/type/calendar/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)), - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def cover(session): - """Run the final coverage report. - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python=ALL_PYTHON) -def mypy(session): - """Run the type checker.""" - session.install( - 'mypy', - 'types-requests', - 'types-protobuf' - ) - session.install('.') - session.run( - 'mypy', - '-p', - 'google', - ) - - -@nox.session -def update_lower_bounds(session): - """Update lower bounds in constraints.txt to match setup.py""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'update', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - - -@nox.session -def check_lower_bounds(session): - """Check lower bounds in setup.py are reflected in constraints file""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'check', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx==7.0.1", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION) - session.run( - "black", - "--check", - *BLACK_PATHS, - ) - session.run("flake8", "google", "tests", "samples") - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def blacken(session): - """Run black. Format code to uniform standard.""" - session.install(BLACK_VERSION) - session.run( - "black", - *BLACK_PATHS, - ) diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/scripts/fixup_calendar_keywords.py b/owl-bot-staging/google-apps-script-type/calendar-py/scripts/fixup_calendar_keywords.py deleted file mode 100644 index d64f207f6571..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/scripts/fixup_calendar_keywords.py +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import argparse -import os -import libcst as cst -import pathlib -import sys -from typing import (Any, Callable, Dict, List, Sequence, Tuple) - - -def partition( - predicate: Callable[[Any], bool], - iterator: Sequence[Any] -) -> Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class calendarCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=calendarCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the calendar client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/setup.py b/owl-bot-staging/google-apps-script-type/calendar-py/setup.py deleted file mode 100644 index c990d342e9ca..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/setup.py +++ /dev/null @@ -1,99 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import io -import os -import re - -import setuptools # type: ignore - -package_root = os.path.abspath(os.path.dirname(__file__)) - -name = 'google-apps-script-type-calendar' - - -description = "Google Apps Script Type Calendar API client library" - -version = None - -with open(os.path.join(package_root, 'google/apps/script/type/calendar/gapic_version.py')) as fp: - version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) - assert (len(version_candidates) == 1) - version = version_candidates[0] - -if version[0] == "0": - release_status = "Development Status :: 4 - Beta" -else: - release_status = "Development Status :: 5 - Production/Stable" - -dependencies = [ - "google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - # Exclude incompatible versions of `google-auth` - # See https://github.com/googleapis/google-cloud-python/issues/12364 - "google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0", - "proto-plus >= 1.22.3, <2.0.0dev", - "proto-plus >= 1.25.0, <2.0.0dev; python_version >= '3.13'", - "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", - "google-apps-script-type >= 0.2.0, <1.0.0dev", -] -extras = { -} -url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-apps-script-type-calendar" - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package - for package in setuptools.find_namespace_packages() - if package.startswith("google") -] - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url=url, - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - python_requires=">=3.7", - install_requires=dependencies, - extras_require=extras, - include_package_data=True, - zip_safe=False, -) diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.10.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.10.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.11.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.11.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.12.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.12.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.13.txt b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.13.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.13.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.7.txt deleted file mode 100644 index add339dc78f3..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.7.txt +++ /dev/null @@ -1,11 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file. -# Pin the version to the lower bound. -# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", -# Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.34.1 -google-auth==2.14.1 -proto-plus==1.22.3 -protobuf==3.20.2 -google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.8.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.8.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.9.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/testing/constraints-3.9.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/calendar-py/tests/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/tests/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/calendar/__init__.py b/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/calendar/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/calendar-py/tests/unit/gapic/calendar/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/docs-py/.coveragerc b/owl-bot-staging/google-apps-script-type/docs-py/.coveragerc deleted file mode 100644 index ead63ec35413..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/.coveragerc +++ /dev/null @@ -1,13 +0,0 @@ -[run] -branch = True - -[report] -show_missing = True -omit = - google/apps/script/type/docs/__init__.py - google/apps/script/type/docs/gapic_version.py -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/docs-py/.flake8 b/owl-bot-staging/google-apps-script-type/docs-py/.flake8 deleted file mode 100644 index 29227d4cf419..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/.flake8 +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - **/services/** - **/types/** - *_pb2.py - - # Standard linting exemptions. - **/.nox/** - __pycache__, - .git, - *.pyc, - conf.py diff --git a/owl-bot-staging/google-apps-script-type/docs-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/docs-py/MANIFEST.in deleted file mode 100644 index 8089481e3476..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -recursive-include google/apps/script/type/docs *.py -recursive-include google/apps/script/type/docs *.py diff --git a/owl-bot-staging/google-apps-script-type/docs-py/README.rst b/owl-bot-staging/google-apps-script-type/docs-py/README.rst deleted file mode 100644 index bddbe0cafc22..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/README.rst +++ /dev/null @@ -1,49 +0,0 @@ -Python Client for Google Apps Script Type Docs API -================================================= - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. Enable the Google Apps Script Type Docs API. -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - python3 -m venv - source /bin/activate - /bin/pip install /path/to/library - - -Windows -^^^^^^^ - -.. code-block:: console - - python3 -m venv - \Scripts\activate - \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/docs-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/docs-py/docs/_static/custom.css deleted file mode 100644 index 06423be0b592..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/docs/_static/custom.css +++ /dev/null @@ -1,3 +0,0 @@ -dl.field-list > dt { - min-width: 100px -} diff --git a/owl-bot-staging/google-apps-script-type/docs-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/docs-py/docs/conf.py deleted file mode 100644 index 7a78f2b65064..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/docs/conf.py +++ /dev/null @@ -1,376 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# -# google-apps-script-type-docs documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "4.0.1" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The root toctree document. -root_doc = "index" - -# General information about the project. -project = u"google-apps-script-type-docs" -copyright = u"2023, Google, LLC" -author = u"Google APIs" # TODO: autogenerate this bit - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = 'en' - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Apps Script Type Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-apps-script-type-docs-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - # 'preamble': '', - # Latex figure (float) alignment - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - root_doc, - "google-apps-script-type-docs.tex", - u"google-apps-script-type-docs Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - root_doc, - "google-apps-script-type-docs", - u"Google Apps Script Type Docs Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - root_doc, - "google-apps-script-type-docs", - u"google-apps-script-type-docs Documentation", - author, - "google-apps-script-type-docs", - "GAPIC library for Google Apps Script Type Docs API", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("http://requests.kennethreitz.org/en/stable/", None), - "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), - "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/docs-py/docs/docs/services_.rst b/owl-bot-staging/google-apps-script-type/docs-py/docs/docs/services_.rst deleted file mode 100644 index 4af412e533c2..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/docs/docs/services_.rst +++ /dev/null @@ -1,4 +0,0 @@ -Services for Google Apps Script Type Docs API -============================================== -.. toctree:: - :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/docs-py/docs/docs/types_.rst b/owl-bot-staging/google-apps-script-type/docs-py/docs/docs/types_.rst deleted file mode 100644 index 3f47df031446..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/docs/docs/types_.rst +++ /dev/null @@ -1,6 +0,0 @@ -Types for Google Apps Script Type Docs API -=========================================== - -.. automodule:: google.apps.script.type.docs.types - :members: - :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/docs-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/docs-py/docs/index.rst deleted file mode 100644 index 71c7ab401b5a..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/docs/index.rst +++ /dev/null @@ -1,7 +0,0 @@ -API Reference -------------- -.. toctree:: - :maxdepth: 2 - - docs/services_ - docs/types_ diff --git a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/__init__.py b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/__init__.py deleted file mode 100644 index 830145843a05..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from google.apps.script.type.docs import gapic_version as package_version - -__version__ = package_version.__version__ - - - -from .types.docs_addon_manifest import DocsAddOnManifest -from .types.docs_addon_manifest import DocsExtensionPoint - -__all__ = ( -'DocsAddOnManifest', -'DocsExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_metadata.json deleted file mode 100644 index 5df2a0423a5e..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_metadata.json +++ /dev/null @@ -1,7 +0,0 @@ - { - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "python", - "libraryPackage": "google.apps.script.type.docs", - "protoPackage": "google.apps.script.type.docs", - "schema": "1.0" -} diff --git a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_version.py b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_version.py deleted file mode 100644 index 558c8aab67c5..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/gapic_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/py.typed b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/py.typed deleted file mode 100644 index a954439caa66..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-apps-script-type-docs package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/services/__init__.py b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/services/__init__.py deleted file mode 100644 index 8f6cf068242c..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/__init__.py b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/__init__.py deleted file mode 100644 index ecd61fa7655c..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from .docs_addon_manifest import ( - DocsAddOnManifest, - DocsExtensionPoint, -) - -__all__ = ( - 'DocsAddOnManifest', - 'DocsExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/docs_addon_manifest.py b/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/docs_addon_manifest.py deleted file mode 100644 index 99b6f2fe6eb6..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/google/apps/script/type/docs/types/docs_addon_manifest.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.apps.script.type.types import extension_point - - -__protobuf__ = proto.module( - package='google.apps.script.type.docs', - manifest={ - 'DocsAddOnManifest', - 'DocsExtensionPoint', - }, -) - - -class DocsAddOnManifest(proto.Message): - r"""Docs add-on manifest. - - Attributes: - homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): - If present, this overrides the configuration from - ``addOns.common.homepageTrigger``. - on_file_scope_granted_trigger (google.apps.script.type.docs.types.DocsExtensionPoint): - Endpoint to execute when file scope - authorization is granted for this document/user - pair. - """ - - homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( - proto.MESSAGE, - number=1, - message=extension_point.HomepageExtensionPoint, - ) - on_file_scope_granted_trigger: 'DocsExtensionPoint' = proto.Field( - proto.MESSAGE, - number=2, - message='DocsExtensionPoint', - ) - - -class DocsExtensionPoint(proto.Message): - r"""Common format for declaring a Docs add-on's triggers. - - Attributes: - run_function (str): - Required. The endpoint to execute when this - extension point is activated. - """ - - run_function: str = proto.Field( - proto.STRING, - number=1, - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/docs-py/mypy.ini b/owl-bot-staging/google-apps-script-type/docs-py/mypy.ini deleted file mode 100644 index 574c5aed394b..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/mypy.ini +++ /dev/null @@ -1,3 +0,0 @@ -[mypy] -python_version = 3.7 -namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/docs-py/noxfile.py b/owl-bot-staging/google-apps-script-type/docs-py/noxfile.py deleted file mode 100644 index 3de287c814ce..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/noxfile.py +++ /dev/null @@ -1,280 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import os -import pathlib -import re -import shutil -import subprocess -import sys - - -import nox # type: ignore - -ALL_PYTHON = [ - "3.7", - "3.8", - "3.9", - "3.10", - "3.11", - "3.12", - "3.13", -] - -CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() - -LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" -PACKAGE_NAME = 'google-apps-script-type-docs' - -BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] -DEFAULT_PYTHON_VERSION = "3.13" - -nox.sessions = [ - "unit", - "cover", - "mypy", - "check_lower_bounds" - # exclude update_lower_bounds from default - "docs", - "blacken", - "lint", - "prerelease_deps", -] - -@nox.session(python=ALL_PYTHON) -@nox.parametrize( - "protobuf_implementation", - [ "python", "upb", "cpp" ], -) -def unit(session, protobuf_implementation): - """Run the unit test suite.""" - - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): - session.skip("cpp implementation is not supported in python 3.11+") - - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - session.install('-e', '.', "-c", f"testing/constraints-{session.python}.txt") - - # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. - # The 'cpp' implementation requires Protobuf<4. - if protobuf_implementation == "cpp": - session.install("protobuf<4") - - session.run( - 'py.test', - '--quiet', - '--cov=google/apps/script/type/docs/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)), - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) - -@nox.session(python=ALL_PYTHON[-1]) -@nox.parametrize( - "protobuf_implementation", - [ "python", "upb", "cpp" ], -) -def prerelease_deps(session, protobuf_implementation): - """Run the unit test suite against pre-release versions of dependencies.""" - - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): - session.skip("cpp implementation is not supported in python 3.11+") - - # Install test environment dependencies - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - - # Install the package without dependencies - session.install('-e', '.', '--no-deps') - - # We test the minimum dependency versions using the minimum Python - # version so the lowest python runtime that we test has a corresponding constraints - # file, located at `testing/constraints--.txt`, which contains all of the - # dependencies and extras. - with open( - CURRENT_DIRECTORY - / "testing" - / f"constraints-{ALL_PYTHON[0]}.txt", - encoding="utf-8", - ) as constraints_file: - constraints_text = constraints_file.read() - - # Ignore leading whitespace and comment lines. - constraints_deps = [ - match.group(1) - for match in re.finditer( - r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE - ) - ] - - session.install(*constraints_deps) - - prerel_deps = [ - "googleapis-common-protos", - "google-api-core", - "google-auth", - # Exclude grpcio!=1.67.0rc1 which does not support python 3.13 - "grpcio!=1.67.0rc1", - "grpcio-status", - "protobuf", - "proto-plus", - ] - - for dep in prerel_deps: - session.install("--pre", "--no-deps", "--upgrade", dep) - - # Remaining dependencies - other_deps = [ - "requests", - ] - session.install(*other_deps) - - # Print out prerelease package versions - - session.run("python", "-c", "import google.api_core; print(google.api_core.__version__)") - session.run("python", "-c", "import google.auth; print(google.auth.__version__)") - session.run("python", "-c", "import grpc; print(grpc.__version__)") - session.run( - "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" - ) - session.run( - "python", "-c", "import proto; print(proto.__version__)" - ) - - session.run( - 'py.test', - '--quiet', - '--cov=google/apps/script/type/docs/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)), - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def cover(session): - """Run the final coverage report. - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python=ALL_PYTHON) -def mypy(session): - """Run the type checker.""" - session.install( - 'mypy', - 'types-requests', - 'types-protobuf' - ) - session.install('.') - session.run( - 'mypy', - '-p', - 'google', - ) - - -@nox.session -def update_lower_bounds(session): - """Update lower bounds in constraints.txt to match setup.py""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'update', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - - -@nox.session -def check_lower_bounds(session): - """Check lower bounds in setup.py are reflected in constraints file""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'check', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx==7.0.1", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION) - session.run( - "black", - "--check", - *BLACK_PATHS, - ) - session.run("flake8", "google", "tests", "samples") - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def blacken(session): - """Run black. Format code to uniform standard.""" - session.install(BLACK_VERSION) - session.run( - "black", - *BLACK_PATHS, - ) diff --git a/owl-bot-staging/google-apps-script-type/docs-py/scripts/fixup_docs_keywords.py b/owl-bot-staging/google-apps-script-type/docs-py/scripts/fixup_docs_keywords.py deleted file mode 100644 index be23874516be..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/scripts/fixup_docs_keywords.py +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import argparse -import os -import libcst as cst -import pathlib -import sys -from typing import (Any, Callable, Dict, List, Sequence, Tuple) - - -def partition( - predicate: Callable[[Any], bool], - iterator: Sequence[Any] -) -> Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class docsCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=docsCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the docs client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/docs-py/setup.py b/owl-bot-staging/google-apps-script-type/docs-py/setup.py deleted file mode 100644 index ba9da3a74275..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/setup.py +++ /dev/null @@ -1,99 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import io -import os -import re - -import setuptools # type: ignore - -package_root = os.path.abspath(os.path.dirname(__file__)) - -name = 'google-apps-script-type-docs' - - -description = "Google Apps Script Type Docs API client library" - -version = None - -with open(os.path.join(package_root, 'google/apps/script/type/docs/gapic_version.py')) as fp: - version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) - assert (len(version_candidates) == 1) - version = version_candidates[0] - -if version[0] == "0": - release_status = "Development Status :: 4 - Beta" -else: - release_status = "Development Status :: 5 - Production/Stable" - -dependencies = [ - "google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - # Exclude incompatible versions of `google-auth` - # See https://github.com/googleapis/google-cloud-python/issues/12364 - "google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0", - "proto-plus >= 1.22.3, <2.0.0dev", - "proto-plus >= 1.25.0, <2.0.0dev; python_version >= '3.13'", - "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", - "google-apps-script-type >= 0.2.0, <1.0.0dev", -] -extras = { -} -url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-apps-script-type-docs" - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package - for package in setuptools.find_namespace_packages() - if package.startswith("google") -] - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url=url, - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - python_requires=">=3.7", - install_requires=dependencies, - extras_require=extras, - include_package_data=True, - zip_safe=False, -) diff --git a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.10.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.10.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.11.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.11.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.12.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.12.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.13.txt b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.13.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.13.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.7.txt deleted file mode 100644 index add339dc78f3..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.7.txt +++ /dev/null @@ -1,11 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file. -# Pin the version to the lower bound. -# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", -# Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.34.1 -google-auth==2.14.1 -proto-plus==1.22.3 -protobuf==3.20.2 -google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.8.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.8.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.9.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/testing/constraints-3.9.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/docs-py/tests/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/tests/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/docs/__init__.py b/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/docs/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/docs-py/tests/unit/gapic/docs/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/drive-py/.coveragerc b/owl-bot-staging/google-apps-script-type/drive-py/.coveragerc deleted file mode 100644 index ab4cf2da754a..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/.coveragerc +++ /dev/null @@ -1,13 +0,0 @@ -[run] -branch = True - -[report] -show_missing = True -omit = - google/apps/script/type/drive/__init__.py - google/apps/script/type/drive/gapic_version.py -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/drive-py/.flake8 b/owl-bot-staging/google-apps-script-type/drive-py/.flake8 deleted file mode 100644 index 29227d4cf419..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/.flake8 +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - **/services/** - **/types/** - *_pb2.py - - # Standard linting exemptions. - **/.nox/** - __pycache__, - .git, - *.pyc, - conf.py diff --git a/owl-bot-staging/google-apps-script-type/drive-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/drive-py/MANIFEST.in deleted file mode 100644 index 22ebbed5ba4a..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -recursive-include google/apps/script/type/drive *.py -recursive-include google/apps/script/type/drive *.py diff --git a/owl-bot-staging/google-apps-script-type/drive-py/README.rst b/owl-bot-staging/google-apps-script-type/drive-py/README.rst deleted file mode 100644 index a9662a9269da..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/README.rst +++ /dev/null @@ -1,49 +0,0 @@ -Python Client for Google Apps Script Type Drive API -================================================= - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. Enable the Google Apps Script Type Drive API. -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - python3 -m venv - source /bin/activate - /bin/pip install /path/to/library - - -Windows -^^^^^^^ - -.. code-block:: console - - python3 -m venv - \Scripts\activate - \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/drive-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/drive-py/docs/_static/custom.css deleted file mode 100644 index 06423be0b592..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/docs/_static/custom.css +++ /dev/null @@ -1,3 +0,0 @@ -dl.field-list > dt { - min-width: 100px -} diff --git a/owl-bot-staging/google-apps-script-type/drive-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/drive-py/docs/conf.py deleted file mode 100644 index 1fb0c88d2776..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/docs/conf.py +++ /dev/null @@ -1,376 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# -# google-apps-script-type-drive documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "4.0.1" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The root toctree document. -root_doc = "index" - -# General information about the project. -project = u"google-apps-script-type-drive" -copyright = u"2023, Google, LLC" -author = u"Google APIs" # TODO: autogenerate this bit - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = 'en' - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Apps Script Type Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-apps-script-type-drive-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - # 'preamble': '', - # Latex figure (float) alignment - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - root_doc, - "google-apps-script-type-drive.tex", - u"google-apps-script-type-drive Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - root_doc, - "google-apps-script-type-drive", - u"Google Apps Script Type Drive Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - root_doc, - "google-apps-script-type-drive", - u"google-apps-script-type-drive Documentation", - author, - "google-apps-script-type-drive", - "GAPIC library for Google Apps Script Type Drive API", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("http://requests.kennethreitz.org/en/stable/", None), - "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), - "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/drive-py/docs/drive/services_.rst b/owl-bot-staging/google-apps-script-type/drive-py/docs/drive/services_.rst deleted file mode 100644 index 8ff18c898331..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/docs/drive/services_.rst +++ /dev/null @@ -1,4 +0,0 @@ -Services for Google Apps Script Type Drive API -=============================================== -.. toctree:: - :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/drive-py/docs/drive/types_.rst b/owl-bot-staging/google-apps-script-type/drive-py/docs/drive/types_.rst deleted file mode 100644 index b7b1423eb9ea..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/docs/drive/types_.rst +++ /dev/null @@ -1,6 +0,0 @@ -Types for Google Apps Script Type Drive API -============================================ - -.. automodule:: google.apps.script.type.drive.types - :members: - :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/drive-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/drive-py/docs/index.rst deleted file mode 100644 index 40bbf9bbf385..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/docs/index.rst +++ /dev/null @@ -1,7 +0,0 @@ -API Reference -------------- -.. toctree:: - :maxdepth: 2 - - drive/services_ - drive/types_ diff --git a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/__init__.py b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/__init__.py deleted file mode 100644 index 81c6edc23042..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from google.apps.script.type.drive import gapic_version as package_version - -__version__ = package_version.__version__ - - - -from .types.drive_addon_manifest import DriveAddOnManifest -from .types.drive_addon_manifest import DriveExtensionPoint - -__all__ = ( -'DriveAddOnManifest', -'DriveExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_metadata.json deleted file mode 100644 index 89577093651d..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_metadata.json +++ /dev/null @@ -1,7 +0,0 @@ - { - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "python", - "libraryPackage": "google.apps.script.type.drive", - "protoPackage": "google.apps.script.type.drive", - "schema": "1.0" -} diff --git a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_version.py b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_version.py deleted file mode 100644 index 558c8aab67c5..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/gapic_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/py.typed b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/py.typed deleted file mode 100644 index bbb573f18f73..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-apps-script-type-drive package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/services/__init__.py b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/services/__init__.py deleted file mode 100644 index 8f6cf068242c..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/__init__.py b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/__init__.py deleted file mode 100644 index ff483e337dc3..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from .drive_addon_manifest import ( - DriveAddOnManifest, - DriveExtensionPoint, -) - -__all__ = ( - 'DriveAddOnManifest', - 'DriveExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/drive_addon_manifest.py b/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/drive_addon_manifest.py deleted file mode 100644 index 6e527c067ac8..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/google/apps/script/type/drive/types/drive_addon_manifest.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.apps.script.type.types import extension_point - - -__protobuf__ = proto.module( - package='google.apps.script.type.drive', - manifest={ - 'DriveAddOnManifest', - 'DriveExtensionPoint', - }, -) - - -class DriveAddOnManifest(proto.Message): - r"""Drive add-on manifest. - - Attributes: - homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): - If present, this overrides the configuration from - ``addOns.common.homepageTrigger``. - on_items_selected_trigger (google.apps.script.type.drive.types.DriveExtensionPoint): - Corresponds to behvior that should execute - when items are selected in relevant Drive view - (e.g. the My Drive Doclist). - """ - - homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( - proto.MESSAGE, - number=1, - message=extension_point.HomepageExtensionPoint, - ) - on_items_selected_trigger: 'DriveExtensionPoint' = proto.Field( - proto.MESSAGE, - number=2, - message='DriveExtensionPoint', - ) - - -class DriveExtensionPoint(proto.Message): - r"""A generic extension point with common features, e.g. - something that simply needs a corresponding run function to - work. - - Attributes: - run_function (str): - Required. The endpoint to execute when this - extension point is activated. - """ - - run_function: str = proto.Field( - proto.STRING, - number=1, - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/drive-py/mypy.ini b/owl-bot-staging/google-apps-script-type/drive-py/mypy.ini deleted file mode 100644 index 574c5aed394b..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/mypy.ini +++ /dev/null @@ -1,3 +0,0 @@ -[mypy] -python_version = 3.7 -namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/drive-py/noxfile.py b/owl-bot-staging/google-apps-script-type/drive-py/noxfile.py deleted file mode 100644 index b878757baded..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/noxfile.py +++ /dev/null @@ -1,280 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import os -import pathlib -import re -import shutil -import subprocess -import sys - - -import nox # type: ignore - -ALL_PYTHON = [ - "3.7", - "3.8", - "3.9", - "3.10", - "3.11", - "3.12", - "3.13", -] - -CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() - -LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" -PACKAGE_NAME = 'google-apps-script-type-drive' - -BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] -DEFAULT_PYTHON_VERSION = "3.13" - -nox.sessions = [ - "unit", - "cover", - "mypy", - "check_lower_bounds" - # exclude update_lower_bounds from default - "docs", - "blacken", - "lint", - "prerelease_deps", -] - -@nox.session(python=ALL_PYTHON) -@nox.parametrize( - "protobuf_implementation", - [ "python", "upb", "cpp" ], -) -def unit(session, protobuf_implementation): - """Run the unit test suite.""" - - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): - session.skip("cpp implementation is not supported in python 3.11+") - - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - session.install('-e', '.', "-c", f"testing/constraints-{session.python}.txt") - - # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. - # The 'cpp' implementation requires Protobuf<4. - if protobuf_implementation == "cpp": - session.install("protobuf<4") - - session.run( - 'py.test', - '--quiet', - '--cov=google/apps/script/type/drive/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)), - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) - -@nox.session(python=ALL_PYTHON[-1]) -@nox.parametrize( - "protobuf_implementation", - [ "python", "upb", "cpp" ], -) -def prerelease_deps(session, protobuf_implementation): - """Run the unit test suite against pre-release versions of dependencies.""" - - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): - session.skip("cpp implementation is not supported in python 3.11+") - - # Install test environment dependencies - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - - # Install the package without dependencies - session.install('-e', '.', '--no-deps') - - # We test the minimum dependency versions using the minimum Python - # version so the lowest python runtime that we test has a corresponding constraints - # file, located at `testing/constraints--.txt`, which contains all of the - # dependencies and extras. - with open( - CURRENT_DIRECTORY - / "testing" - / f"constraints-{ALL_PYTHON[0]}.txt", - encoding="utf-8", - ) as constraints_file: - constraints_text = constraints_file.read() - - # Ignore leading whitespace and comment lines. - constraints_deps = [ - match.group(1) - for match in re.finditer( - r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE - ) - ] - - session.install(*constraints_deps) - - prerel_deps = [ - "googleapis-common-protos", - "google-api-core", - "google-auth", - # Exclude grpcio!=1.67.0rc1 which does not support python 3.13 - "grpcio!=1.67.0rc1", - "grpcio-status", - "protobuf", - "proto-plus", - ] - - for dep in prerel_deps: - session.install("--pre", "--no-deps", "--upgrade", dep) - - # Remaining dependencies - other_deps = [ - "requests", - ] - session.install(*other_deps) - - # Print out prerelease package versions - - session.run("python", "-c", "import google.api_core; print(google.api_core.__version__)") - session.run("python", "-c", "import google.auth; print(google.auth.__version__)") - session.run("python", "-c", "import grpc; print(grpc.__version__)") - session.run( - "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" - ) - session.run( - "python", "-c", "import proto; print(proto.__version__)" - ) - - session.run( - 'py.test', - '--quiet', - '--cov=google/apps/script/type/drive/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)), - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def cover(session): - """Run the final coverage report. - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python=ALL_PYTHON) -def mypy(session): - """Run the type checker.""" - session.install( - 'mypy', - 'types-requests', - 'types-protobuf' - ) - session.install('.') - session.run( - 'mypy', - '-p', - 'google', - ) - - -@nox.session -def update_lower_bounds(session): - """Update lower bounds in constraints.txt to match setup.py""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'update', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - - -@nox.session -def check_lower_bounds(session): - """Check lower bounds in setup.py are reflected in constraints file""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'check', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx==7.0.1", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION) - session.run( - "black", - "--check", - *BLACK_PATHS, - ) - session.run("flake8", "google", "tests", "samples") - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def blacken(session): - """Run black. Format code to uniform standard.""" - session.install(BLACK_VERSION) - session.run( - "black", - *BLACK_PATHS, - ) diff --git a/owl-bot-staging/google-apps-script-type/drive-py/scripts/fixup_drive_keywords.py b/owl-bot-staging/google-apps-script-type/drive-py/scripts/fixup_drive_keywords.py deleted file mode 100644 index a92982a8da38..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/scripts/fixup_drive_keywords.py +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import argparse -import os -import libcst as cst -import pathlib -import sys -from typing import (Any, Callable, Dict, List, Sequence, Tuple) - - -def partition( - predicate: Callable[[Any], bool], - iterator: Sequence[Any] -) -> Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class driveCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=driveCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the drive client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/drive-py/setup.py b/owl-bot-staging/google-apps-script-type/drive-py/setup.py deleted file mode 100644 index d5cba87f8977..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/setup.py +++ /dev/null @@ -1,99 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import io -import os -import re - -import setuptools # type: ignore - -package_root = os.path.abspath(os.path.dirname(__file__)) - -name = 'google-apps-script-type-drive' - - -description = "Google Apps Script Type Drive API client library" - -version = None - -with open(os.path.join(package_root, 'google/apps/script/type/drive/gapic_version.py')) as fp: - version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) - assert (len(version_candidates) == 1) - version = version_candidates[0] - -if version[0] == "0": - release_status = "Development Status :: 4 - Beta" -else: - release_status = "Development Status :: 5 - Production/Stable" - -dependencies = [ - "google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - # Exclude incompatible versions of `google-auth` - # See https://github.com/googleapis/google-cloud-python/issues/12364 - "google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0", - "proto-plus >= 1.22.3, <2.0.0dev", - "proto-plus >= 1.25.0, <2.0.0dev; python_version >= '3.13'", - "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", - "google-apps-script-type >= 0.2.0, <1.0.0dev", -] -extras = { -} -url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-apps-script-type-drive" - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package - for package in setuptools.find_namespace_packages() - if package.startswith("google") -] - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url=url, - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - python_requires=">=3.7", - install_requires=dependencies, - extras_require=extras, - include_package_data=True, - zip_safe=False, -) diff --git a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.10.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.10.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.11.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.11.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.12.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.12.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.13.txt b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.13.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.13.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.7.txt deleted file mode 100644 index add339dc78f3..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.7.txt +++ /dev/null @@ -1,11 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file. -# Pin the version to the lower bound. -# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", -# Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.34.1 -google-auth==2.14.1 -proto-plus==1.22.3 -protobuf==3.20.2 -google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.8.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.8.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.9.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/testing/constraints-3.9.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/drive-py/tests/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/tests/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/drive/__init__.py b/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/drive/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/drive-py/tests/unit/gapic/drive/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/.coveragerc b/owl-bot-staging/google-apps-script-type/gmail-py/.coveragerc deleted file mode 100644 index 7a2aa0a8bb10..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/.coveragerc +++ /dev/null @@ -1,13 +0,0 @@ -[run] -branch = True - -[report] -show_missing = True -omit = - google/apps/script/type/gmail/__init__.py - google/apps/script/type/gmail/gapic_version.py -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/.flake8 b/owl-bot-staging/google-apps-script-type/gmail-py/.flake8 deleted file mode 100644 index 29227d4cf419..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/.flake8 +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - **/services/** - **/types/** - *_pb2.py - - # Standard linting exemptions. - **/.nox/** - __pycache__, - .git, - *.pyc, - conf.py diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/gmail-py/MANIFEST.in deleted file mode 100644 index a7ee24e07f5d..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -recursive-include google/apps/script/type/gmail *.py -recursive-include google/apps/script/type/gmail *.py diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/README.rst b/owl-bot-staging/google-apps-script-type/gmail-py/README.rst deleted file mode 100644 index bb9177599c32..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/README.rst +++ /dev/null @@ -1,49 +0,0 @@ -Python Client for Google Apps Script Type Gmail API -================================================= - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. Enable the Google Apps Script Type Gmail API. -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - python3 -m venv - source /bin/activate - /bin/pip install /path/to/library - - -Windows -^^^^^^^ - -.. code-block:: console - - python3 -m venv - \Scripts\activate - \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/gmail-py/docs/_static/custom.css deleted file mode 100644 index 06423be0b592..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/docs/_static/custom.css +++ /dev/null @@ -1,3 +0,0 @@ -dl.field-list > dt { - min-width: 100px -} diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/gmail-py/docs/conf.py deleted file mode 100644 index 40f02d15f276..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/docs/conf.py +++ /dev/null @@ -1,376 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# -# google-apps-script-type-gmail documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "4.0.1" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The root toctree document. -root_doc = "index" - -# General information about the project. -project = u"google-apps-script-type-gmail" -copyright = u"2023, Google, LLC" -author = u"Google APIs" # TODO: autogenerate this bit - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = 'en' - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Apps Script Type Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-apps-script-type-gmail-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - # 'preamble': '', - # Latex figure (float) alignment - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - root_doc, - "google-apps-script-type-gmail.tex", - u"google-apps-script-type-gmail Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - root_doc, - "google-apps-script-type-gmail", - u"Google Apps Script Type Gmail Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - root_doc, - "google-apps-script-type-gmail", - u"google-apps-script-type-gmail Documentation", - author, - "google-apps-script-type-gmail", - "GAPIC library for Google Apps Script Type Gmail API", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("http://requests.kennethreitz.org/en/stable/", None), - "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), - "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/services_.rst b/owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/services_.rst deleted file mode 100644 index 7df066840e3f..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/services_.rst +++ /dev/null @@ -1,4 +0,0 @@ -Services for Google Apps Script Type Gmail API -=============================================== -.. toctree:: - :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/types_.rst b/owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/types_.rst deleted file mode 100644 index bc0bef9f5807..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/docs/gmail/types_.rst +++ /dev/null @@ -1,6 +0,0 @@ -Types for Google Apps Script Type Gmail API -============================================ - -.. automodule:: google.apps.script.type.gmail.types - :members: - :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/gmail-py/docs/index.rst deleted file mode 100644 index dced9c1a3e1b..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/docs/index.rst +++ /dev/null @@ -1,7 +0,0 @@ -API Reference -------------- -.. toctree:: - :maxdepth: 2 - - gmail/services_ - gmail/types_ diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/__init__.py b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/__init__.py deleted file mode 100644 index 2c9981a54a80..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from google.apps.script.type.gmail import gapic_version as package_version - -__version__ = package_version.__version__ - - - -from .types.gmail_addon_manifest import ComposeTrigger -from .types.gmail_addon_manifest import ContextualTrigger -from .types.gmail_addon_manifest import GmailAddOnManifest -from .types.gmail_addon_manifest import UnconditionalTrigger -from .types.gmail_addon_manifest import UniversalAction - -__all__ = ( -'ComposeTrigger', -'ContextualTrigger', -'GmailAddOnManifest', -'UnconditionalTrigger', -'UniversalAction', -) diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_metadata.json deleted file mode 100644 index 7733a14a8ce4..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_metadata.json +++ /dev/null @@ -1,7 +0,0 @@ - { - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "python", - "libraryPackage": "google.apps.script.type.gmail", - "protoPackage": "google.apps.script.type.gmail", - "schema": "1.0" -} diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_version.py b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_version.py deleted file mode 100644 index 558c8aab67c5..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/gapic_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/py.typed b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/py.typed deleted file mode 100644 index 0906e16feda1..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-apps-script-type-gmail package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/services/__init__.py b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/services/__init__.py deleted file mode 100644 index 8f6cf068242c..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/__init__.py b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/__init__.py deleted file mode 100644 index e75f6f7a8e16..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from .gmail_addon_manifest import ( - ComposeTrigger, - ContextualTrigger, - GmailAddOnManifest, - UnconditionalTrigger, - UniversalAction, -) - -__all__ = ( - 'ComposeTrigger', - 'ContextualTrigger', - 'GmailAddOnManifest', - 'UnconditionalTrigger', - 'UniversalAction', -) diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py b/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py deleted file mode 100644 index 6fd365c3f729..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py +++ /dev/null @@ -1,232 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.apps.script.type.types import extension_point - - -__protobuf__ = proto.module( - package='google.apps.script.type.gmail', - manifest={ - 'GmailAddOnManifest', - 'UniversalAction', - 'ComposeTrigger', - 'ContextualTrigger', - 'UnconditionalTrigger', - }, -) - - -class GmailAddOnManifest(proto.Message): - r"""Properties customizing the appearance and execution of a - Gmail add-on. - - Attributes: - homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): - Defines an endpoint that will be executed in contexts that - don't match a declared contextual trigger. Any cards - generated by this function will always be available to the - user, but may be eclipsed by contextual content when this - add-on declares more targeted triggers. - - If present, this overrides the configuration from - ``addOns.common.homepageTrigger``. - contextual_triggers (MutableSequence[google.apps.script.type.gmail.types.ContextualTrigger]): - Defines the set of conditions that trigger - the add-on. - universal_actions (MutableSequence[google.apps.script.type.gmail.types.UniversalAction]): - Defines set of `universal - actions `__ for - the add-on. The user triggers universal actions from the - add-on toolbar menu. - compose_trigger (google.apps.script.type.gmail.types.ComposeTrigger): - Defines the compose time trigger for a - compose time add-on. This is the trigger that - causes an add-on to take action when the user is - composing an email. - All compose time addons are required to have the - gmail.addons.current.action.compose scope even - though it might not edit the draft. - authorization_check_function (str): - The name of an endpoint that verifies that - the add-on has all the required third-party - authorizations, by probing the third-party APIs. - If the probe fails, the function should throw an - exception to initiate the authorization flow. - This function is called before each invocation - of the add-on, in order to ensure a smooth user - experience. - """ - - homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( - proto.MESSAGE, - number=14, - message=extension_point.HomepageExtensionPoint, - ) - contextual_triggers: MutableSequence['ContextualTrigger'] = proto.RepeatedField( - proto.MESSAGE, - number=3, - message='ContextualTrigger', - ) - universal_actions: MutableSequence['UniversalAction'] = proto.RepeatedField( - proto.MESSAGE, - number=4, - message='UniversalAction', - ) - compose_trigger: 'ComposeTrigger' = proto.Field( - proto.MESSAGE, - number=12, - message='ComposeTrigger', - ) - authorization_check_function: str = proto.Field( - proto.STRING, - number=7, - ) - - -class UniversalAction(proto.Message): - r"""An action that is always available in the add-on toolbar menu - regardless of message context. - - This message has `oneof`_ fields (mutually exclusive fields). - For each oneof, at most one member field can be set at the same time. - Setting any member of the oneof automatically clears all other - members. - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - text (str): - Required. User-visible text describing the - action, for example, "Add a new contact.". - open_link (str): - A link that is opened by Gmail when the user - triggers the action. - - This field is a member of `oneof`_ ``action_type``. - run_function (str): - An endpoint that is called when the user triggers the - action. See the `universal actions - guide `__ for - details. - - This field is a member of `oneof`_ ``action_type``. - """ - - text: str = proto.Field( - proto.STRING, - number=1, - ) - open_link: str = proto.Field( - proto.STRING, - number=2, - oneof='action_type', - ) - run_function: str = proto.Field( - proto.STRING, - number=3, - oneof='action_type', - ) - - -class ComposeTrigger(proto.Message): - r"""A trigger that activates when user is composing an email. - - Attributes: - actions (MutableSequence[google.apps.script.type.types.MenuItemExtensionPoint]): - Defines the set of actions for compose time - add-on. These are actions that user can trigger - on a compose time addon. - draft_access (google.apps.script.type.gmail.types.ComposeTrigger.DraftAccess): - Define the level of data access when a - compose time addon is triggered. - """ - class DraftAccess(proto.Enum): - r"""An enum defining the level of data access this compose - trigger requires. - - Values: - UNSPECIFIED (0): - Default value when nothing is set for - DraftAccess. - NONE (1): - NONE means compose trigger won't be able to - access any data of the draft when a compose - addon is triggered. - METADATA (2): - METADATA gives compose trigger the permission - to access the metadata of the draft when a - compose addon is triggered. This includes the - audience list (To/cc list) of a draft message. - """ - UNSPECIFIED = 0 - NONE = 1 - METADATA = 2 - - actions: MutableSequence[extension_point.MenuItemExtensionPoint] = proto.RepeatedField( - proto.MESSAGE, - number=5, - message=extension_point.MenuItemExtensionPoint, - ) - draft_access: DraftAccess = proto.Field( - proto.ENUM, - number=4, - enum=DraftAccess, - ) - - -class ContextualTrigger(proto.Message): - r"""Defines a trigger that fires when the open email meets a - specific criteria. When the trigger fires, it executes a - specific endpoint, usually in order to create new cards and - update the UI. - - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - unconditional (google.apps.script.type.gmail.types.UnconditionalTrigger): - UnconditionalTriggers are executed when any - mail message is opened. - - This field is a member of `oneof`_ ``trigger``. - on_trigger_function (str): - Required. The name of the endpoint to call - when a message matches the trigger. - """ - - unconditional: 'UnconditionalTrigger' = proto.Field( - proto.MESSAGE, - number=1, - oneof='trigger', - message='UnconditionalTrigger', - ) - on_trigger_function: str = proto.Field( - proto.STRING, - number=4, - ) - - -class UnconditionalTrigger(proto.Message): - r"""A trigger that fires when any email message is opened. - """ - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/mypy.ini b/owl-bot-staging/google-apps-script-type/gmail-py/mypy.ini deleted file mode 100644 index 574c5aed394b..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/mypy.ini +++ /dev/null @@ -1,3 +0,0 @@ -[mypy] -python_version = 3.7 -namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/noxfile.py b/owl-bot-staging/google-apps-script-type/gmail-py/noxfile.py deleted file mode 100644 index e7d5a0c09ae6..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/noxfile.py +++ /dev/null @@ -1,280 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import os -import pathlib -import re -import shutil -import subprocess -import sys - - -import nox # type: ignore - -ALL_PYTHON = [ - "3.7", - "3.8", - "3.9", - "3.10", - "3.11", - "3.12", - "3.13", -] - -CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() - -LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" -PACKAGE_NAME = 'google-apps-script-type-gmail' - -BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] -DEFAULT_PYTHON_VERSION = "3.13" - -nox.sessions = [ - "unit", - "cover", - "mypy", - "check_lower_bounds" - # exclude update_lower_bounds from default - "docs", - "blacken", - "lint", - "prerelease_deps", -] - -@nox.session(python=ALL_PYTHON) -@nox.parametrize( - "protobuf_implementation", - [ "python", "upb", "cpp" ], -) -def unit(session, protobuf_implementation): - """Run the unit test suite.""" - - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): - session.skip("cpp implementation is not supported in python 3.11+") - - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - session.install('-e', '.', "-c", f"testing/constraints-{session.python}.txt") - - # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. - # The 'cpp' implementation requires Protobuf<4. - if protobuf_implementation == "cpp": - session.install("protobuf<4") - - session.run( - 'py.test', - '--quiet', - '--cov=google/apps/script/type/gmail/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)), - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) - -@nox.session(python=ALL_PYTHON[-1]) -@nox.parametrize( - "protobuf_implementation", - [ "python", "upb", "cpp" ], -) -def prerelease_deps(session, protobuf_implementation): - """Run the unit test suite against pre-release versions of dependencies.""" - - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): - session.skip("cpp implementation is not supported in python 3.11+") - - # Install test environment dependencies - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - - # Install the package without dependencies - session.install('-e', '.', '--no-deps') - - # We test the minimum dependency versions using the minimum Python - # version so the lowest python runtime that we test has a corresponding constraints - # file, located at `testing/constraints--.txt`, which contains all of the - # dependencies and extras. - with open( - CURRENT_DIRECTORY - / "testing" - / f"constraints-{ALL_PYTHON[0]}.txt", - encoding="utf-8", - ) as constraints_file: - constraints_text = constraints_file.read() - - # Ignore leading whitespace and comment lines. - constraints_deps = [ - match.group(1) - for match in re.finditer( - r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE - ) - ] - - session.install(*constraints_deps) - - prerel_deps = [ - "googleapis-common-protos", - "google-api-core", - "google-auth", - # Exclude grpcio!=1.67.0rc1 which does not support python 3.13 - "grpcio!=1.67.0rc1", - "grpcio-status", - "protobuf", - "proto-plus", - ] - - for dep in prerel_deps: - session.install("--pre", "--no-deps", "--upgrade", dep) - - # Remaining dependencies - other_deps = [ - "requests", - ] - session.install(*other_deps) - - # Print out prerelease package versions - - session.run("python", "-c", "import google.api_core; print(google.api_core.__version__)") - session.run("python", "-c", "import google.auth; print(google.auth.__version__)") - session.run("python", "-c", "import grpc; print(grpc.__version__)") - session.run( - "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" - ) - session.run( - "python", "-c", "import proto; print(proto.__version__)" - ) - - session.run( - 'py.test', - '--quiet', - '--cov=google/apps/script/type/gmail/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)), - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def cover(session): - """Run the final coverage report. - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python=ALL_PYTHON) -def mypy(session): - """Run the type checker.""" - session.install( - 'mypy', - 'types-requests', - 'types-protobuf' - ) - session.install('.') - session.run( - 'mypy', - '-p', - 'google', - ) - - -@nox.session -def update_lower_bounds(session): - """Update lower bounds in constraints.txt to match setup.py""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'update', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - - -@nox.session -def check_lower_bounds(session): - """Check lower bounds in setup.py are reflected in constraints file""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'check', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx==7.0.1", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION) - session.run( - "black", - "--check", - *BLACK_PATHS, - ) - session.run("flake8", "google", "tests", "samples") - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def blacken(session): - """Run black. Format code to uniform standard.""" - session.install(BLACK_VERSION) - session.run( - "black", - *BLACK_PATHS, - ) diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/scripts/fixup_gmail_keywords.py b/owl-bot-staging/google-apps-script-type/gmail-py/scripts/fixup_gmail_keywords.py deleted file mode 100644 index 16c727b4022b..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/scripts/fixup_gmail_keywords.py +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import argparse -import os -import libcst as cst -import pathlib -import sys -from typing import (Any, Callable, Dict, List, Sequence, Tuple) - - -def partition( - predicate: Callable[[Any], bool], - iterator: Sequence[Any] -) -> Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class gmailCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=gmailCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the gmail client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/setup.py b/owl-bot-staging/google-apps-script-type/gmail-py/setup.py deleted file mode 100644 index 519b10ea18ac..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/setup.py +++ /dev/null @@ -1,99 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import io -import os -import re - -import setuptools # type: ignore - -package_root = os.path.abspath(os.path.dirname(__file__)) - -name = 'google-apps-script-type-gmail' - - -description = "Google Apps Script Type Gmail API client library" - -version = None - -with open(os.path.join(package_root, 'google/apps/script/type/gmail/gapic_version.py')) as fp: - version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) - assert (len(version_candidates) == 1) - version = version_candidates[0] - -if version[0] == "0": - release_status = "Development Status :: 4 - Beta" -else: - release_status = "Development Status :: 5 - Production/Stable" - -dependencies = [ - "google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - # Exclude incompatible versions of `google-auth` - # See https://github.com/googleapis/google-cloud-python/issues/12364 - "google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0", - "proto-plus >= 1.22.3, <2.0.0dev", - "proto-plus >= 1.25.0, <2.0.0dev; python_version >= '3.13'", - "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", - "google-apps-script-type >= 0.2.0, <1.0.0dev", -] -extras = { -} -url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-apps-script-type-gmail" - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package - for package in setuptools.find_namespace_packages() - if package.startswith("google") -] - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url=url, - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - python_requires=">=3.7", - install_requires=dependencies, - extras_require=extras, - include_package_data=True, - zip_safe=False, -) diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.10.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.10.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.11.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.11.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.12.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.12.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.13.txt b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.13.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.13.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.7.txt deleted file mode 100644 index add339dc78f3..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.7.txt +++ /dev/null @@ -1,11 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file. -# Pin the version to the lower bound. -# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", -# Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.34.1 -google-auth==2.14.1 -proto-plus==1.22.3 -protobuf==3.20.2 -google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.8.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.8.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.9.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/testing/constraints-3.9.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/gmail-py/tests/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/tests/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/gmail/__init__.py b/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/gmail/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/gmail-py/tests/unit/gapic/gmail/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/.coveragerc b/owl-bot-staging/google-apps-script-type/sheets-py/.coveragerc deleted file mode 100644 index 718f27f1463e..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/.coveragerc +++ /dev/null @@ -1,13 +0,0 @@ -[run] -branch = True - -[report] -show_missing = True -omit = - google/apps/script/type/sheets/__init__.py - google/apps/script/type/sheets/gapic_version.py -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/.flake8 b/owl-bot-staging/google-apps-script-type/sheets-py/.flake8 deleted file mode 100644 index 29227d4cf419..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/.flake8 +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - **/services/** - **/types/** - *_pb2.py - - # Standard linting exemptions. - **/.nox/** - __pycache__, - .git, - *.pyc, - conf.py diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/sheets-py/MANIFEST.in deleted file mode 100644 index fb187de1bffd..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -recursive-include google/apps/script/type/sheets *.py -recursive-include google/apps/script/type/sheets *.py diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/README.rst b/owl-bot-staging/google-apps-script-type/sheets-py/README.rst deleted file mode 100644 index 2e72a247fb1d..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/README.rst +++ /dev/null @@ -1,49 +0,0 @@ -Python Client for Google Apps Script Type Sheets API -================================================= - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. Enable the Google Apps Script Type Sheets API. -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - python3 -m venv - source /bin/activate - /bin/pip install /path/to/library - - -Windows -^^^^^^^ - -.. code-block:: console - - python3 -m venv - \Scripts\activate - \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/sheets-py/docs/_static/custom.css deleted file mode 100644 index 06423be0b592..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/docs/_static/custom.css +++ /dev/null @@ -1,3 +0,0 @@ -dl.field-list > dt { - min-width: 100px -} diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/sheets-py/docs/conf.py deleted file mode 100644 index 2e352e909927..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/docs/conf.py +++ /dev/null @@ -1,376 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# -# google-apps-script-type-sheets documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "4.0.1" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The root toctree document. -root_doc = "index" - -# General information about the project. -project = u"google-apps-script-type-sheets" -copyright = u"2023, Google, LLC" -author = u"Google APIs" # TODO: autogenerate this bit - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = 'en' - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Apps Script Type Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-apps-script-type-sheets-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - # 'preamble': '', - # Latex figure (float) alignment - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - root_doc, - "google-apps-script-type-sheets.tex", - u"google-apps-script-type-sheets Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - root_doc, - "google-apps-script-type-sheets", - u"Google Apps Script Type Sheets Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - root_doc, - "google-apps-script-type-sheets", - u"google-apps-script-type-sheets Documentation", - author, - "google-apps-script-type-sheets", - "GAPIC library for Google Apps Script Type Sheets API", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("http://requests.kennethreitz.org/en/stable/", None), - "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), - "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/sheets-py/docs/index.rst deleted file mode 100644 index faf2d612dfab..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/docs/index.rst +++ /dev/null @@ -1,7 +0,0 @@ -API Reference -------------- -.. toctree:: - :maxdepth: 2 - - sheets/services_ - sheets/types_ diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/services_.rst b/owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/services_.rst deleted file mode 100644 index 8015dea9d07c..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/services_.rst +++ /dev/null @@ -1,4 +0,0 @@ -Services for Google Apps Script Type Sheets API -================================================ -.. toctree:: - :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/types_.rst b/owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/types_.rst deleted file mode 100644 index 299268839314..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/docs/sheets/types_.rst +++ /dev/null @@ -1,6 +0,0 @@ -Types for Google Apps Script Type Sheets API -============================================= - -.. automodule:: google.apps.script.type.sheets.types - :members: - :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/__init__.py b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/__init__.py deleted file mode 100644 index ed6a03c38311..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from google.apps.script.type.sheets import gapic_version as package_version - -__version__ = package_version.__version__ - - - -from .types.sheets_addon_manifest import SheetsAddOnManifest -from .types.sheets_addon_manifest import SheetsExtensionPoint - -__all__ = ( -'SheetsAddOnManifest', -'SheetsExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_metadata.json deleted file mode 100644 index f43947aa567d..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_metadata.json +++ /dev/null @@ -1,7 +0,0 @@ - { - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "python", - "libraryPackage": "google.apps.script.type.sheets", - "protoPackage": "google.apps.script.type.sheets", - "schema": "1.0" -} diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_version.py b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_version.py deleted file mode 100644 index 558c8aab67c5..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/gapic_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/py.typed b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/py.typed deleted file mode 100644 index 4744d49c1dd6..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-apps-script-type-sheets package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/services/__init__.py b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/services/__init__.py deleted file mode 100644 index 8f6cf068242c..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/__init__.py b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/__init__.py deleted file mode 100644 index 1ace157701d5..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from .sheets_addon_manifest import ( - SheetsAddOnManifest, - SheetsExtensionPoint, -) - -__all__ = ( - 'SheetsAddOnManifest', - 'SheetsExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py b/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py deleted file mode 100644 index 821633e97739..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.apps.script.type.types import extension_point - - -__protobuf__ = proto.module( - package='google.apps.script.type.sheets', - manifest={ - 'SheetsAddOnManifest', - 'SheetsExtensionPoint', - }, -) - - -class SheetsAddOnManifest(proto.Message): - r"""Sheets add-on manifest. - - Attributes: - homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): - If present, this overrides the configuration from - ``addOns.common.homepageTrigger``. - on_file_scope_granted_trigger (google.apps.script.type.sheets.types.SheetsExtensionPoint): - Endpoint to execute when file scope - authorization is granted for this document/user - pair. - """ - - homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( - proto.MESSAGE, - number=3, - message=extension_point.HomepageExtensionPoint, - ) - on_file_scope_granted_trigger: 'SheetsExtensionPoint' = proto.Field( - proto.MESSAGE, - number=5, - message='SheetsExtensionPoint', - ) - - -class SheetsExtensionPoint(proto.Message): - r"""Common format for declaring a Sheets add-on's triggers. - - Attributes: - run_function (str): - Required. The endpoint to execute when this - extension point is activated. - """ - - run_function: str = proto.Field( - proto.STRING, - number=1, - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/mypy.ini b/owl-bot-staging/google-apps-script-type/sheets-py/mypy.ini deleted file mode 100644 index 574c5aed394b..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/mypy.ini +++ /dev/null @@ -1,3 +0,0 @@ -[mypy] -python_version = 3.7 -namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/noxfile.py b/owl-bot-staging/google-apps-script-type/sheets-py/noxfile.py deleted file mode 100644 index 0b6727124b33..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/noxfile.py +++ /dev/null @@ -1,280 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import os -import pathlib -import re -import shutil -import subprocess -import sys - - -import nox # type: ignore - -ALL_PYTHON = [ - "3.7", - "3.8", - "3.9", - "3.10", - "3.11", - "3.12", - "3.13", -] - -CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() - -LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" -PACKAGE_NAME = 'google-apps-script-type-sheets' - -BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] -DEFAULT_PYTHON_VERSION = "3.13" - -nox.sessions = [ - "unit", - "cover", - "mypy", - "check_lower_bounds" - # exclude update_lower_bounds from default - "docs", - "blacken", - "lint", - "prerelease_deps", -] - -@nox.session(python=ALL_PYTHON) -@nox.parametrize( - "protobuf_implementation", - [ "python", "upb", "cpp" ], -) -def unit(session, protobuf_implementation): - """Run the unit test suite.""" - - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): - session.skip("cpp implementation is not supported in python 3.11+") - - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - session.install('-e', '.', "-c", f"testing/constraints-{session.python}.txt") - - # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. - # The 'cpp' implementation requires Protobuf<4. - if protobuf_implementation == "cpp": - session.install("protobuf<4") - - session.run( - 'py.test', - '--quiet', - '--cov=google/apps/script/type/sheets/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)), - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) - -@nox.session(python=ALL_PYTHON[-1]) -@nox.parametrize( - "protobuf_implementation", - [ "python", "upb", "cpp" ], -) -def prerelease_deps(session, protobuf_implementation): - """Run the unit test suite against pre-release versions of dependencies.""" - - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): - session.skip("cpp implementation is not supported in python 3.11+") - - # Install test environment dependencies - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - - # Install the package without dependencies - session.install('-e', '.', '--no-deps') - - # We test the minimum dependency versions using the minimum Python - # version so the lowest python runtime that we test has a corresponding constraints - # file, located at `testing/constraints--.txt`, which contains all of the - # dependencies and extras. - with open( - CURRENT_DIRECTORY - / "testing" - / f"constraints-{ALL_PYTHON[0]}.txt", - encoding="utf-8", - ) as constraints_file: - constraints_text = constraints_file.read() - - # Ignore leading whitespace and comment lines. - constraints_deps = [ - match.group(1) - for match in re.finditer( - r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE - ) - ] - - session.install(*constraints_deps) - - prerel_deps = [ - "googleapis-common-protos", - "google-api-core", - "google-auth", - # Exclude grpcio!=1.67.0rc1 which does not support python 3.13 - "grpcio!=1.67.0rc1", - "grpcio-status", - "protobuf", - "proto-plus", - ] - - for dep in prerel_deps: - session.install("--pre", "--no-deps", "--upgrade", dep) - - # Remaining dependencies - other_deps = [ - "requests", - ] - session.install(*other_deps) - - # Print out prerelease package versions - - session.run("python", "-c", "import google.api_core; print(google.api_core.__version__)") - session.run("python", "-c", "import google.auth; print(google.auth.__version__)") - session.run("python", "-c", "import grpc; print(grpc.__version__)") - session.run( - "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" - ) - session.run( - "python", "-c", "import proto; print(proto.__version__)" - ) - - session.run( - 'py.test', - '--quiet', - '--cov=google/apps/script/type/sheets/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)), - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def cover(session): - """Run the final coverage report. - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python=ALL_PYTHON) -def mypy(session): - """Run the type checker.""" - session.install( - 'mypy', - 'types-requests', - 'types-protobuf' - ) - session.install('.') - session.run( - 'mypy', - '-p', - 'google', - ) - - -@nox.session -def update_lower_bounds(session): - """Update lower bounds in constraints.txt to match setup.py""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'update', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - - -@nox.session -def check_lower_bounds(session): - """Check lower bounds in setup.py are reflected in constraints file""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'check', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx==7.0.1", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION) - session.run( - "black", - "--check", - *BLACK_PATHS, - ) - session.run("flake8", "google", "tests", "samples") - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def blacken(session): - """Run black. Format code to uniform standard.""" - session.install(BLACK_VERSION) - session.run( - "black", - *BLACK_PATHS, - ) diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/scripts/fixup_sheets_keywords.py b/owl-bot-staging/google-apps-script-type/sheets-py/scripts/fixup_sheets_keywords.py deleted file mode 100644 index fbe6129df8d6..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/scripts/fixup_sheets_keywords.py +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import argparse -import os -import libcst as cst -import pathlib -import sys -from typing import (Any, Callable, Dict, List, Sequence, Tuple) - - -def partition( - predicate: Callable[[Any], bool], - iterator: Sequence[Any] -) -> Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class sheetsCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=sheetsCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the sheets client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/setup.py b/owl-bot-staging/google-apps-script-type/sheets-py/setup.py deleted file mode 100644 index d32957d80930..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/setup.py +++ /dev/null @@ -1,99 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import io -import os -import re - -import setuptools # type: ignore - -package_root = os.path.abspath(os.path.dirname(__file__)) - -name = 'google-apps-script-type-sheets' - - -description = "Google Apps Script Type Sheets API client library" - -version = None - -with open(os.path.join(package_root, 'google/apps/script/type/sheets/gapic_version.py')) as fp: - version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) - assert (len(version_candidates) == 1) - version = version_candidates[0] - -if version[0] == "0": - release_status = "Development Status :: 4 - Beta" -else: - release_status = "Development Status :: 5 - Production/Stable" - -dependencies = [ - "google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - # Exclude incompatible versions of `google-auth` - # See https://github.com/googleapis/google-cloud-python/issues/12364 - "google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0", - "proto-plus >= 1.22.3, <2.0.0dev", - "proto-plus >= 1.25.0, <2.0.0dev; python_version >= '3.13'", - "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", - "google-apps-script-type >= 0.2.0, <1.0.0dev", -] -extras = { -} -url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-apps-script-type-sheets" - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package - for package in setuptools.find_namespace_packages() - if package.startswith("google") -] - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url=url, - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - python_requires=">=3.7", - install_requires=dependencies, - extras_require=extras, - include_package_data=True, - zip_safe=False, -) diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.10.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.10.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.11.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.11.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.12.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.12.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.13.txt b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.13.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.13.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.7.txt deleted file mode 100644 index add339dc78f3..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.7.txt +++ /dev/null @@ -1,11 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file. -# Pin the version to the lower bound. -# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", -# Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.34.1 -google-auth==2.14.1 -proto-plus==1.22.3 -protobuf==3.20.2 -google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.8.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.8.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.9.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/testing/constraints-3.9.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/sheets-py/tests/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/tests/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/sheets/__init__.py b/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/sheets/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/sheets-py/tests/unit/gapic/sheets/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/slides-py/.coveragerc b/owl-bot-staging/google-apps-script-type/slides-py/.coveragerc deleted file mode 100644 index 5b06ae94a652..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/.coveragerc +++ /dev/null @@ -1,13 +0,0 @@ -[run] -branch = True - -[report] -show_missing = True -omit = - google/apps/script/type/slides/__init__.py - google/apps/script/type/slides/gapic_version.py -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/slides-py/.flake8 b/owl-bot-staging/google-apps-script-type/slides-py/.flake8 deleted file mode 100644 index 29227d4cf419..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/.flake8 +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - **/services/** - **/types/** - *_pb2.py - - # Standard linting exemptions. - **/.nox/** - __pycache__, - .git, - *.pyc, - conf.py diff --git a/owl-bot-staging/google-apps-script-type/slides-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/slides-py/MANIFEST.in deleted file mode 100644 index 017124b78953..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -recursive-include google/apps/script/type/slides *.py -recursive-include google/apps/script/type/slides *.py diff --git a/owl-bot-staging/google-apps-script-type/slides-py/README.rst b/owl-bot-staging/google-apps-script-type/slides-py/README.rst deleted file mode 100644 index 8baf4a9e8a16..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/README.rst +++ /dev/null @@ -1,49 +0,0 @@ -Python Client for Google Apps Script Type Slides API -================================================= - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. Enable the Google Apps Script Type Slides API. -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - python3 -m venv - source /bin/activate - /bin/pip install /path/to/library - - -Windows -^^^^^^^ - -.. code-block:: console - - python3 -m venv - \Scripts\activate - \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/slides-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/slides-py/docs/_static/custom.css deleted file mode 100644 index 06423be0b592..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/docs/_static/custom.css +++ /dev/null @@ -1,3 +0,0 @@ -dl.field-list > dt { - min-width: 100px -} diff --git a/owl-bot-staging/google-apps-script-type/slides-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/slides-py/docs/conf.py deleted file mode 100644 index 36da64433d39..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/docs/conf.py +++ /dev/null @@ -1,376 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# -# google-apps-script-type-slides documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "4.0.1" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The root toctree document. -root_doc = "index" - -# General information about the project. -project = u"google-apps-script-type-slides" -copyright = u"2023, Google, LLC" -author = u"Google APIs" # TODO: autogenerate this bit - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = 'en' - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Apps Script Type Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-apps-script-type-slides-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - # 'preamble': '', - # Latex figure (float) alignment - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - root_doc, - "google-apps-script-type-slides.tex", - u"google-apps-script-type-slides Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - root_doc, - "google-apps-script-type-slides", - u"Google Apps Script Type Slides Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - root_doc, - "google-apps-script-type-slides", - u"google-apps-script-type-slides Documentation", - author, - "google-apps-script-type-slides", - "GAPIC library for Google Apps Script Type Slides API", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("http://requests.kennethreitz.org/en/stable/", None), - "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), - "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/slides-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/slides-py/docs/index.rst deleted file mode 100644 index 969889deba80..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/docs/index.rst +++ /dev/null @@ -1,7 +0,0 @@ -API Reference -------------- -.. toctree:: - :maxdepth: 2 - - slides/services_ - slides/types_ diff --git a/owl-bot-staging/google-apps-script-type/slides-py/docs/slides/services_.rst b/owl-bot-staging/google-apps-script-type/slides-py/docs/slides/services_.rst deleted file mode 100644 index ab06ee6547e5..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/docs/slides/services_.rst +++ /dev/null @@ -1,4 +0,0 @@ -Services for Google Apps Script Type Slides API -================================================ -.. toctree:: - :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/slides-py/docs/slides/types_.rst b/owl-bot-staging/google-apps-script-type/slides-py/docs/slides/types_.rst deleted file mode 100644 index 8d074bd3c493..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/docs/slides/types_.rst +++ /dev/null @@ -1,6 +0,0 @@ -Types for Google Apps Script Type Slides API -============================================= - -.. automodule:: google.apps.script.type.slides.types - :members: - :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/__init__.py b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/__init__.py deleted file mode 100644 index e4bea875c73a..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from google.apps.script.type.slides import gapic_version as package_version - -__version__ = package_version.__version__ - - - -from .types.slides_addon_manifest import SlidesAddOnManifest -from .types.slides_addon_manifest import SlidesExtensionPoint - -__all__ = ( -'SlidesAddOnManifest', -'SlidesExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_metadata.json deleted file mode 100644 index dff8f8bbc7bf..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_metadata.json +++ /dev/null @@ -1,7 +0,0 @@ - { - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "python", - "libraryPackage": "google.apps.script.type.slides", - "protoPackage": "google.apps.script.type.slides", - "schema": "1.0" -} diff --git a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_version.py b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_version.py deleted file mode 100644 index 558c8aab67c5..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/gapic_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/py.typed b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/py.typed deleted file mode 100644 index eee2788b4c55..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-apps-script-type-slides package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/services/__init__.py b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/services/__init__.py deleted file mode 100644 index 8f6cf068242c..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/__init__.py b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/__init__.py deleted file mode 100644 index 4bb7f183eb35..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from .slides_addon_manifest import ( - SlidesAddOnManifest, - SlidesExtensionPoint, -) - -__all__ = ( - 'SlidesAddOnManifest', - 'SlidesExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/slides_addon_manifest.py b/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/slides_addon_manifest.py deleted file mode 100644 index 035f075e0aa9..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/google/apps/script/type/slides/types/slides_addon_manifest.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.apps.script.type.types import extension_point - - -__protobuf__ = proto.module( - package='google.apps.script.type.slides', - manifest={ - 'SlidesAddOnManifest', - 'SlidesExtensionPoint', - }, -) - - -class SlidesAddOnManifest(proto.Message): - r"""Slides add-on manifest. - - Attributes: - homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): - If present, this overrides the configuration from - ``addOns.common.homepageTrigger``. - on_file_scope_granted_trigger (google.apps.script.type.slides.types.SlidesExtensionPoint): - Endpoint to execute when file scope - authorization is granted for this document/user - pair. - """ - - homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( - proto.MESSAGE, - number=1, - message=extension_point.HomepageExtensionPoint, - ) - on_file_scope_granted_trigger: 'SlidesExtensionPoint' = proto.Field( - proto.MESSAGE, - number=2, - message='SlidesExtensionPoint', - ) - - -class SlidesExtensionPoint(proto.Message): - r"""Common format for declaring a Slides add-on's triggers. - - Attributes: - run_function (str): - Required. The endpoint to execute when this - extension point is activated. - """ - - run_function: str = proto.Field( - proto.STRING, - number=1, - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/slides-py/mypy.ini b/owl-bot-staging/google-apps-script-type/slides-py/mypy.ini deleted file mode 100644 index 574c5aed394b..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/mypy.ini +++ /dev/null @@ -1,3 +0,0 @@ -[mypy] -python_version = 3.7 -namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/slides-py/noxfile.py b/owl-bot-staging/google-apps-script-type/slides-py/noxfile.py deleted file mode 100644 index 1ae29a5a13f9..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/noxfile.py +++ /dev/null @@ -1,280 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import os -import pathlib -import re -import shutil -import subprocess -import sys - - -import nox # type: ignore - -ALL_PYTHON = [ - "3.7", - "3.8", - "3.9", - "3.10", - "3.11", - "3.12", - "3.13", -] - -CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() - -LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" -PACKAGE_NAME = 'google-apps-script-type-slides' - -BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] -DEFAULT_PYTHON_VERSION = "3.13" - -nox.sessions = [ - "unit", - "cover", - "mypy", - "check_lower_bounds" - # exclude update_lower_bounds from default - "docs", - "blacken", - "lint", - "prerelease_deps", -] - -@nox.session(python=ALL_PYTHON) -@nox.parametrize( - "protobuf_implementation", - [ "python", "upb", "cpp" ], -) -def unit(session, protobuf_implementation): - """Run the unit test suite.""" - - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): - session.skip("cpp implementation is not supported in python 3.11+") - - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - session.install('-e', '.', "-c", f"testing/constraints-{session.python}.txt") - - # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. - # The 'cpp' implementation requires Protobuf<4. - if protobuf_implementation == "cpp": - session.install("protobuf<4") - - session.run( - 'py.test', - '--quiet', - '--cov=google/apps/script/type/slides/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)), - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) - -@nox.session(python=ALL_PYTHON[-1]) -@nox.parametrize( - "protobuf_implementation", - [ "python", "upb", "cpp" ], -) -def prerelease_deps(session, protobuf_implementation): - """Run the unit test suite against pre-release versions of dependencies.""" - - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): - session.skip("cpp implementation is not supported in python 3.11+") - - # Install test environment dependencies - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - - # Install the package without dependencies - session.install('-e', '.', '--no-deps') - - # We test the minimum dependency versions using the minimum Python - # version so the lowest python runtime that we test has a corresponding constraints - # file, located at `testing/constraints--.txt`, which contains all of the - # dependencies and extras. - with open( - CURRENT_DIRECTORY - / "testing" - / f"constraints-{ALL_PYTHON[0]}.txt", - encoding="utf-8", - ) as constraints_file: - constraints_text = constraints_file.read() - - # Ignore leading whitespace and comment lines. - constraints_deps = [ - match.group(1) - for match in re.finditer( - r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE - ) - ] - - session.install(*constraints_deps) - - prerel_deps = [ - "googleapis-common-protos", - "google-api-core", - "google-auth", - # Exclude grpcio!=1.67.0rc1 which does not support python 3.13 - "grpcio!=1.67.0rc1", - "grpcio-status", - "protobuf", - "proto-plus", - ] - - for dep in prerel_deps: - session.install("--pre", "--no-deps", "--upgrade", dep) - - # Remaining dependencies - other_deps = [ - "requests", - ] - session.install(*other_deps) - - # Print out prerelease package versions - - session.run("python", "-c", "import google.api_core; print(google.api_core.__version__)") - session.run("python", "-c", "import google.auth; print(google.auth.__version__)") - session.run("python", "-c", "import grpc; print(grpc.__version__)") - session.run( - "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" - ) - session.run( - "python", "-c", "import proto; print(proto.__version__)" - ) - - session.run( - 'py.test', - '--quiet', - '--cov=google/apps/script/type/slides/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)), - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def cover(session): - """Run the final coverage report. - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python=ALL_PYTHON) -def mypy(session): - """Run the type checker.""" - session.install( - 'mypy', - 'types-requests', - 'types-protobuf' - ) - session.install('.') - session.run( - 'mypy', - '-p', - 'google', - ) - - -@nox.session -def update_lower_bounds(session): - """Update lower bounds in constraints.txt to match setup.py""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'update', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - - -@nox.session -def check_lower_bounds(session): - """Check lower bounds in setup.py are reflected in constraints file""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'check', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx==7.0.1", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION) - session.run( - "black", - "--check", - *BLACK_PATHS, - ) - session.run("flake8", "google", "tests", "samples") - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def blacken(session): - """Run black. Format code to uniform standard.""" - session.install(BLACK_VERSION) - session.run( - "black", - *BLACK_PATHS, - ) diff --git a/owl-bot-staging/google-apps-script-type/slides-py/scripts/fixup_slides_keywords.py b/owl-bot-staging/google-apps-script-type/slides-py/scripts/fixup_slides_keywords.py deleted file mode 100644 index def800859700..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/scripts/fixup_slides_keywords.py +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import argparse -import os -import libcst as cst -import pathlib -import sys -from typing import (Any, Callable, Dict, List, Sequence, Tuple) - - -def partition( - predicate: Callable[[Any], bool], - iterator: Sequence[Any] -) -> Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class slidesCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=slidesCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the slides client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/slides-py/setup.py b/owl-bot-staging/google-apps-script-type/slides-py/setup.py deleted file mode 100644 index 00244faf89a1..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/setup.py +++ /dev/null @@ -1,99 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import io -import os -import re - -import setuptools # type: ignore - -package_root = os.path.abspath(os.path.dirname(__file__)) - -name = 'google-apps-script-type-slides' - - -description = "Google Apps Script Type Slides API client library" - -version = None - -with open(os.path.join(package_root, 'google/apps/script/type/slides/gapic_version.py')) as fp: - version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) - assert (len(version_candidates) == 1) - version = version_candidates[0] - -if version[0] == "0": - release_status = "Development Status :: 4 - Beta" -else: - release_status = "Development Status :: 5 - Production/Stable" - -dependencies = [ - "google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - # Exclude incompatible versions of `google-auth` - # See https://github.com/googleapis/google-cloud-python/issues/12364 - "google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0", - "proto-plus >= 1.22.3, <2.0.0dev", - "proto-plus >= 1.25.0, <2.0.0dev; python_version >= '3.13'", - "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", - "google-apps-script-type >= 0.2.0, <1.0.0dev", -] -extras = { -} -url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-apps-script-type-slides" - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package - for package in setuptools.find_namespace_packages() - if package.startswith("google") -] - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url=url, - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - python_requires=">=3.7", - install_requires=dependencies, - extras_require=extras, - include_package_data=True, - zip_safe=False, -) diff --git a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.10.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.10.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.11.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.11.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.12.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.12.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.13.txt b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.13.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.13.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.7.txt deleted file mode 100644 index add339dc78f3..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.7.txt +++ /dev/null @@ -1,11 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file. -# Pin the version to the lower bound. -# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", -# Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.34.1 -google-auth==2.14.1 -proto-plus==1.22.3 -protobuf==3.20.2 -google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.8.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.8.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.9.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/testing/constraints-3.9.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/slides-py/tests/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/tests/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/slides/__init__.py b/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/slides/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/slides-py/tests/unit/gapic/slides/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/.coveragerc b/owl-bot-staging/google-apps-script-type/type-py/.coveragerc deleted file mode 100644 index 5c23a812e920..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/.coveragerc +++ /dev/null @@ -1,13 +0,0 @@ -[run] -branch = True - -[report] -show_missing = True -omit = - google/apps/script/type/__init__.py - google/apps/script/type/gapic_version.py -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/type-py/.flake8 b/owl-bot-staging/google-apps-script-type/type-py/.flake8 deleted file mode 100644 index 29227d4cf419..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/.flake8 +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - **/services/** - **/types/** - *_pb2.py - - # Standard linting exemptions. - **/.nox/** - __pycache__, - .git, - *.pyc, - conf.py diff --git a/owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in deleted file mode 100644 index 9cf19ae251ad..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -recursive-include google/apps/script/type *.py -recursive-include google/apps/script/type *.py diff --git a/owl-bot-staging/google-apps-script-type/type-py/README.rst b/owl-bot-staging/google-apps-script-type/type-py/README.rst deleted file mode 100644 index 77f60bb3ab2b..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/README.rst +++ /dev/null @@ -1,49 +0,0 @@ -Python Client for Google Apps Script Type API -================================================= - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. Enable the Google Apps Script Type API. -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - python3 -m venv - source /bin/activate - /bin/pip install /path/to/library - - -Windows -^^^^^^^ - -.. code-block:: console - - python3 -m venv - \Scripts\activate - \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css deleted file mode 100644 index 06423be0b592..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css +++ /dev/null @@ -1,3 +0,0 @@ -dl.field-list > dt { - min-width: 100px -} diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/type-py/docs/conf.py deleted file mode 100644 index cd25894b268b..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/conf.py +++ /dev/null @@ -1,376 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# -# google-apps-script-type documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "4.0.1" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The root toctree document. -root_doc = "index" - -# General information about the project. -project = u"google-apps-script-type" -copyright = u"2023, Google, LLC" -author = u"Google APIs" # TODO: autogenerate this bit - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = 'en' - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Apps Script Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-apps-script-type-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - # 'preamble': '', - # Latex figure (float) alignment - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - root_doc, - "google-apps-script-type.tex", - u"google-apps-script-type Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - root_doc, - "google-apps-script-type", - u"Google Apps Script Type Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - root_doc, - "google-apps-script-type", - u"google-apps-script-type Documentation", - author, - "google-apps-script-type", - "GAPIC library for Google Apps Script Type API", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("http://requests.kennethreitz.org/en/stable/", None), - "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), - "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/index.rst deleted file mode 100644 index 2605a730d688..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/index.rst +++ /dev/null @@ -1,7 +0,0 @@ -API Reference -------------- -.. toctree:: - :maxdepth: 2 - - type/services_ - type/types_ diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/type/services_.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/type/services_.rst deleted file mode 100644 index 2d0581ddccc7..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/type/services_.rst +++ /dev/null @@ -1,4 +0,0 @@ -Services for Google Apps Script Type API -========================================= -.. toctree:: - :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/type/types_.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/type/types_.rst deleted file mode 100644 index 1076ae59ac52..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/type/types_.rst +++ /dev/null @@ -1,6 +0,0 @@ -Types for Google Apps Script Type API -====================================== - -.. automodule:: google.apps.script.type.types - :members: - :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py deleted file mode 100644 index 82fdefc66de1..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from google.apps.script.type import gapic_version as package_version - -__version__ = package_version.__version__ - - - -from .types.addon_widget_set import AddOnWidgetSet -from .types.extension_point import HomepageExtensionPoint -from .types.extension_point import MenuItemExtensionPoint -from .types.extension_point import UniversalActionExtensionPoint -from .types.script_manifest import CommonAddOnManifest -from .types.script_manifest import HttpOptions -from .types.script_manifest import LayoutProperties -from .types.script_manifest import HttpAuthorizationHeader - -__all__ = ( -'AddOnWidgetSet', -'CommonAddOnManifest', -'HomepageExtensionPoint', -'HttpAuthorizationHeader', -'HttpOptions', -'LayoutProperties', -'MenuItemExtensionPoint', -'UniversalActionExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json deleted file mode 100644 index ba4a361d1caf..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json +++ /dev/null @@ -1,7 +0,0 @@ - { - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "python", - "libraryPackage": "google.apps.script.type", - "protoPackage": "google.apps.script.type", - "schema": "1.0" -} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py deleted file mode 100644 index 558c8aab67c5..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed deleted file mode 100644 index 04b9596b161d..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-apps-script-type package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py deleted file mode 100644 index 8f6cf068242c..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py deleted file mode 100644 index b6dc0acdc19e..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from .addon_widget_set import ( - AddOnWidgetSet, -) -from .extension_point import ( - HomepageExtensionPoint, - MenuItemExtensionPoint, - UniversalActionExtensionPoint, -) -from .script_manifest import ( - CommonAddOnManifest, - HttpOptions, - LayoutProperties, - HttpAuthorizationHeader, -) - -__all__ = ( - 'AddOnWidgetSet', - 'HomepageExtensionPoint', - 'MenuItemExtensionPoint', - 'UniversalActionExtensionPoint', - 'CommonAddOnManifest', - 'HttpOptions', - 'LayoutProperties', - 'HttpAuthorizationHeader', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py deleted file mode 100644 index 34c30061c3f0..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - - -__protobuf__ = proto.module( - package='google.apps.script.type', - manifest={ - 'AddOnWidgetSet', - }, -) - - -class AddOnWidgetSet(proto.Message): - r"""The widget subset used by an add-on. - - Attributes: - used_widgets (MutableSequence[google.apps.script.type.types.AddOnWidgetSet.WidgetType]): - The list of widgets used in an add-on. - """ - class WidgetType(proto.Enum): - r"""The Widget type. DEFAULT is the basic widget set. - - Values: - WIDGET_TYPE_UNSPECIFIED (0): - The default widget set. - DATE_PICKER (1): - The date picker. - STYLED_BUTTONS (2): - Styled buttons include filled buttons and - disabled buttons. - PERSISTENT_FORMS (3): - Persistent forms allow persisting form values - during actions. - FIXED_FOOTER (4): - Fixed footer in card. - UPDATE_SUBJECT_AND_RECIPIENTS (5): - Update the subject and recipients of a draft. - GRID_WIDGET (6): - The grid widget. - ADDON_COMPOSE_UI_ACTION (7): - A Gmail add-on action that applies to the - addon compose UI. - """ - WIDGET_TYPE_UNSPECIFIED = 0 - DATE_PICKER = 1 - STYLED_BUTTONS = 2 - PERSISTENT_FORMS = 3 - FIXED_FOOTER = 4 - UPDATE_SUBJECT_AND_RECIPIENTS = 5 - GRID_WIDGET = 6 - ADDON_COMPOSE_UI_ACTION = 7 - - used_widgets: MutableSequence[WidgetType] = proto.RepeatedField( - proto.ENUM, - number=1, - enum=WidgetType, - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py deleted file mode 100644 index 5686dee1df2c..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py +++ /dev/null @@ -1,139 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.protobuf import wrappers_pb2 # type: ignore - - -__protobuf__ = proto.module( - package='google.apps.script.type', - manifest={ - 'MenuItemExtensionPoint', - 'HomepageExtensionPoint', - 'UniversalActionExtensionPoint', - }, -) - - -class MenuItemExtensionPoint(proto.Message): - r"""Common format for declaring a menu item, or button, that - appears within a host app. - - Attributes: - run_function (str): - Required. The endpoint to execute when this - extension point is activated. - label (str): - Required. User-visible text describing the - action taken by activating this extension point. - For example, "Insert invoice". - logo_url (str): - The URL for the logo image shown in the - add-on toolbar. - If not set, defaults to the add-on's primary - logo URL. - """ - - run_function: str = proto.Field( - proto.STRING, - number=1, - ) - label: str = proto.Field( - proto.STRING, - number=2, - ) - logo_url: str = proto.Field( - proto.STRING, - number=3, - ) - - -class HomepageExtensionPoint(proto.Message): - r"""Common format for declaring an add-on's home-page view. - - Attributes: - run_function (str): - Required. The endpoint to execute when this - extension point is activated. - enabled (google.protobuf.wrappers_pb2.BoolValue): - Optional. If set to ``false``, disable the home-page view in - this context. - - Defaults to ``true`` if unset. - - If an add-ons custom home-page view is disabled, an - autogenerated overview card will be provided for users - instead. - """ - - run_function: str = proto.Field( - proto.STRING, - number=1, - ) - enabled: wrappers_pb2.BoolValue = proto.Field( - proto.MESSAGE, - number=2, - message=wrappers_pb2.BoolValue, - ) - - -class UniversalActionExtensionPoint(proto.Message): - r"""Format for declaring a universal action menu item extension - point. - - This message has `oneof`_ fields (mutually exclusive fields). - For each oneof, at most one member field can be set at the same time. - Setting any member of the oneof automatically clears all other - members. - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - label (str): - Required. User-visible text describing the - action taken by activating this extension point, - for example, "Add a new contact". - open_link (str): - URL to be opened by the UniversalAction. - - This field is a member of `oneof`_ ``action_type``. - run_function (str): - Endpoint to be run by the UniversalAction. - - This field is a member of `oneof`_ ``action_type``. - """ - - label: str = proto.Field( - proto.STRING, - number=1, - ) - open_link: str = proto.Field( - proto.STRING, - number=2, - oneof='action_type', - ) - run_function: str = proto.Field( - proto.STRING, - number=3, - oneof='action_type', - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py deleted file mode 100644 index 7478eb72346a..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py +++ /dev/null @@ -1,186 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.apps.script.type.types import addon_widget_set -from google.apps.script.type.types import extension_point -from google.protobuf import struct_pb2 # type: ignore - - -__protobuf__ = proto.module( - package='google.apps.script.type', - manifest={ - 'HttpAuthorizationHeader', - 'CommonAddOnManifest', - 'LayoutProperties', - 'HttpOptions', - }, -) - - -class HttpAuthorizationHeader(proto.Enum): - r"""Authorization header sent in add-on HTTP requests - - Values: - HTTP_AUTHORIZATION_HEADER_UNSPECIFIED (0): - Default value, equivalent to ``SYSTEM_ID_TOKEN`` - SYSTEM_ID_TOKEN (1): - Send an ID token for the project-specific - Google Workspace add-ons system service account - (default) - USER_ID_TOKEN (2): - Send an ID token for the end user - NONE (3): - Do not send an Authentication header - """ - HTTP_AUTHORIZATION_HEADER_UNSPECIFIED = 0 - SYSTEM_ID_TOKEN = 1 - USER_ID_TOKEN = 2 - NONE = 3 - - -class CommonAddOnManifest(proto.Message): - r"""Add-on configuration that is shared across all add-on host - applications. - - Attributes: - name (str): - Required. The display name of the add-on. - logo_url (str): - Required. The URL for the logo image shown in - the add-on toolbar. - layout_properties (google.apps.script.type.types.LayoutProperties): - Common layout properties for the add-on - cards. - add_on_widget_set (google.apps.script.type.types.AddOnWidgetSet): - The widgets used in the add-on. If this field - is not specified, it indicates that default set - is used. - use_locale_from_app (bool): - Whether to pass locale information from host - app. - homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): - Defines an endpoint that will be executed in - any context, in any host. Any cards generated by - this function will always be available to the - user, but may be eclipsed by contextual content - when this add-on declares more targeted - triggers. - universal_actions (MutableSequence[google.apps.script.type.types.UniversalActionExtensionPoint]): - Defines a list of extension points in the - universal action menu which serves as a setting - menu for the add-on. The extension point can be - link URL to open or an endpoint to execute as a - form submission. - open_link_url_prefixes (google.protobuf.struct_pb2.ListValue): - An OpenLink action can only use a URL with an HTTPS, MAILTO - or TEL scheme. For HTTPS links, the URL must also - `match `__ - one of the prefixes specified in this whitelist. If the - prefix omits the scheme, HTTPS is assumed. Notice that HTTP - links are automatically rewritten to HTTPS links. - """ - - name: str = proto.Field( - proto.STRING, - number=1, - ) - logo_url: str = proto.Field( - proto.STRING, - number=2, - ) - layout_properties: 'LayoutProperties' = proto.Field( - proto.MESSAGE, - number=3, - message='LayoutProperties', - ) - add_on_widget_set: addon_widget_set.AddOnWidgetSet = proto.Field( - proto.MESSAGE, - number=4, - message=addon_widget_set.AddOnWidgetSet, - ) - use_locale_from_app: bool = proto.Field( - proto.BOOL, - number=5, - ) - homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( - proto.MESSAGE, - number=6, - message=extension_point.HomepageExtensionPoint, - ) - universal_actions: MutableSequence[extension_point.UniversalActionExtensionPoint] = proto.RepeatedField( - proto.MESSAGE, - number=7, - message=extension_point.UniversalActionExtensionPoint, - ) - open_link_url_prefixes: struct_pb2.ListValue = proto.Field( - proto.MESSAGE, - number=8, - message=struct_pb2.ListValue, - ) - - -class LayoutProperties(proto.Message): - r"""Card layout properties shared across all add-on host - applications. - - Attributes: - primary_color (str): - The primary color of the add-on. It sets the - color of toolbar. If no primary color is set - explicitly, the default value provided by the - framework is used. - secondary_color (str): - The secondary color of the add-on. It sets - the color of buttons. If primary color is set - but no secondary color is set, the secondary - color is the same as the primary color. If - neither primary color nor secondary color is - set, the default value provided by the framework - is used. - """ - - primary_color: str = proto.Field( - proto.STRING, - number=1, - ) - secondary_color: str = proto.Field( - proto.STRING, - number=2, - ) - - -class HttpOptions(proto.Message): - r"""Options for sending requests to add-on HTTP endpoints - - Attributes: - authorization_header (google.apps.script.type.types.HttpAuthorizationHeader): - Configuration for the token sent in the HTTP - Authorization header - """ - - authorization_header: 'HttpAuthorizationHeader' = proto.Field( - proto.ENUM, - number=1, - enum='HttpAuthorizationHeader', - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/mypy.ini b/owl-bot-staging/google-apps-script-type/type-py/mypy.ini deleted file mode 100644 index 574c5aed394b..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/mypy.ini +++ /dev/null @@ -1,3 +0,0 @@ -[mypy] -python_version = 3.7 -namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/type-py/noxfile.py b/owl-bot-staging/google-apps-script-type/type-py/noxfile.py deleted file mode 100644 index 68e1928c917c..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/noxfile.py +++ /dev/null @@ -1,280 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import os -import pathlib -import re -import shutil -import subprocess -import sys - - -import nox # type: ignore - -ALL_PYTHON = [ - "3.7", - "3.8", - "3.9", - "3.10", - "3.11", - "3.12", - "3.13", -] - -CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() - -LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" -PACKAGE_NAME = 'google-apps-script-type' - -BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] -DEFAULT_PYTHON_VERSION = "3.13" - -nox.sessions = [ - "unit", - "cover", - "mypy", - "check_lower_bounds" - # exclude update_lower_bounds from default - "docs", - "blacken", - "lint", - "prerelease_deps", -] - -@nox.session(python=ALL_PYTHON) -@nox.parametrize( - "protobuf_implementation", - [ "python", "upb", "cpp" ], -) -def unit(session, protobuf_implementation): - """Run the unit test suite.""" - - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): - session.skip("cpp implementation is not supported in python 3.11+") - - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - session.install('-e', '.', "-c", f"testing/constraints-{session.python}.txt") - - # Remove the 'cpp' implementation once support for Protobuf 3.x is dropped. - # The 'cpp' implementation requires Protobuf<4. - if protobuf_implementation == "cpp": - session.install("protobuf<4") - - session.run( - 'py.test', - '--quiet', - '--cov=google/apps/script/type/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)), - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) - -@nox.session(python=ALL_PYTHON[-1]) -@nox.parametrize( - "protobuf_implementation", - [ "python", "upb", "cpp" ], -) -def prerelease_deps(session, protobuf_implementation): - """Run the unit test suite against pre-release versions of dependencies.""" - - if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): - session.skip("cpp implementation is not supported in python 3.11+") - - # Install test environment dependencies - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - - # Install the package without dependencies - session.install('-e', '.', '--no-deps') - - # We test the minimum dependency versions using the minimum Python - # version so the lowest python runtime that we test has a corresponding constraints - # file, located at `testing/constraints--.txt`, which contains all of the - # dependencies and extras. - with open( - CURRENT_DIRECTORY - / "testing" - / f"constraints-{ALL_PYTHON[0]}.txt", - encoding="utf-8", - ) as constraints_file: - constraints_text = constraints_file.read() - - # Ignore leading whitespace and comment lines. - constraints_deps = [ - match.group(1) - for match in re.finditer( - r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE - ) - ] - - session.install(*constraints_deps) - - prerel_deps = [ - "googleapis-common-protos", - "google-api-core", - "google-auth", - # Exclude grpcio!=1.67.0rc1 which does not support python 3.13 - "grpcio!=1.67.0rc1", - "grpcio-status", - "protobuf", - "proto-plus", - ] - - for dep in prerel_deps: - session.install("--pre", "--no-deps", "--upgrade", dep) - - # Remaining dependencies - other_deps = [ - "requests", - ] - session.install(*other_deps) - - # Print out prerelease package versions - - session.run("python", "-c", "import google.api_core; print(google.api_core.__version__)") - session.run("python", "-c", "import google.auth; print(google.auth.__version__)") - session.run("python", "-c", "import grpc; print(grpc.__version__)") - session.run( - "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" - ) - session.run( - "python", "-c", "import proto; print(proto.__version__)" - ) - - session.run( - 'py.test', - '--quiet', - '--cov=google/apps/script/type/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)), - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def cover(session): - """Run the final coverage report. - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python=ALL_PYTHON) -def mypy(session): - """Run the type checker.""" - session.install( - 'mypy', - 'types-requests', - 'types-protobuf' - ) - session.install('.') - session.run( - 'mypy', - '-p', - 'google', - ) - - -@nox.session -def update_lower_bounds(session): - """Update lower bounds in constraints.txt to match setup.py""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'update', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - - -@nox.session -def check_lower_bounds(session): - """Check lower bounds in setup.py are reflected in constraints file""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'check', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx==7.0.1", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION) - session.run( - "black", - "--check", - *BLACK_PATHS, - ) - session.run("flake8", "google", "tests", "samples") - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def blacken(session): - """Run black. Format code to uniform standard.""" - session.install(BLACK_VERSION) - session.run( - "black", - *BLACK_PATHS, - ) diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py deleted file mode 100644 index bae51b8ecbd3..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import argparse -import os -import libcst as cst -import pathlib -import sys -from typing import (Any, Callable, Dict, List, Sequence, Tuple) - - -def partition( - predicate: Callable[[Any], bool], - iterator: Sequence[Any] -) -> Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class typeCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=typeCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the type client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/setup.py b/owl-bot-staging/google-apps-script-type/type-py/setup.py deleted file mode 100644 index 9a60f0e18cdc..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/setup.py +++ /dev/null @@ -1,98 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import io -import os -import re - -import setuptools # type: ignore - -package_root = os.path.abspath(os.path.dirname(__file__)) - -name = 'google-apps-script-type' - - -description = "Google Apps Script Type API client library" - -version = None - -with open(os.path.join(package_root, 'google/apps/script/type/gapic_version.py')) as fp: - version_candidates = re.findall(r"(?<=\")\d+.\d+.\d+(?=\")", fp.read()) - assert (len(version_candidates) == 1) - version = version_candidates[0] - -if version[0] == "0": - release_status = "Development Status :: 4 - Beta" -else: - release_status = "Development Status :: 5 - Production/Stable" - -dependencies = [ - "google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - # Exclude incompatible versions of `google-auth` - # See https://github.com/googleapis/google-cloud-python/issues/12364 - "google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0", - "proto-plus >= 1.22.3, <2.0.0dev", - "proto-plus >= 1.25.0, <2.0.0dev; python_version >= '3.13'", - "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", -] -extras = { -} -url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-apps-script-type" - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package - for package in setuptools.find_namespace_packages() - if package.startswith("google") -] - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url=url, - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - python_requires=">=3.7", - install_requires=dependencies, - extras_require=extras, - include_package_data=True, - zip_safe=False, -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt deleted file mode 100644 index ed7f9aed2559..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt deleted file mode 100644 index ed7f9aed2559..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt deleted file mode 100644 index ed7f9aed2559..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.13.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.13.txt deleted file mode 100644 index ed7f9aed2559..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.13.txt +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt deleted file mode 100644 index fc812592b0ee..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt +++ /dev/null @@ -1,10 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file. -# Pin the version to the lower bound. -# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", -# Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.34.1 -google-auth==2.14.1 -proto-plus==1.22.3 -protobuf==3.20.2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt deleted file mode 100644 index ed7f9aed2559..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt deleted file mode 100644 index ed7f9aed2559..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py deleted file mode 100644 index 7b3de3117f38..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/packages/google-apps-script-type/google/apps/script/type/calendar/gapic_version.py b/packages/google-apps-script-type/google/apps/script/type/calendar/gapic_version.py index 075108786e34..558c8aab67c5 100644 --- a/packages/google-apps-script-type/google/apps/script/type/calendar/gapic_version.py +++ b/packages/google-apps-script-type/google/apps/script/type/calendar/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.3.11" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-apps-script-type/google/apps/script/type/docs/gapic_version.py b/packages/google-apps-script-type/google/apps/script/type/docs/gapic_version.py index 075108786e34..558c8aab67c5 100644 --- a/packages/google-apps-script-type/google/apps/script/type/docs/gapic_version.py +++ b/packages/google-apps-script-type/google/apps/script/type/docs/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.3.11" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-apps-script-type/google/apps/script/type/drive/gapic_version.py b/packages/google-apps-script-type/google/apps/script/type/drive/gapic_version.py index 075108786e34..558c8aab67c5 100644 --- a/packages/google-apps-script-type/google/apps/script/type/drive/gapic_version.py +++ b/packages/google-apps-script-type/google/apps/script/type/drive/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.3.11" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-apps-script-type/google/apps/script/type/gapic_version.py b/packages/google-apps-script-type/google/apps/script/type/gapic_version.py index 075108786e34..558c8aab67c5 100644 --- a/packages/google-apps-script-type/google/apps/script/type/gapic_version.py +++ b/packages/google-apps-script-type/google/apps/script/type/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.3.11" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-apps-script-type/google/apps/script/type/gmail/gapic_version.py b/packages/google-apps-script-type/google/apps/script/type/gmail/gapic_version.py index 075108786e34..558c8aab67c5 100644 --- a/packages/google-apps-script-type/google/apps/script/type/gmail/gapic_version.py +++ b/packages/google-apps-script-type/google/apps/script/type/gmail/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.3.11" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-apps-script-type/google/apps/script/type/sheets/gapic_version.py b/packages/google-apps-script-type/google/apps/script/type/sheets/gapic_version.py index 075108786e34..558c8aab67c5 100644 --- a/packages/google-apps-script-type/google/apps/script/type/sheets/gapic_version.py +++ b/packages/google-apps-script-type/google/apps/script/type/sheets/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.3.11" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-apps-script-type/google/apps/script/type/slides/gapic_version.py b/packages/google-apps-script-type/google/apps/script/type/slides/gapic_version.py index 075108786e34..558c8aab67c5 100644 --- a/packages/google-apps-script-type/google/apps/script/type/slides/gapic_version.py +++ b/packages/google-apps-script-type/google/apps/script/type/slides/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.3.11" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-apps-script-type/google/apps/script/type/types/script_manifest.py b/packages/google-apps-script-type/google/apps/script/type/types/script_manifest.py index 26012eb12fad..18f81ba5d09c 100644 --- a/packages/google-apps-script-type/google/apps/script/type/types/script_manifest.py +++ b/packages/google-apps-script-type/google/apps/script/type/types/script_manifest.py @@ -41,7 +41,7 @@ class HttpAuthorizationHeader(proto.Enum): Default value, equivalent to ``SYSTEM_ID_TOKEN`` SYSTEM_ID_TOKEN (1): Send an ID token for the project-specific - Google Workspace Add-ons system service account + Google Workspace add-ons system service account (default) USER_ID_TOKEN (2): Send an ID token for the end user