Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove proto wheel and other minor fixes #547

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ jobs:
uses: deadsnakes/[email protected]
with:
python-version: ${{ matrix.python }}
- uses: arduino/setup-protoc@v3
with:
# TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed
version: "23.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Using fixed Poetry version until
# https://github.com/python-poetry/poetry/issues/7611 and
# https://github.com/python-poetry/poetry/pull/7694 are fixed
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,7 @@ To build the SDK from source for use as a dependency, the following prerequisite
* [Python](https://www.python.org/) >= 3.8
* Make sure the latest version of `pip` is in use
* [Rust](https://www.rust-lang.org/)
* [Protobuf Compiler](https://protobuf.dev/)
* [poetry](https://github.com/python-poetry/poetry) (e.g. `python -m pip install poetry`)
* [poe](https://github.com/nat-n/poethepoet) (e.g. `python -m pip install poethepoet`)

Expand Down
18 changes: 1 addition & 17 deletions poetry.lock

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

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ grpcio-tools = "^1.48.0"
isort = "^5.11.5"
mypy = "^1.0.0"
mypy-protobuf = "^3.3.0"
protoc-wheel-0 = "^21.1"
psutil = "^5.9.3"
pydantic = "^1.9.1"
pydocstyle = "^6.1.1"
Expand Down Expand Up @@ -124,6 +123,7 @@ environment = { PATH = "$PATH:$HOME/.cargo/bin", CARGO_NET_GIT_FETCH_WITH_CLI =
[tool.isort]
profile = "black"
skip_gitignore = true
extend_skip = ["./temporalio/bridge/sdk-core", "./temporalio/bridge/target"]

[tool.mypy]
ignore_missing_imports = true
Expand Down
29 changes: 17 additions & 12 deletions tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,13 @@ class MyTypedDictNotTotal(TypedDict, total=False):
bar: MyDataClass


class MyPydanticClass(pydantic.BaseModel):
foo: str
bar: List[MyPydanticClass]
baz: Optional[UUID] = None
# TODO(cretz): Fix when https://github.com/pydantic/pydantic/pull/9612 tagged
if sys.version_info <= (3, 12, 3):

class MyPydanticClass(pydantic.BaseModel):
foo: str
bar: List[MyPydanticClass]
baz: Optional[UUID] = None


def test_json_type_hints():
Expand Down Expand Up @@ -401,14 +404,16 @@ def fail(hint: Any, value: Any) -> None:
ok(tuple[int, str], (1, "2"))

# Pydantic
ok(
MyPydanticClass,
MyPydanticClass(
foo="foo", bar=[MyPydanticClass(foo="baz", bar=[])], baz=uuid4()
),
)
ok(List[MyPydanticClass], [MyPydanticClass(foo="foo", bar=[])])
fail(List[MyPydanticClass], [MyPydanticClass(foo="foo", bar=[]), 5])
# TODO(cretz): Fix when https://github.com/pydantic/pydantic/pull/9612 tagged
if sys.version_info <= (3, 12, 3):
ok(
MyPydanticClass,
MyPydanticClass(
foo="foo", bar=[MyPydanticClass(foo="baz", bar=[])], baz=uuid4()
),
)
ok(List[MyPydanticClass], [MyPydanticClass(foo="foo", bar=[])])
fail(List[MyPydanticClass], [MyPydanticClass(foo="foo", bar=[]), 5])


# This is an example of appending the stack to every Temporal failure error
Expand Down
Loading