Skip to content

Commit 20bda76

Browse files
committed
Make everything typecheck?
1 parent bd7de20 commit 20bda76

File tree

13 files changed

+438
-436
lines changed

13 files changed

+438
-436
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- master
77
pull_request:
88
branches:
9-
- '**'
9+
- "**"
1010

1111
jobs:
1212
tests:
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
os: [Ubuntu, MacOS, Windows]
19-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
19+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
2020
steps:
2121
- uses: actions/checkout@v3
2222

@@ -54,7 +54,7 @@ jobs:
5454

5555
- name: Install dependencies
5656
shell: bash
57-
run: poetry install -E compiler
57+
run: poetry install --with dev test
5858

5959
- name: Generate code from proto files
6060
shell: bash

.github/workflows/code-quality.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@ on:
66
- master
77
pull_request:
88
branches:
9-
- '**'
9+
- "**"
1010

1111
jobs:
1212
check-formatting:
1313
name: Check code/doc formatting
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v3
17-
- uses: actions/setup-python@v4
18-
- uses: pre-commit/[email protected]
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-python@v4
18+
- uses: pre-commit/[email protected]
19+
- run: pipx install poetry
20+
- uses: actions/setup-python@v4
21+
with:
22+
cache: "poetry"
23+
24+
- run: poetry install --with dev,test
25+
- run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
26+
- uses: jakebailey/pyright-action@v1

poetry.lock

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

pyproject.toml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ python-dateutil = "^2.8"
2121
isort = {version = "^5.11.5", optional = true}
2222
typing-extensions = "^4.7.1"
2323

24+
[tool.poetry.group.dev]
25+
optional = true
2426
[tool.poetry.group.dev.dependencies]
2527
asv = "^0.4.2"
2628
bpython = "^0.19"
@@ -32,6 +34,8 @@ pre-commit = "^2.17.0"
3234
grpcio-tools = "^1.54.2"
3335
tox = "^4.0.0"
3436

37+
[tool.poetry.group.test]
38+
optional = true
3539
[tool.poetry.group.test.dependencies]
3640
poethepoet = ">=0.9.0"
3741
pytest = "^6.2.5"
@@ -61,27 +65,27 @@ cmd = "pytest"
6165
help = "Run tests"
6266

6367
[tool.poe.tasks.types]
64-
cmd = "mypy src --ignore-missing-imports"
65-
help = "Check types with mypy"
68+
cmd = "pyright --exclude tests"
69+
help = "Check types with pyright"
6670

6771
[tool.poe.tasks]
68-
_black = "black . --exclude tests/output_ --target-version py310"
72+
_black = "black . --extend-exclude tests/output_ --target-version py310"
6973
_isort = "isort . --extend-skip-glob 'tests/output_*/**/*'"
7074

7175
[tool.poe.tasks.format]
72-
sequence = ["_black", "_isort"]
76+
sequence = ["_black", "_isort"]
7377
help = "Apply black and isort formatting to source code"
7478

7579
[tool.poe.tasks.docs]
76-
cmd = "sphinx-build docs docs/build"
80+
cmd = "sphinx-build docs docs/build"
7781
help = "Build the sphinx docs"
7882

7983
[tool.poe.tasks.bench]
8084
shell = "asv run master^! && asv run HEAD^! && asv compare master HEAD"
81-
help = "Benchmark current commit vs. master branch"
85+
help = "Benchmark current commit vs. master branch"
8286

8387
[tool.poe.tasks.clean]
84-
cmd = """
88+
cmd = """
8589
rm -rf .asv .coverage .mypy_cache .pytest_cache
8690
dist betterproto.egg-info **/__pycache__
8791
testsoutput_*
@@ -109,6 +113,10 @@ help = "Run tests with multiple pythons"
109113
cmd = "black . --check --diff"
110114
help = "Check if code style is correct"
111115

116+
[tool.pyright]
117+
typeCheckingMode = "basic"
118+
reportSelfClsParameterName = false
119+
112120
[tool.isort]
113121
py_version = 37
114122
profile = "black"
@@ -128,7 +136,7 @@ max_line_length = 88
128136

129137
[tool.doc8.ignore_path_errors]
130138
"docs/migrating.rst" = [
131-
"D001", # contains table which is longer than 88 characters long
139+
"D001", # contains table which is longer than 88 characters long
132140
]
133141

134142
[tool.coverage.run]

0 commit comments

Comments
 (0)