diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c051a239..5469d692 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,11 @@ jobs: uses: deadsnakes/action@v3.1.0 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 diff --git a/README.md b/README.md index 75226fef..d7685a77 100644 --- a/README.md +++ b/README.md @@ -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`) diff --git a/poetry.lock b/poetry.lock index 96b7c858..5f9543f7 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1108,22 +1108,6 @@ files = [ {file = "protobuf-4.21.12.tar.gz", hash = "sha256:7cd532c4566d0e6feafecc1059d04c7915aec8e182d1cf7adee8b24ef1e2e6ab"}, ] -[[package]] -name = "protoc-wheel-0" -version = "21.5" -description = "Google Protocol buffers compiler" -category = "dev" -optional = false -python-versions = "*" -files = [ - {file = "protoc_wheel_0-21.5-py2.py3-none-macosx_10_6_x86_64.whl", hash = "sha256:136b94aa6ae9e899b4282a33e42de07d51c572135dd731774fb358e67702862a"}, - {file = "protoc_wheel_0-21.5-py2.py3-none-macosx_11_0_arm64.whl", hash = "sha256:21b74c0a8f3e1ae56d4d236e2d9c1f4d3dc5fe092072a8acf6d1616e79d4e87d"}, - {file = "protoc_wheel_0-21.5-py2.py3-none-manylinux1_x86_64.whl", hash = "sha256:965437ee501fa7f012e336bbd2655d24bcbeb556a5b3130ae7315639ef8a1dab"}, - {file = "protoc_wheel_0-21.5-py2.py3-none-manylinux2014_aarch64.whl", hash = "sha256:d9a89dd5ece4e9217fcf0f69a43f543424d3a134b978cf0c7ce2316867fe5d19"}, - {file = "protoc_wheel_0-21.5-py2.py3-none-win32.whl", hash = "sha256:19173b492c93f0e95dc0df5edc53c285b804ab141edfea122693aa6bc009ffbe"}, - {file = "protoc_wheel_0-21.5-py2.py3-none-win_amd64.whl", hash = "sha256:ae766f84e3ce3e34d7e936f625f1a5ab081aa8d5add23dc98b81cf771844ea0e"}, -] - [[package]] name = "psutil" version = "5.9.3" @@ -1919,4 +1903,4 @@ opentelemetry = ["opentelemetry-api", "opentelemetry-sdk"] [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "8f0c924ca5a46babe0117ac2d195a82db5579b7e10f0889b50645ad46ec16ac7" +content-hash = "58ce3f2d28683ca8dad34116a76a1f7582fcd6c877188f649b858da8510e8cc5" diff --git a/pyproject.toml b/pyproject.toml index 785071a7..021fb0d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -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 diff --git a/tests/test_converter.py b/tests/test_converter.py index a5b030c3..e3232d6a 100644 --- a/tests/test_converter.py +++ b/tests/test_converter.py @@ -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(): @@ -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