Re-export deprecated resources and models

This commit is contained in:
Jedd Morgan
2024-10-31 13:58:44 +00:00
parent eae60160a1
commit e978e4f632
55 changed files with 354 additions and 168 deletions
+8 -7
View File
@@ -2,6 +2,13 @@ from deprecated import deprecated
from specklepy.api.credentials import Account
from specklepy.api.resources import (
ActiveUserResource,
ModelResource,
OtherUserResource,
ProjectInviteResource,
ProjectResource,
SubscriptionResource,
VersionResource,
branch,
commit,
object,
@@ -10,13 +17,6 @@ from specklepy.api.resources import (
subscriptions,
user,
)
from specklepy.api.resources.active_user_resource import ActiveUserResource
from specklepy.api.resources.model_resource import ModelResource
from specklepy.api.resources.other_user_resource import OtherUserResource
from specklepy.api.resources.project_invite_resource import ProjectInviteResource
from specklepy.api.resources.project_resource import ProjectResource
from specklepy.api.resources.subscription_resource import SubscriptionResource
from specklepy.api.resources.version_resource import VersionResource
from specklepy.core.api.client import SpeckleClient as CoreSpeckleClient
from specklepy.logging import metrics
@@ -119,6 +119,7 @@ class SpeckleClient(CoreSpeckleClient):
account=self.account,
basepath=self.ws_url,
client=self.wsclient,
# todo: why doesn't this take a server version
)
# Deprecated Resources
self.user = user.Resource(
+40 -8
View File
@@ -1,9 +1,41 @@
import pkgutil
import sys
from importlib import import_module
from specklepy.api.resources.current.active_user_resource import ActiveUserResource
from specklepy.api.resources.current.model_resource import ModelResource
from specklepy.api.resources.current.other_user_resource import OtherUserResource
from specklepy.api.resources.current.project_invite_resource import (
ProjectInviteResource,
)
from specklepy.api.resources.current.project_resource import ProjectResource
from specklepy.api.resources.current.server_resource import ServerResource
from specklepy.api.resources.current.subscription_resource import SubscriptionResource
from specklepy.api.resources.current.version_resource import VersionResource
from specklepy.api.resources.deprecated import (
active_user,
branch,
commit,
object,
other_user,
server,
stream,
subscriptions,
user,
)
for _, name, _ in pkgutil.iter_modules(__path__):
imported_module = import_module("." + name, package=__name__)
if hasattr(imported_module, "Resource"):
setattr(sys.modules[__name__], name, imported_module)
__all__ = [
"ActiveUserResource",
"ModelResource",
"OtherUserResource",
"ProjectInviteResource",
"ProjectResource",
"ServerResource",
"SubscriptionResource",
"VersionResource",
"active_user",
"branch",
"commit",
"object",
"other_user",
"server",
"stream",
"subscriptions",
"user",
]
@@ -6,16 +6,16 @@ from deprecated import deprecated
from specklepy.core.api.inputs.project_inputs import UserProjectsFilter
from specklepy.core.api.inputs.user_inputs import UserUpdateInput
from specklepy.core.api.models import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
PendingStreamCollaborator,
Project,
ResourceCollection,
User,
)
from specklepy.core.api.new_models import Project
from specklepy.core.api.resources.active_user_resource import (
ActiveUserResource as CoreResource,
from specklepy.core.api.models.deprecated import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
)
from specklepy.core.api.resources import ActiveUserResource as CoreResource
from specklepy.logging import metrics
@@ -7,8 +7,8 @@ from specklepy.core.api.inputs.model_inputs import (
UpdateModelInput,
)
from specklepy.core.api.inputs.project_inputs import ProjectModelsFilter
from specklepy.core.api.new_models import Model, ModelWithVersions, ResourceCollection
from specklepy.core.api.resources.model_resource import ModelResource as CoreResource
from specklepy.core.api.models import Model, ModelWithVersions, ResourceCollection
from specklepy.core.api.resources import ModelResource as CoreResource
from specklepy.logging import metrics
@@ -4,15 +4,15 @@ from typing import List, Optional, Union
from deprecated import deprecated
from specklepy.core.api.models import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
ActivityCollection,
LimitedUser,
UserSearchResultCollection,
)
from specklepy.core.api.new_models import UserSearchResultCollection
from specklepy.core.api.resources.other_user_resource import (
OtherUserResource as CoreResource,
from specklepy.core.api.models.deprecated import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
)
from specklepy.core.api.resources import OtherUserResource as CoreResource
from specklepy.logging import metrics
from specklepy.logging.exceptions import SpeckleException
@@ -7,10 +7,8 @@ from specklepy.core.api.inputs.project_inputs import (
ProjectInviteCreateInput,
ProjectInviteUseInput,
)
from specklepy.core.api.new_models import PendingStreamCollaborator, ProjectWithTeam
from specklepy.core.api.resources.project_invite_resource import (
ProjectInviteResource as CoreResource,
)
from specklepy.core.api.models import PendingStreamCollaborator, ProjectWithTeam
from specklepy.core.api.resources import ProjectInviteResource as CoreResource
from specklepy.logging import metrics
@@ -6,11 +6,8 @@ from specklepy.core.api.inputs.project_inputs import (
ProjectUpdateInput,
ProjectUpdateRoleInput,
)
from specklepy.core.api.models import Project
from specklepy.core.api.new_models import ProjectWithModels, ProjectWithTeam
from specklepy.core.api.resources.project_resource import (
ProjectResource as CoreResource,
)
from specklepy.core.api.models import Project, ProjectWithModels, ProjectWithTeam
from specklepy.core.api.resources import ProjectResource as CoreResource
from specklepy.logging import metrics
@@ -1,11 +1,11 @@
from typing import Any, Dict, List, Tuple
from specklepy.api.models import ServerInfo
from specklepy.core.api.resources.server import Resource as CoreResource
from specklepy.core.api.resources import ServerResource as CoreResource
from specklepy.logging import metrics
class Resource(CoreResource):
class ServerResource(CoreResource):
"""API Access class for the server"""
def __init__(self, account, basepath, client) -> None:
@@ -3,15 +3,13 @@ from typing import Callable, Optional, Sequence
from pydantic import BaseModel
from typing_extensions import TypeVar
from specklepy.core.api.new_models import (
from specklepy.core.api.models import (
ProjectModelsUpdatedMessage,
ProjectUpdatedMessage,
ProjectVersionsUpdatedMessage,
UserProjectsUpdatedMessage,
)
from specklepy.core.api.resources.subscription_resource import (
SubscriptionResource as CoreResource,
)
from specklepy.core.api.resources import SubscriptionResource as CoreResource
from specklepy.logging import metrics
TEventArgs = TypeVar("TEventArgs", bound=BaseModel)
@@ -8,10 +8,8 @@ from specklepy.core.api.inputs.version_inputs import (
MoveVersionsInput,
UpdateVersionInput,
)
from specklepy.core.api.new_models import ResourceCollection, Version
from specklepy.core.api.resources.version_resource import (
VersionResource as CoreResource,
)
from specklepy.core.api.models import ResourceCollection, Version
from specklepy.core.api.resources import VersionResource as CoreResource
from specklepy.logging import metrics
@@ -1,7 +1,7 @@
from deprecated import deprecated
from specklepy.api.resources.active_user_resource import ActiveUserResource
from specklepy.core.api.models import FE1_DEPRECATION_VERSION
from specklepy.api.resources import ActiveUserResource
from specklepy.core.api.models.deprecated import FE1_DEPRECATION_VERSION
@deprecated(reason="Renamed to ActiveUserResource", version=FE1_DEPRECATION_VERSION)
@@ -3,8 +3,11 @@ from typing import Optional, Union
from deprecated import deprecated
from specklepy.api.models import Branch
from specklepy.core.api.models import FE1_DEPRECATION_REASON, FE1_DEPRECATION_VERSION
from specklepy.core.api.resources.branch import Resource as CoreResource
from specklepy.core.api.models.deprecated import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
)
from specklepy.core.api.resources.deprecated.branch import Resource as CoreResource
from specklepy.logging import metrics
from specklepy.logging.exceptions import SpeckleException
@@ -3,8 +3,11 @@ from typing import List, Optional, Union
from deprecated import deprecated
from specklepy.api.models import Commit
from specklepy.core.api.models import FE1_DEPRECATION_REASON, FE1_DEPRECATION_VERSION
from specklepy.core.api.resources.commit import Resource as CoreResource
from specklepy.core.api.models.deprecated import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
)
from specklepy.core.api.resources.deprecated.commit import Resource as CoreResource
from specklepy.logging import metrics
from specklepy.logging.exceptions import SpeckleException
@@ -2,8 +2,11 @@ from typing import Dict, List
from deprecated import deprecated
from specklepy.core.api.models import FE1_DEPRECATION_REASON, FE1_DEPRECATION_VERSION
from specklepy.core.api.resources.object import Resource as CoreResource
from specklepy.core.api.models.deprecated import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
)
from specklepy.core.api.resources.deprecated.object import Resource as CoreResource
from specklepy.logging import metrics
from specklepy.objects.base import Base
@@ -1,7 +1,7 @@
from deprecated import deprecated
from specklepy.api.resources.other_user_resource import OtherUserResource
from specklepy.core.api.models import FE1_DEPRECATION_VERSION
from specklepy.api.resources import OtherUserResource
from specklepy.core.api.models.deprecated import FE1_DEPRECATION_VERSION
@deprecated(reason="Renamed to OtherUserResource", version=FE1_DEPRECATION_VERSION)
@@ -0,0 +1,9 @@
from deprecated import deprecated
from specklepy.api.resources import ServerResource
from specklepy.core.api.models.deprecated import FE1_DEPRECATION_VERSION
@deprecated(reason="Renamed to ActiveUserResource", version=FE1_DEPRECATION_VERSION)
class Resource(ServerResource):
"""Renamed to ServerResource"""
@@ -4,8 +4,11 @@ from typing import List, Optional
from deprecated import deprecated
from specklepy.api.models import PendingStreamCollaborator, Stream
from specklepy.core.api.models import FE1_DEPRECATION_REASON, FE1_DEPRECATION_VERSION
from specklepy.core.api.resources.stream import Resource as CoreResource
from specklepy.core.api.models.deprecated import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
)
from specklepy.core.api.resources.deprecated.stream import Resource as CoreResource
from specklepy.logging import metrics
@@ -3,9 +3,14 @@ from typing import Callable, Dict, List, Optional, Union
from deprecated import deprecated
from graphql import DocumentNode
from specklepy.core.api.models import FE1_DEPRECATION_REASON, FE1_DEPRECATION_VERSION
from specklepy.core.api.resources.subscription_resource import check_wsclient
from specklepy.core.api.resources.subscriptions import Resource as CoreResource
from specklepy.core.api.models.deprecated import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
)
from specklepy.core.api.resources.current.subscription_resource import check_wsclient
from specklepy.core.api.resources.deprecated.subscriptions import (
Resource as CoreResource,
)
from specklepy.logging import metrics
@@ -4,7 +4,7 @@ from typing import List, Optional, Union
from deprecated import deprecated
from specklepy.api.models import PendingStreamCollaborator, User
from specklepy.core.api.resources.user import Resource as CoreResource
from specklepy.core.api.resources.deprecated.user import Resource as CoreResource
from specklepy.logging import metrics
from specklepy.logging.exceptions import SpeckleException
+9 -9
View File
@@ -11,21 +11,21 @@ from gql.transport.websockets import WebsocketsTransport
from specklepy.core.api import resources
from specklepy.core.api.credentials import Account, get_account_from_token
from specklepy.core.api.resources import (
ActiveUserResource,
ModelResource,
OtherUserResource,
ProjectInviteResource,
ProjectResource,
ServerResource,
SubscriptionResource,
VersionResource,
branch,
commit,
object,
server,
stream,
subscriptions,
user,
)
from specklepy.core.api.resources.active_user_resource import ActiveUserResource
from specklepy.core.api.resources.model_resource import ModelResource
from specklepy.core.api.resources.other_user_resource import OtherUserResource
from specklepy.core.api.resources.project_invite_resource import ProjectInviteResource
from specklepy.core.api.resources.project_resource import ProjectResource
from specklepy.core.api.resources.subscription_resource import SubscriptionResource
from specklepy.core.api.resources.version_resource import VersionResource
from specklepy.logging import metrics
from specklepy.logging.exceptions import SpeckleException, SpeckleWarning
@@ -198,7 +198,7 @@ class SpeckleClient:
return self.httpclient.execute(query)
def _init_resources(self) -> None:
self.server = server.Resource(
self.server = ServerResource(
account=self.account, basepath=self.url, client=self.httpclient
)
+1 -1
View File
@@ -5,7 +5,7 @@ from urllib.parse import urlparse
from pydantic import BaseModel, Field # pylint: disable=no-name-in-module
from specklepy.core.api.models import ServerInfo
from specklepy.core.api.models.deprecated import ServerInfo
from specklepy.core.helpers import speckle_path_provider
from specklepy.logging.exceptions import SpeckleException
from specklepy.transports.sqlite import SQLiteTransport
@@ -2,7 +2,7 @@ from typing import Optional, Sequence
from pydantic import BaseModel
from specklepy.core.api.models import ProjectVisibility
from specklepy.core.api.enums import ProjectVisibility
class ProjectCreateInput(BaseModel):
+71
View File
@@ -0,0 +1,71 @@
from specklepy.core.api.models.current import (
AuthStrategy,
LimitedUser,
Model,
ModelWithVersions,
PendingStreamCollaborator,
Project,
ProjectCollaborator,
ProjectCommentCollection,
ProjectWithModels,
ProjectWithTeam,
ResourceCollection,
ServerConfiguration,
ServerInfo,
ServerMigration,
User,
UserSearchResultCollection,
Version,
)
from specklepy.core.api.models.deprecated import (
Activity,
ActivityCollection,
Branch,
Branches,
Collaborator,
Commit,
Commits,
Object,
Stream,
Streams,
)
from specklepy.core.api.models.subscription_messages import (
ProjectModelsUpdatedMessage,
ProjectUpdatedMessage,
ProjectVersionsUpdatedMessage,
UserProjectsUpdatedMessage,
)
__all__ = [
"User",
"ResourceCollection",
"ServerMigration",
"AuthStrategy",
"ServerConfiguration",
"ServerInfo",
"LimitedUser",
"PendingStreamCollaborator",
"ProjectCollaborator",
"Version",
"Model",
"ModelWithVersions",
"Project",
"ProjectWithModels",
"ProjectWithTeam",
"ProjectCommentCollection",
"UserSearchResultCollection",
"UserProjectsUpdatedMessage",
"ProjectModelsUpdatedMessage",
"ProjectUpdatedMessage",
"ProjectVersionsUpdatedMessage",
"Collaborator",
"Commit",
"Commits",
"Object",
"Branch",
"Branches",
"Stream",
"Streams",
"Activity",
"ActivityCollection",
]
@@ -3,17 +3,33 @@ from typing import Generic, List, Optional, TypeVar
from pydantic import BaseModel
from specklepy.core.api.enums import (
ProjectModelsUpdatedMessageType,
ProjectUpdatedMessageType,
ProjectVersionsUpdatedMessageType,
ProjectVisibility,
UserProjectsUpdatedMessageType,
)
from specklepy.core.api.enums import ProjectVisibility
from specklepy.core.api.models.deprecated import Streams
T = TypeVar("T")
class User(BaseModel):
id: str
email: Optional[str] = None
name: str
bio: Optional[str] = None
company: Optional[str] = None
avatar: Optional[str] = None
verified: Optional[bool] = None
role: Optional[str] = None
streams: Optional["Streams"] = None
def __repr__(self):
return (
f"User( id: {self.id}, name: {self.name}, email: {self.email}, company:"
f" {self.company} )"
)
def __str__(self) -> str:
return self.__repr__()
class ResourceCollection(BaseModel, Generic[T]):
totalCount: int
items: List[T]
@@ -153,28 +169,3 @@ class ProjectCommentCollection(ResourceCollection[T], Generic[T]):
class UserSearchResultCollection(BaseModel):
items: List[LimitedUser]
cursor: Optional[str] = None
class UserProjectsUpdatedMessage(BaseModel):
id: str
type: UserProjectsUpdatedMessageType
project: Optional[Project]
class ProjectModelsUpdatedMessage(BaseModel):
id: str
type: ProjectModelsUpdatedMessageType
model: Optional[Model]
class ProjectUpdatedMessage(BaseModel):
id: str
type: ProjectUpdatedMessageType
project: Optional[Project]
class ProjectVersionsUpdatedMessage(BaseModel):
id: str
type: ProjectVersionsUpdatedMessageType
modelId: Optional[str]
version: Optional[Version]
@@ -4,33 +4,10 @@ from typing import List, Optional
from deprecated import deprecated
from pydantic import BaseModel, Field
from specklepy.core.api.new_models import * # noqa: F403
FE1_DEPRECATION_REASON = "Stream/Branch/Commit API is now deprecated, Use the new Project/Model/Version API functions in Client}"
FE1_DEPRECATION_VERSION = "2.20"
class User(BaseModel):
id: str
email: Optional[str] = None
name: str
bio: Optional[str] = None
company: Optional[str] = None
avatar: Optional[str] = None
verified: Optional[bool] = None
role: Optional[str] = None
streams: Optional["Streams"] = None
def __repr__(self):
return (
f"User( id: {self.id}, name: {self.name}, email: {self.email}, company:"
f" {self.company} )"
)
def __str__(self) -> str:
return self.__repr__()
@deprecated(reason=FE1_DEPRECATION_REASON, version=FE1_DEPRECATION_VERSION)
class Collaborator(BaseModel):
id: Optional[str] = None
@@ -0,0 +1,36 @@
from typing import Optional
from pydantic import BaseModel
from specklepy.core.api.enums import (
ProjectModelsUpdatedMessageType,
ProjectUpdatedMessageType,
ProjectVersionsUpdatedMessageType,
UserProjectsUpdatedMessageType,
)
from specklepy.core.api.models.current import Model, Project, Version
class UserProjectsUpdatedMessage(BaseModel):
id: str
type: UserProjectsUpdatedMessageType
project: Optional[Project]
class ProjectModelsUpdatedMessage(BaseModel):
id: str
type: ProjectModelsUpdatedMessageType
model: Optional[Model]
class ProjectUpdatedMessage(BaseModel):
id: str
type: ProjectUpdatedMessageType
project: Optional[Project]
class ProjectVersionsUpdatedMessage(BaseModel):
id: str
type: ProjectVersionsUpdatedMessageType
modelId: Optional[str]
version: Optional[Version]
@@ -0,0 +1,43 @@
from specklepy.core.api.resources.current.active_user_resource import ActiveUserResource
from specklepy.core.api.resources.current.model_resource import ModelResource
from specklepy.core.api.resources.current.other_user_resource import OtherUserResource
from specklepy.core.api.resources.current.project_invite_resource import (
ProjectInviteResource,
)
from specklepy.core.api.resources.current.project_resource import ProjectResource
from specklepy.core.api.resources.current.server_resource import ServerResource
from specklepy.core.api.resources.current.subscription_resource import (
SubscriptionResource,
)
from specklepy.core.api.resources.current.version_resource import VersionResource
from specklepy.core.api.resources.deprecated import (
active_user,
branch,
commit,
object,
other_user,
server,
stream,
subscriptions,
user,
)
__all__ = [
"ActiveUserResource",
"ModelResource",
"OtherUserResource",
"ProjectInviteResource",
"ProjectResource",
"ServerResource",
"SubscriptionResource",
"VersionResource",
"active_user",
"branch",
"commit",
"object",
"other_user",
"server",
"stream",
"subscriptions",
"user",
]
@@ -7,14 +7,16 @@ from gql import gql
from specklepy.core.api.inputs.project_inputs import UserProjectsFilter
from specklepy.core.api.inputs.user_inputs import UserUpdateInput
from specklepy.core.api.models import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
ActivityCollection,
PendingStreamCollaborator,
Project,
ResourceCollection,
User,
)
from specklepy.core.api.new_models import Project
from specklepy.core.api.models.deprecated import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
)
from specklepy.core.api.resource import ResourceBase
from specklepy.core.api.responses import DataResponse
from specklepy.logging.exceptions import GraphQLException
@@ -9,7 +9,7 @@ from specklepy.core.api.inputs.model_inputs import (
UpdateModelInput,
)
from specklepy.core.api.inputs.project_inputs import ProjectModelsFilter
from specklepy.core.api.new_models import Model, ModelWithVersions, ResourceCollection
from specklepy.core.api.models import Model, ModelWithVersions, ResourceCollection
from specklepy.core.api.resource import ResourceBase
from specklepy.core.api.responses import DataResponse
@@ -5,12 +5,14 @@ from deprecated import deprecated
from gql import gql
from specklepy.core.api.models import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
ActivityCollection,
LimitedUser,
UserSearchResultCollection,
)
from specklepy.core.api.models.deprecated import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
)
from specklepy.core.api.new_models import UserSearchResultCollection
from specklepy.core.api.resource import ResourceBase
from specklepy.core.api.responses import DataResponse
from specklepy.logging.exceptions import SpeckleException
@@ -7,7 +7,7 @@ from specklepy.core.api.inputs.project_inputs import (
ProjectInviteCreateInput,
ProjectInviteUseInput,
)
from specklepy.core.api.new_models import PendingStreamCollaborator, ProjectWithTeam
from specklepy.core.api.models import PendingStreamCollaborator, ProjectWithTeam
from specklepy.core.api.resource import ResourceBase
from specklepy.core.api.responses import DataResponse
@@ -8,8 +8,7 @@ from specklepy.core.api.inputs.project_inputs import (
ProjectUpdateInput,
ProjectUpdateRoleInput,
)
from specklepy.core.api.models import Project
from specklepy.core.api.new_models import ProjectWithModels, ProjectWithTeam
from specklepy.core.api.models import Project, ProjectWithModels, ProjectWithTeam
from specklepy.core.api.resource import ResourceBase
from specklepy.core.api.responses import DataResponse
@@ -11,7 +11,7 @@ from specklepy.logging.exceptions import GraphQLException
NAME = "server"
class Resource(ResourceBase):
class ServerResource(ResourceBase):
"""API Access class for the server"""
def __init__(self, account, basepath, client) -> None:
@@ -6,7 +6,7 @@ from graphql import DocumentNode
from pydantic import BaseModel
from typing_extensions import TypeVar
from specklepy.core.api.new_models import (
from specklepy.core.api.models import (
ProjectModelsUpdatedMessage,
ProjectUpdatedMessage,
ProjectVersionsUpdatedMessage,
@@ -10,7 +10,7 @@ from specklepy.core.api.inputs.version_inputs import (
MoveVersionsInput,
UpdateVersionInput,
)
from specklepy.core.api.new_models import ResourceCollection, Version
from specklepy.core.api.models import ResourceCollection, Version
from specklepy.core.api.resource import ResourceBase
from specklepy.core.api.responses import DataResponse
@@ -1,7 +1,7 @@
from deprecated import deprecated
from specklepy.core.api.models import FE1_DEPRECATION_VERSION
from specklepy.core.api.resources.active_user_resource import ActiveUserResource
from specklepy.core.api.models.deprecated import FE1_DEPRECATION_VERSION
from specklepy.core.api.resources import ActiveUserResource
@deprecated(
@@ -3,7 +3,7 @@ from typing import Optional
from deprecated import deprecated
from gql import gql
from specklepy.core.api.models import (
from specklepy.core.api.models.deprecated import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
Branch,
@@ -3,7 +3,7 @@ from typing import List, Optional, Union
from deprecated import deprecated
from gql import gql
from specklepy.core.api.models import (
from specklepy.core.api.models.deprecated import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
Commit,
@@ -1,7 +1,7 @@
from deprecated import deprecated
from specklepy.core.api.models import FE1_DEPRECATION_VERSION
from specklepy.core.api.resources.other_user_resource import OtherUserResource
from specklepy.core.api.models.deprecated import FE1_DEPRECATION_VERSION
from specklepy.core.api.resources import OtherUserResource
@deprecated(
@@ -0,0 +1,11 @@
from deprecated import deprecated
from specklepy.core.api.models.deprecated import FE1_DEPRECATION_VERSION
from specklepy.core.api.resources import ServerResource
NAME = "server"
@deprecated(reason="Renamed to ServerResource", version=FE1_DEPRECATION_VERSION)
class Resource(ServerResource):
"""API Access class for the server"""
@@ -5,12 +5,14 @@ from deprecated import deprecated
from gql import gql
from specklepy.core.api.models import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
ActivityCollection,
PendingStreamCollaborator,
Stream,
)
from specklepy.core.api.models.deprecated import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
)
from specklepy.core.api.resource import ResourceBase
from specklepy.logging.exceptions import SpeckleException, UnsupportedException
@@ -5,9 +5,12 @@ from deprecated import deprecated
from gql import gql
from graphql import DocumentNode
from specklepy.core.api.models import FE1_DEPRECATION_REASON, FE1_DEPRECATION_VERSION
from specklepy.core.api.models.deprecated import (
FE1_DEPRECATION_REASON,
FE1_DEPRECATION_VERSION,
Stream,
)
from specklepy.core.api.resource import ResourceBase
from specklepy.core.api.resources.stream import Stream
from specklepy.logging.exceptions import SpeckleException
NAME = "subscribe"
+2 -3
View File
@@ -2,7 +2,6 @@ import pytest
from specklepy.api.client import SpeckleClient
from specklepy.api.models import Activity, ActivityCollection, User
from specklepy.core.api.inputs.user_inputs import UserUpdateInput
from specklepy.logging.exceptions import GraphQLException
@@ -21,9 +20,9 @@ class TestUser:
bio = "i am a ghost in the machine"
with pytest.raises(GraphQLException):
client.active_user.update(input=UserUpdateInput())
client.active_user.update(bio=None)
updated = client.active_user.update(input=UserUpdateInput(bio=bio))
updated = client.active_user.update(bio=bio)
assert isinstance(updated, User)
assert isinstance(updated, User)
@@ -3,8 +3,8 @@ import pytest
from specklepy.api.client import SpeckleClient
from specklepy.core.api.inputs.project_inputs import ProjectCreateInput
from specklepy.core.api.inputs.user_inputs import UserUpdateInput
from specklepy.core.api.models import User
from specklepy.core.api.new_models import ResourceCollection
from specklepy.core.api.models.current import ResourceCollection
from specklepy.core.api.models.deprecated import User
@pytest.mark.run()
@@ -7,8 +7,8 @@ from specklepy.core.api.inputs.model_inputs import (
UpdateModelInput,
)
from specklepy.core.api.inputs.project_inputs import ProjectCreateInput
from specklepy.core.api.models import Model, Project
from specklepy.core.api.new_models import ProjectWithModels, ResourceCollection
from specklepy.core.api.models.current import ProjectWithModels, ResourceCollection
from specklepy.core.api.models.deprecated import Model, Project
from specklepy.logging.exceptions import GraphQLException
@@ -1,7 +1,7 @@
import pytest
from specklepy.api.client import SpeckleClient
from specklepy.core.api.models import User
from specklepy.core.api.models.deprecated import User
@pytest.mark.run()
@@ -9,8 +9,8 @@ from specklepy.core.api.inputs.project_inputs import (
ProjectInviteUseInput,
ProjectUpdateRoleInput,
)
from specklepy.core.api.models import PendingStreamCollaborator, Project
from specklepy.core.api.new_models import LimitedUser, ProjectWithTeam
from specklepy.core.api.models.current import LimitedUser, ProjectWithTeam
from specklepy.core.api.models.deprecated import PendingStreamCollaborator, Project
@pytest.mark.run()
@@ -6,7 +6,7 @@ from specklepy.core.api.inputs.project_inputs import (
ProjectCreateInput,
ProjectUpdateInput,
)
from specklepy.core.api.models import Project
from specklepy.core.api.models.deprecated import Project
from specklepy.logging.exceptions import GraphQLException
@@ -15,7 +15,7 @@ from specklepy.core.api.inputs.project_inputs import (
ProjectCreateInput,
ProjectUpdateInput,
)
from specklepy.core.api.new_models import (
from specklepy.core.api.models.current import (
Model,
Project,
ProjectModelsUpdatedMessage,
@@ -9,8 +9,8 @@ from specklepy.core.api.inputs.version_inputs import (
MoveVersionsInput,
UpdateVersionInput,
)
from specklepy.core.api.models import Model, Project, Version
from specklepy.core.api.new_models import ModelWithVersions, ResourceCollection
from specklepy.core.api.models.current import ModelWithVersions, ResourceCollection
from specklepy.core.api.models.deprecated import Model, Project, Version
from specklepy.logging.exceptions import GraphQLException
from tests.integration.conftest import create_version
+2 -2
View File
@@ -9,8 +9,8 @@ import requests
from specklepy.api.client import SpeckleClient
from specklepy.core.api import operations
from specklepy.core.api.inputs.version_inputs import CreateVersionInput
from specklepy.core.api.models import Stream
from specklepy.core.api.new_models import Version
from specklepy.core.api.models.current import Version
from specklepy.core.api.models.deprecated import Stream
from specklepy.logging import metrics
from specklepy.objects.base import Base
from specklepy.objects.fakemesh import FakeDirection, FakeMesh
+1 -1
View File
@@ -6,7 +6,7 @@ from urllib.parse import urlparse
import pytest
from specklepy.core.api.credentials import Account, UserInfo, get_accounts_for_server
from specklepy.core.api.models import ServerInfo, ServerMigration
from specklepy.core.api.models.deprecated import ServerInfo, ServerMigration
from specklepy.core.helpers import speckle_path_provider