Skip to content

Commit

Permalink
Merge pull request #34 from waylayio/feat/explicit_export
Browse files Browse the repository at this point in the history
feat: explicitly export names in __init__.py
  • Loading branch information
plankthom authored Mar 14, 2024
2 parents 3d1523b + 9a817fa commit 1fae3fb
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 8 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 0 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
19 changes: 19 additions & 0 deletions src/waylay/sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
16 changes: 16 additions & 0 deletions src/waylay/sdk/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,19 @@
RequestData,
)
from .exceptions import ApiError, ApiValueError

__all__ = [
"ApiClient",
"RESTTimeout",
"AsyncClient",
"HttpClientOptions",
"HeaderTypes",
"QueryParamTypes",
"Request",
"Response",
"RequestFiles",
"RequestContent",
"RequestData",
"ApiError",
"ApiValueError",
]
12 changes: 12 additions & 0 deletions src/waylay/sdk/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,15 @@
from .parse import parse_credentials

from .exceptions import AuthError

__all__ = [
"WaylayCredentials",
"ClientCredentials",
"ApplicationCredentials",
"TokenCredentials",
"NoCredentials",
"WaylayToken",
"WaylayTokenAuth",
"parse_credentials",
"AuthError",
]
9 changes: 9 additions & 0 deletions src/waylay/sdk/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@
SERVICE_KEY_ACCOUNTS,
SERVICE_KEY_API,
)

__all__ = [
"WaylayConfig",
"TenantSettings",
"DEFAULT_PROFILE",
"SERVICE_KEY_GATEWAY",
"SERVICE_KEY_ACCOUNTS",
"SERVICE_KEY_API",
]
8 changes: 8 additions & 0 deletions src/waylay/sdk/plugin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
"""SDK client plugins."""

from .base import WithApiClient, PluginAccess, WaylayPlugin, WaylayTool, WaylayService

__all__ = [
"WithApiClient",
"PluginAccess",
"WaylayPlugin",
"WaylayTool",
"WaylayService",
]
11 changes: 11 additions & 0 deletions test/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
5 changes: 5 additions & 0 deletions test/plugin/src/waylay/sdk_test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""Example plugins for the Waylay Python SDK"""

from .plugins import ExampleService, ExampleTool

__all__ = [
"ExampleService",
"ExampleTool",
]
6 changes: 6 additions & 0 deletions test/unit/conftest.py
Original file line number Diff line number Diff line change
@@ -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",
]

0 comments on commit 1fae3fb

Please sign in to comment.