Repository: zenml-io/zenml

Issue:
Branch move to Main from Master breaks the "bleeding edge install"
You are asking us to pull from the master branch, but you only have a main. 


Discussion:
Fixed by editing install instruction on PR #4 here and also at the docs: https://docs.zenml.io/getting-started/installation. Thank you for bringing it to our attention 

Resolving patch:
diff --git a/src/zenml/integrations/label_studio/annotators/label_studio_annotator.py b/src/zenml/integrations/label_studio/annotators/label_studio_annotator.py
--- a/src/zenml/integrations/label_studio/annotators/label_studio_annotator.py
+++ b/src/zenml/integrations/label_studio/annotators/label_studio_annotator.py
@@ -17,13 +17,17 @@
 import os
 import webbrowser
 from pathlib import Path
-from typing import Any, Dict, List, Optional, Tuple, cast
+from typing import Any, Dict, List, Optional, Tuple, Type, cast
 
-from label_studio_sdk import Client, Project  # type: ignore[import-not-found]
+from label_studio_sdk import Client, Project
 
+from zenml import get_step_context
 from zenml.annotators.base_annotator import BaseAnnotator
 from zenml.artifact_stores.base_artifact_store import BaseArtifactStore
 from zenml.config.global_config import GlobalConfiguration
+from zenml.integrations.label_studio.flavors import (
+    LabelStudioAnnotatorSettings,
+)
 from zenml.integrations.label_studio.flavors.label_studio_annotator_flavor import (
     LabelStudioAnnotatorConfig,
 )
@@ -49,13 +53,26 @@ def config(self) -> LabelStudioAnnotatorConfig:
         """
         return cast(LabelStudioAnnotatorConfig, self._config)
 
+    @property
+    def settings_class(self) -> Type[LabelStudioAnnotatorSettings]:
+        """Settings class for the Label Studio annotator.
+
+        Returns:
+            The settings class.
+        """
+        return LabelStudioAnnotatorSettings
+
     def get_url(self) -> str:
         """Gets the top-level URL of the annotation interface.
 
         Returns:
             The URL of the annotation interface.
         """
-        return f"{self.config.instance_url}:{self.config.port}"
+        return (
+            f"{self.config.instance_url}:{self.config.port}"
+            if self.config.port
+            else self.config.instance_url
+        )
 
     def get_url_for_dataset(self, dataset_name: str) -> str:
         """Gets the URL of the annotation interface for the given dataset.
@@ -151,12 +168,23 @@ def _get_client(self) -> Client:
         Raises:
             ValueError: when unable to access the Label Studio API key.
         """
-        secret = self.get_authentication_secret()
-        if not secret:
-            raise ValueError(
-                "Unable to access predefined secret to access Label Studio API key."
+        try:
+            settings = cast(
+                LabelStudioAnnotatorSettings,
+                self.get_settings(get_step_context().step_run),
             )
-        api_key = secret.secret_values.get("api_key")
+            if settings.api_key is None:
+                raise RuntimeError
+            else:
+                api_key = settings.api_key
+        except RuntimeError:
+            # Try to get from secret
+            secret = self.get_authentication_secret()
+            if not secret:
+                raise ValueError(
+                    "Unable to access predefined secret to access Label Studio API key."
+                )
+            api_key = secret.secret_values.get("api_key", "")
         if not api_key:
             raise ValueError(
                 "Unable to access Label Studio API key from secret."
diff --git a/src/zenml/integrations/label_studio/flavors/__init__.py b/src/zenml/integrations/label_studio/flavors/__init__.py
--- a/src/zenml/integrations/label_studio/flavors/__init__.py
+++ b/src/zenml/integrations/label_studio/flavors/__init__.py
@@ -16,9 +16,11 @@
 from zenml.integrations.label_studio.flavors.label_studio_annotator_flavor import (
     LabelStudioAnnotatorConfig,
     LabelStudioAnnotatorFlavor,
+    LabelStudioAnnotatorSettings,
 )
 
 __all__ = [
     "LabelStudioAnnotatorFlavor",
     "LabelStudioAnnotatorConfig",
+    "LabelStudioAnnotatorSettings"
 ]
diff --git a/src/zenml/integrations/label_studio/flavors/label_studio_annotator_flavor.py b/src/zenml/integrations/label_studio/flavors/label_studio_annotator_flavor.py
--- a/src/zenml/integrations/label_studio/flavors/label_studio_annotator_flavor.py
+++ b/src/zenml/integrations/label_studio/flavors/label_studio_annotator_flavor.py
@@ -19,8 +19,10 @@
     BaseAnnotatorConfig,
     BaseAnnotatorFlavor,
 )
+from zenml.config.base_settings import BaseSettings
 from zenml.integrations.label_studio import LABEL_STUDIO_ANNOTATOR_FLAVOR
 from zenml.stack.authentication_mixin import AuthenticationConfigMixin
+from zenml.utils.secret_utils import SecretField
 
 if TYPE_CHECKING:
     from zenml.integrations.label_studio.annotators import LabelStudioAnnotator
@@ -30,18 +32,31 @@
 DEFAULT_LOCAL_LABEL_STUDIO_PORT = 8093
 
 
-class LabelStudioAnnotatorConfig(
-    BaseAnnotatorConfig, AuthenticationConfigMixin
-):
-    """Config for the Label Studio annotator.
+class LabelStudioAnnotatorSettings(BaseSettings):
+    """Label studio annotator settings.
 
     Attributes:
         instance_url: URL of the Label Studio instance.
         port: The port to use for the annotation interface.
+        api_key: The api_key for label studio.
     """
 
     instance_url: str = DEFAULT_LOCAL_INSTANCE_URL
-    port: int = DEFAULT_LOCAL_LABEL_STUDIO_PORT
+    port: Optional[int] = DEFAULT_LOCAL_LABEL_STUDIO_PORT
+    api_key: Optional[str] = SecretField()
+
+
+class LabelStudioAnnotatorConfig(  # type: ignore[misc] # https://github.com/pydantic/pydantic/issues/4173
+    BaseAnnotatorConfig,
+    LabelStudioAnnotatorSettings,
+    AuthenticationConfigMixin,
+):
+    """Config for the Label Studio annotator.
+
+    This class combines settings and authentication configurations for
+    Label Studio into a single, usable configuration object without adding
+    additional functionality.
+    """
 
 
 class LabelStudioAnnotatorFlavor(BaseAnnotatorFlavor):


Test patch: