Skip to content

Commit

Permalink
style(all-project): fix all linting errors across the project with th…
Browse files Browse the repository at this point in the history
…e current setup
  • Loading branch information
gjedlicska committed Dec 20, 2022
1 parent 2cf9b64 commit fcc33f8
Show file tree
Hide file tree
Showing 11 changed files with 191 additions and 76 deletions.
3 changes: 2 additions & 1 deletion example/units_none.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from devtools import debug

from specklepy.api import operations
from specklepy.objects.geometry import Base
from specklepy.objects.units import Units
Expand All @@ -13,7 +15,6 @@
for prop, value in dct.items():
base.__setattr__(prop, value)

from devtools import debug

debug(base)
debug(base.units)
Expand Down
29 changes: 28 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ commitizen = "^2.38.0"
ruff = "^0.0.187"
types-deprecated = "^1.2.9"
types-ujson = "^5.6.0.0"
types-requests = "^2.28.11.5"

[tool.black]
exclude = '''
Expand Down
14 changes: 12 additions & 2 deletions src/specklepy/api/resources/branch.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Optional

from gql import gql

from specklepy.api.models import Branch
Expand Down Expand Up @@ -113,7 +115,11 @@ def list(self, stream_id: str, branches_limit: int = 10, commits_limit: int = 10
metrics.track(metrics.BRANCH, self.account, {"name": "get"})
query = gql(
"""
query BranchesGet($stream_id: String!, $branches_limit: Int!, $commits_limit: Int!) {
query BranchesGet(
$stream_id: String!,
$branches_limit: Int!,
$commits_limit: Int!
) {
stream(id: $stream_id) {
branches(limit: $branches_limit) {
items {
Expand Down Expand Up @@ -152,7 +158,11 @@ def list(self, stream_id: str, branches_limit: int = 10, commits_limit: int = 10
)

def update(
self, stream_id: str, branch_id: str, name: str = None, description: str = None
self,
stream_id: str,
branch_id: str,
name: Optional[str] = None,
description: Optional[str] = None,
):
"""Update a branch
Expand Down
25 changes: 17 additions & 8 deletions src/specklepy/api/resources/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,13 @@ def create(
Arguments:
stream_id {str} -- the stream you want to commit to
object_id {str} -- the hash of your commit object
branch_name {str} -- the name of the branch to commit to (defaults to "main")
message {str} -- optional: a message to give more information about the commit
source_application{str} -- optional: the application from which the commit was created (defaults to "python")
branch_name {str}
-- the name of the branch to commit to (defaults to "main")
message {str}
-- optional: a message to give more information about the commit
source_application{str}
-- optional: the application from which the commit was created
(defaults to "python")
parents {List[str]} -- optional: the id of the parent commits
Returns:
Expand All @@ -127,7 +131,8 @@ def create(
metrics.track(metrics.COMMIT, self.account, {"name": "create"})
query = gql(
"""
mutation CommitCreate ($commit: CommitCreateInput!){ commitCreate(commit: $commit)}
mutation CommitCreate ($commit: CommitCreateInput!)
{ commitCreate(commit: $commit)}
"""
)
params = {
Expand All @@ -151,7 +156,8 @@ def update(self, stream_id: str, commit_id: str, message: str) -> bool:
Update a commit
Arguments:
stream_id {str} -- the id of the stream that contains the commit you'd like to update
stream_id {str}
-- the id of the stream that contains the commit you'd like to update
commit_id {str} -- the id of the commit you'd like to update
message {str} -- the updated commit message
Expand All @@ -161,7 +167,8 @@ def update(self, stream_id: str, commit_id: str, message: str) -> bool:
metrics.track(metrics.COMMIT, self.account, {"name": "update"})
query = gql(
"""
mutation CommitUpdate($commit: CommitUpdateInput!){ commitUpdate(commit: $commit)}
mutation CommitUpdate($commit: CommitUpdateInput!)
{ commitUpdate(commit: $commit)}
"""
)
params = {
Expand All @@ -177,7 +184,8 @@ def delete(self, stream_id: str, commit_id: str) -> bool:
Delete a commit
Arguments:
stream_id {str} -- the id of the stream that contains the commit you'd like to delete
stream_id {str}
-- the id of the stream that contains the commit you'd like to delete
commit_id {str} -- the id of the commit you'd like to delete
Returns:
Expand All @@ -186,7 +194,8 @@ def delete(self, stream_id: str, commit_id: str) -> bool:
metrics.track(metrics.COMMIT, self.account, {"name": "delete"})
query = gql(
"""
mutation CommitDelete($commit: CommitDeleteInput!){ commitDelete(commit: $commit)}
mutation CommitDelete($commit: CommitDeleteInput!)
{ commitDelete(commit: $commit)}
"""
)
params = {"commit": {"streamId": stream_id, "id": commit_id}}
Expand Down
Loading

0 comments on commit fcc33f8

Please sign in to comment.