From 37c692a73a307a496734d0d1e173726255381d06 Mon Sep 17 00:00:00 2001 From: TDV Alinsa Date: Tue, 26 Nov 2024 10:10:24 -0800 Subject: [PATCH 1/2] explicitly list exported module symbols --- gspread/__init__.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/gspread/__init__.py b/gspread/__init__.py index 8e52723f0..d31529030 100644 --- a/gspread/__init__.py +++ b/gspread/__init__.py @@ -24,3 +24,44 @@ from .http_client import BackOffHTTPClient, HTTPClient from .spreadsheet import Spreadsheet from .worksheet import ValueRange, Worksheet + +from . import urls as urls +from . import utils as utils + +__all__ = [ + # from .auth + "api_key", + "authorize", + "oauth", + "oauth_from_dict", + "service_account", + "service_account_from_dict", + + # from .cell + "Cell", + + # from .client + "Client", + + # from .http_client + "BackOffHTTPClient", + "HTTPClient", + + # from .spreadsheet + "Spreadsheet", + + # from .worksheet + "Worksheet", + "ValueRange", + + # from .exceptions + "GSpreadException", + "IncorrectCellLabel", + "NoValidUrlKeyFound", + "SpreadsheetNotFound", + "WorksheetNotFound", + + # full module imports + "urls", + "utils", +] From 46f11e0a717fefd7197dc19c7f5f1db083f28928 Mon Sep 17 00:00:00 2001 From: alifeee Date: Tue, 10 Dec 2024 12:56:55 +0000 Subject: [PATCH 2/2] skip `__init__.py` in format checks --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 8e235edc1..a4495eb89 100644 --- a/tox.ini +++ b/tox.ini @@ -21,14 +21,14 @@ show-source = True statistics = True [isort] -extend_skip=.tox,./env +extend_skip=.tox,./env,./gspread/__init__.py profile=black # Used by the CI to check code format/security [testenv:lint] description = Run code linters deps = -r lint-requirements.txt -commands = black --check --diff --extend-exclude "./env" . +commands = black --check --diff --extend-exclude="./env|gspread/__init__.py" . codespell --skip=".tox,.git,./docs/build,.mypy_cache,./env" . flake8 . isort --check-only . @@ -38,7 +38,7 @@ commands = black --check --diff --extend-exclude "./env" . [testenv:format] description = Format code deps = -r lint-requirements.txt -commands = black --extend-exclude "./env" . +commands = black --extend-exclude="./env|gspread/__init__.py" . isort .