Skip to content

Separate private and public API in the package structure#645

Draft
TheMrSheldon wants to merge 2 commits intodevelopmentfrom
tiraclient_factory
Draft

Separate private and public API in the package structure#645
TheMrSheldon wants to merge 2 commits intodevelopmentfrom
tiraclient_factory

Conversation

@TheMrSheldon
Copy link
Copy Markdown
Member

This PR aims to better distinguish between the private and public API and properly hide implementation details.

Previously, the TiraClient abstract base class was only used for type hinting. With this change, the user only sees the methods RestClient(...) -> TiraClient and LocalClient(...) -> TiraClient instead of the concrete implementations to reduce cognitive load. This is a breaking API change since the imports must be updated to:

from tira.tira_client import RestClient, LocalClient

instead of

from tira.rest_api_client import Client as RestClient
from tira.local_client import Client as LocalClient

The new "private" submodule tira._internal can also be used for further implementation-details that should not be part of the public API (e.g., some of the utilities @mam10eks?).

@TheMrSheldon TheMrSheldon added enhancement New feature or request python Pull requests that update Python code labels May 27, 2024
@TheMrSheldon TheMrSheldon changed the title Moved the tira RestClient and LocalClient into an _internal package Separate private and public API in the package structure May 27, 2024
@TheMrSheldon TheMrSheldon self-assigned this May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant