Skip to content

Commit

Permalink
Merge branch 'main' into jrm/filter-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-Morgan authored Dec 11, 2024
2 parents 82b6dbb + 8dcc67f commit 35750f1
Show file tree
Hide file tree
Showing 15 changed files with 819 additions and 740 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
hooks:
- id: ruff
rev: v0.1.6
rev: v0.8.2

- repo: https://github.com/commitizen-tools/commitizen
hooks:
Expand All @@ -13,12 +13,12 @@ repos:
rev: v3.13.0

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 23.11.0
rev: 24.10.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
Expand Down
1,478 changes: 780 additions & 698 deletions poetry.lock

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ packages = [


[tool.poetry.dependencies]
python = ">=3.8.0, <4.0"
python = ">=3.9.0, <4.0"
pydantic = "^2.5"
appdirs = "^1.4.4"
gql = { extras = ["requests", "websockets"], version = "^3.3.0" }
Expand All @@ -26,19 +26,19 @@ attrs = "^23.1.0"
httpx = "^0.25.0"

[tool.poetry.group.dev.dependencies]
black = "23.11.0"
isort = "^5.7.0"
black = "24.10.0"
isort = "^5.13.2"
pytest = "^7.1.3"
pytest-asyncio = "^0.23.0"
pytest-ordering = "^0.6"
pytest-cov = "^3.0.0"
devtools = "^0.8.0"
pylint = "^2.14.4"
pylint = "^3.3.2"
pydantic-settings = "^2.3.0"
mypy = "^0.982"
pre-commit = "^2.20.0"
commitizen = "^2.38.0"
ruff = "^0.4.4"
commitizen = "^3.13.0"
ruff = "^0.8.2"
types-deprecated = "^1.2.9"
types-ujson = "^5.6.0.0"
types-requests = "^2.28.11.5"
Expand All @@ -60,8 +60,7 @@ exclude = '''
'''
include = '\.pyi?$'
line-length = 88
target-version = ["py37", "py38", "py39", "py310", "py311"]

target-version = ["py39", "py310", "py311", "py312", "py313"]

[tool.commitizen]
name = "cz_conventional_commits"
Expand Down
1 change: 1 addition & 0 deletions src/speckle_automate/fixtures.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Some useful helpers for working with automation data."""

import secrets
import string

Expand Down
12 changes: 4 additions & 8 deletions src/speckle_automate/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,13 @@ class FunctionRunData(AutomateBase):
def execute_automate_function(
automate_function: AutomateFunction[T],
input_schema: type[T],
) -> None:
...
) -> None: ...


@overload
def execute_automate_function(
automate_function: AutomateFunctionWithoutInputs,
) -> None:
...
) -> None: ...


class AutomateGenerateJsonSchema(GenerateJsonSchema):
Expand Down Expand Up @@ -146,16 +144,14 @@ def run_function(
automation_context: AutomationContext,
automate_function: AutomateFunction[T],
inputs: T,
) -> AutomationContext:
...
) -> AutomationContext: ...


@overload
def run_function(
automation_context: AutomationContext,
automate_function: AutomateFunctionWithoutInputs,
) -> AutomationContext:
...
) -> AutomationContext: ...


def run_function(
Expand Down
6 changes: 2 additions & 4 deletions src/specklepy/api/resources/current/active_user_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@ def update(
company: Optional[str] = None,
bio: Optional[str] = None,
avatar: Optional[str] = None,
) -> User:
...
) -> User: ...

@overload
def update(self, *, input: UserUpdateInput) -> User:
...
def update(self, *, input: UserUpdateInput) -> User: ...

def update(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,10 @@ def update(
company: Optional[str] = None,
bio: Optional[str] = None,
avatar: Optional[str] = None,
) -> User:
...
) -> User: ...

@overload
def update(self, *, input: UserUpdateInput) -> User:
...
def update(self, *, input: UserUpdateInput) -> User: ...

def update(
self,
Expand Down
14 changes: 8 additions & 6 deletions src/specklepy/core/api/resources/current/model_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,11 @@ def get_with_versions(
"modelId": model_id,
"versionsLimit": versions_limit,
"versionsCursor": versions_cursor,
"versionsFilter": versions_filter.model_dump(warnings="error")
if versions_filter
else None,
"versionsFilter": (
versions_filter.model_dump(warnings="error")
if versions_filter
else None
),
}

return self.make_request_and_parse_response(
Expand Down Expand Up @@ -179,9 +181,9 @@ def get_models(
"projectId": project_id,
"modelsLimit": models_limit,
"modelsCursor": models_cursor,
"modelsFilter": models_filter.model_dump(warnings="error")
if models_filter
else None,
"modelsFilter": (
models_filter.model_dump(warnings="error") if models_filter else None
),
}

return self.make_request_and_parse_response(
Expand Down
6 changes: 3 additions & 3 deletions src/specklepy/core/api/resources/current/project_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ def get_with_models(
"projectId": project_id,
"modelsLimit": models_limit,
"modelsCursor": models_cursor,
"modelsFilter": models_filter.model_dump(warnings="error")
if models_filter
else None,
"modelsFilter": (
models_filter.model_dump(warnings="error") if models_filter else None
),
}

return self.make_request_and_parse_response(
Expand Down
4 changes: 2 additions & 2 deletions src/specklepy/core/api/resources/deprecated/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def list(self, stream_limit: int = 10) -> List[Stream]:
query = gql(
"""
query User($stream_limit: Int!) {
user {
activeUser {
id
bio
name
Expand Down Expand Up @@ -149,7 +149,7 @@ def list(self, stream_limit: int = 10) -> List[Stream]:
params = {"stream_limit": stream_limit}

return self.make_request(
query=query, params=params, return_type=["user", "streams", "items"]
query=query, params=params, return_type=["activeUser", "streams", "items"]
)

@deprecated(reason=FE1_DEPRECATION_REASON, version=FE1_DEPRECATION_VERSION)
Expand Down
1 change: 1 addition & 0 deletions src/specklepy/core/helpers/speckle_path_provider.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Provides uniform and consistent path helpers for `specklepy`
"""

import os
import sys
from pathlib import Path
Expand Down
6 changes: 3 additions & 3 deletions src/specklepy/objects/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ class RevitParameter(Base, speckle_type="Objects.BuiltElements.Revit.Parameter")
value: Any = None
applicationUnitType: Optional[str] = None # eg UnitType UT_Length
applicationUnit: Optional[str] = None # DisplayUnitType eg DUT_MILLIMITERS
applicationInternalName: Optional[
str
] = None # BuiltInParameterName or GUID for shared parameter
applicationInternalName: Optional[str] = (
None # BuiltInParameterName or GUID for shared parameter
)
isShared: bool = False
isReadOnly: bool = False
isTypeParameter: bool = False
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Run integration tests with a speckle server."""

import os
from pathlib import Path
from typing import Dict
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def line(point, interval):
start=point,
end=point,
domain=interval,
units="none"
units="none",
# These attributes are not handled in C#
# bbox=None,
# length=None
Expand Down
1 change: 1 addition & 0 deletions utils/installer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Provides uniform and consistent path helpers for `specklepy`
"""

import os
import sys
from importlib import import_module, invalidate_caches
Expand Down

0 comments on commit 35750f1

Please sign in to comment.