diff --git a/Makefile b/Makefile index a68cc6a..9e25463 100644 --- a/Makefile +++ b/Makefile @@ -90,13 +90,16 @@ exec-typecheck: @mypy test/*/*.py @${printMsg} typecheck OK -exec-format: +exec-format: @ruff format +format: + ${VENV_ACTIVATE} && make exec-format exec-lint-fix + code-qa: install ### perform code quality checks ${VENV_ACTIVATE} && make exec-code-qa -exec-code-qa: exec-lint-fix exec-format exec-typecheck +exec-code-qa: exec-lint exec-typecheck test-unit: install ${VENV_ACTIVATE} && pytest test/unit @@ -116,7 +119,7 @@ test-integration: install test-integration-coverage-report: install ### generate html coverage report for the integration tests ${VENV_ACTIVATE} && pytest --cov-report html:cov_report/integration --cov=src test/integration -test: code-qa test-unit ### perform all quality checks and tests, except for integration tests +test: format test-unit ### perform all quality checks and tests, except for integration tests upgrade-buildtools: pip install --upgrade pip diff --git a/pyproject.toml b/pyproject.toml index 5c77076..abf55b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,11 +63,6 @@ asyncio_mode = "auto" include = ["pyproject.toml", "src/**/*.py", "test/**/*.py"] [tool.ruff.lint] -ignore-init-module-imports = true - -[tool.ruff.lint.per-file-ignores] -"__init__.py" = ["F401"] -"conftest.py" = ["F401"] [tool.coverage.report] exclude_also = [ diff --git a/src/waylay/sdk/__init__.py b/src/waylay/sdk/__init__.py index 1bb4e0e..b0bbcda 100644 --- a/src/waylay/sdk/__init__.py +++ b/src/waylay/sdk/__init__.py @@ -7,7 +7,26 @@ ClientCredentials, ApplicationCredentials, TokenCredentials, + NoCredentials, WaylayToken, ) from .plugin import WaylayService, WaylayTool, WaylayPlugin, PluginAccess from .api import ApiClient +from .exceptions import WaylayError + +__all__ = [ + "WaylayClient", + "WaylayConfig", + "WaylayCredentials", + "ClientCredentials", + "ApplicationCredentials", + "TokenCredentials", + "NoCredentials", + "WaylayToken", + "WaylayService", + "WaylayTool", + "WaylayPlugin", + "PluginAccess", + "ApiClient", + "WaylayError", +] diff --git a/src/waylay/sdk/api/__init__.py b/src/waylay/sdk/api/__init__.py index 195f69a..9b0d062 100644 --- a/src/waylay/sdk/api/__init__.py +++ b/src/waylay/sdk/api/__init__.py @@ -14,3 +14,19 @@ RequestData, ) from .exceptions import ApiError, ApiValueError + +__all__ = [ + "ApiClient", + "RESTTimeout", + "AsyncClient", + "HttpClientOptions", + "HeaderTypes", + "QueryParamTypes", + "Request", + "Response", + "RequestFiles", + "RequestContent", + "RequestData", + "ApiError", + "ApiValueError", +] diff --git a/src/waylay/sdk/auth/__init__.py b/src/waylay/sdk/auth/__init__.py index ef4a21a..051944e 100644 --- a/src/waylay/sdk/auth/__init__.py +++ b/src/waylay/sdk/auth/__init__.py @@ -12,3 +12,15 @@ from .parse import parse_credentials from .exceptions import AuthError + +__all__ = [ + "WaylayCredentials", + "ClientCredentials", + "ApplicationCredentials", + "TokenCredentials", + "NoCredentials", + "WaylayToken", + "WaylayTokenAuth", + "parse_credentials", + "AuthError", +] diff --git a/src/waylay/sdk/config/__init__.py b/src/waylay/sdk/config/__init__.py index c5ac67f..30fc50a 100644 --- a/src/waylay/sdk/config/__init__.py +++ b/src/waylay/sdk/config/__init__.py @@ -8,3 +8,12 @@ SERVICE_KEY_ACCOUNTS, SERVICE_KEY_API, ) + +__all__ = [ + "WaylayConfig", + "TenantSettings", + "DEFAULT_PROFILE", + "SERVICE_KEY_GATEWAY", + "SERVICE_KEY_ACCOUNTS", + "SERVICE_KEY_API", +] diff --git a/src/waylay/sdk/plugin/__init__.py b/src/waylay/sdk/plugin/__init__.py index 4e966fc..e2cc7c4 100644 --- a/src/waylay/sdk/plugin/__init__.py +++ b/src/waylay/sdk/plugin/__init__.py @@ -1,3 +1,11 @@ """SDK client plugins.""" from .base import WithApiClient, PluginAccess, WaylayPlugin, WaylayTool, WaylayService + +__all__ = [ + "WithApiClient", + "PluginAccess", + "WaylayPlugin", + "WaylayTool", + "WaylayService", +] diff --git a/test/integration/conftest.py b/test/integration/conftest.py index 6ea9d16..35481dd 100644 --- a/test/integration/conftest.py +++ b/test/integration/conftest.py @@ -10,3 +10,14 @@ waylay_test_client, waylay_session_test_client, ) + +__all__ = [ + "waylay_test_user_id", + "waylay_test_user_secret", + "waylay_test_accounts_url", + "waylay_test_gateway_url", + "waylay_test_client_credentials", + "waylay_test_token_string", + "waylay_test_client", + "waylay_session_test_client", +] diff --git a/test/plugin/src/waylay/sdk_test/__init__.py b/test/plugin/src/waylay/sdk_test/__init__.py index 0260efb..e776924 100644 --- a/test/plugin/src/waylay/sdk_test/__init__.py +++ b/test/plugin/src/waylay/sdk_test/__init__.py @@ -1,3 +1,8 @@ """Example plugins for the Waylay Python SDK""" from .plugins import ExampleService, ExampleTool + +__all__ = [ + "ExampleService", + "ExampleTool", +] diff --git a/test/unit/conftest.py b/test/unit/conftest.py index 3b6acbe..2ba75ce 100644 --- a/test/unit/conftest.py +++ b/test/unit/conftest.py @@ -1,3 +1,9 @@ """Fixtures available for all tests in this package.""" from .fixtures import _fixture_client, _fixture_config, _fixture_credentials + +__all__ = [ + "_fixture_client", + "_fixture_config", + "_fixture_credentials", +]