Skip to content

Commit a3d5328

Browse files
authored
Rework grpc locations and add some different structure (#3)
1 parent 98309b1 commit a3d5328

File tree

13 files changed

+235
-67
lines changed

13 files changed

+235
-67
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
python: ["3.9"]
16-
os: [ubuntu-latest] # TODO:, macos-latest, windows-latest]
16+
os: [ubuntu-latest] # TODO: macos-latest, windows-latest
1717
runs-on: ${{ matrix.os }}
1818
steps:
1919
- name: Print build information

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
temporalio/proto/*
1+
.venv
2+
temporalio/api/*
3+
!temporalio/api/__init__.py
4+
temporalio/bridge/proto/*
5+
!temporalio/bridge/proto/__init__.py
6+
__pycache__

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2022 Temporal Technologies Inc. All rights reserved.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@
99
- [`poetry`](https://github.com/python-poetry/poetry) `pipx install poetry`
1010
- [`poe`](https://github.com/nat-n/poethepoet) `pipx install poethepoet`
1111

12+
- Use a local virtual env environment (helps IDEs and Windows):
13+
14+
```bash
15+
poetry config virtualenvs.in-project true
16+
```
17+
1218
- Install the package dependencies
1319

1420
```bash
1521
poetry install
1622
```
1723

18-
- Build the project (only generate the protos for now)
24+
- Build the project
1925

2026
```bash
2127
poe build

poetry.lock

Lines changed: 58 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,43 @@ repository = "https://github.com/temporalio/sdk-python"
1212
documentation = "https://docs.temporal.io/docs/python"
1313

1414
[tool.poetry.dependencies]
15-
python = "^3.7"
1615
grpcio = "^1.43.0"
16+
python = "^3.7"
1717
types-protobuf = "^3.19.6"
18-
mypy = "^0.931"
18+
typing-extensions = "^4.0.1"
1919

2020
[tool.poetry.dev-dependencies]
21-
mypy = "^0.931"
2221
black = "^21.12b0"
2322
grpcio-tools = "^1.43.0"
23+
isort = "^5.10.1"
24+
mypy = "^0.931"
25+
mypy-protobuf = "^3.2.0"
2426
pytest = "^6.2.5"
27+
pytest-asyncio = "^0.17.2"
2528

2629
[tool.poe.tasks]
27-
format = "black ."
28-
lint = "black --check ."
29-
build = "python scripts/gen-protos.py"
30+
build = ["gen-protos", "test"]
31+
format = [{cmd = "black ."}, {cmd = "isort ."}]
32+
gen-protos = "python scripts/gen-protos.py"
33+
lint = [{cmd = "black --check ."}, {cmd = "isort --check-only ."}, "lint-types"]
34+
lint-types = "mypy ."
35+
test = "pytest"
36+
37+
[tool.pytest.ini_options]
38+
asyncio_mode = "auto"
39+
40+
[tool.isort]
41+
profile = "black"
42+
skip_gitignore = true
43+
44+
[tool.mypy]
45+
ignore_missing_imports = true
46+
exclude = [
47+
# Ignore generated code
48+
'temporalio/api',
49+
'temporalio/bridge/proto',
50+
]
3051

3152
[build-system]
32-
requires = ["poetry-core>=1.0.0"]
3353
build-backend = "poetry.core.masonry.api"
54+
requires = ["poetry-core>=1.0.0"]

0 commit comments

Comments
 (0)