Skip to content

Rework grpc locations and add some different structure #2

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

Closed
wants to merge 6 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: true
matrix:
python: ["3.9"]
os: [ubuntu-latest] # TODO:, macos-latest, windows-latest]
os: [ubuntu-latest] # TODO: macos-latest, windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Print build information
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
temporalio/proto/*
.venv
temporalio/api/*
!temporalio/api/__init__.py
temporalio/bridge/proto/*
!temporalio/bridge/proto/__init__.py
__pycache__
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2022 Temporal Technologies Inc. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@
- [`poetry`](https://github.com/python-poetry/poetry) `pipx install poetry`
- [`poe`](https://github.com/nat-n/poethepoet) `pipx install poethepoet`

- Use a local virtual env environment (helps IDEs and Windows):

```bash
poetry config virtualenvs.in-project true
```

- Install the package dependencies

```bash
poetry install
```

- Build the project (only generate the protos for now)
- Build the project

```bash
poe build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also a poetry build command, I think we could integrate with that.
Not blocking this PR.

Expand Down
94 changes: 58 additions & 36 deletions poetry.lock

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

35 changes: 28 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,43 @@ repository = "https://github.com/temporalio/sdk-python"
documentation = "https://docs.temporal.io/docs/python"

[tool.poetry.dependencies]
python = "^3.7"
grpcio = "^1.43.0"
python = "^3.7"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to restrict to python<3.10?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not 3.10? I use 3.10 successfully on Windows.

types-protobuf = "^3.19.6"
mypy = "^0.931"
typing-extensions = "^4.0.1"

[tool.poetry.dev-dependencies]
mypy = "^0.931"
black = "^21.12b0"
grpcio-tools = "^1.43.0"
isort = "^5.10.1"
mypy = "^0.931"
mypy-protobuf = "^3.2.0"
pytest = "^6.2.5"
pytest-asyncio = "^0.17.2"

[tool.poe.tasks]
format = "black ."
lint = "black --check ."
build = "python scripts/gen-protos.py"
build = ["gen-protos", "test"]
format = [{cmd = "black ."}, {cmd = "isort ."}]
gen-protos = "python scripts/gen-protos.py"
lint = [{cmd = "black --check ."}, {cmd = "isort --check-only ."}, "lint-types"]
lint-types = "mypy ."
test = "pytest"

[tool.pytest.ini_options]
asyncio_mode = "auto"

[tool.isort]
profile = "black"
skip_gitignore = true

[tool.mypy]
ignore_missing_imports = true
exclude = [
# Ignore generated code
'temporalio/api',
'temporalio/bridge/proto',
]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0"]
Loading