Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2058a90
Remove __post_init__ functions
AdrienVannson Jan 7, 2025
03ffb51
Remove __post_init__ from MessageCompiler
AdrienVannson Jan 7, 2025
1338711
Remove outdated comment
AdrienVannson Jan 7, 2025
8b03ce1
Fix typing error
AdrienVannson Jan 7, 2025
16e33ab
Fix typing error
AdrienVannson Jan 7, 2025
f22c6b6
Remove placeholders
AdrienVannson Jan 7, 2025
2757e56
Remove comment
AdrienVannson Jan 7, 2025
e12a476
Remove parent property from ProtoContentBase
AdrienVannson Jan 7, 2025
4ea2ec8
Simplify annotations
AdrienVannson Jan 7, 2025
e006a20
Rename parent variable
AdrienVannson Jan 7, 2025
d54916f
Remove useless method
AdrienVannson Jan 7, 2025
c1230f7
Fix bug
AdrienVannson Jan 7, 2025
c797cab
Fix bug
AdrienVannson Jan 7, 2025
a3fb00a
Move deprecated function
AdrienVannson Jan 7, 2025
0e19445
Fix typing errors
AdrienVannson Jan 7, 2025
9f305b6
Remove useless code
AdrienVannson Jan 7, 2025
6e043ca
Fix typing error in code validation
AdrienVannson Jan 7, 2025
3d25c79
Fix typing error
AdrienVannson Jan 7, 2025
dd541b9
Fix typin gerrors with unwrap
AdrienVannson Jan 7, 2025
38279fa
Add pyright
AdrienVannson Jan 7, 2025
d90adcc
Poe command for pyright
AdrienVannson Jan 7, 2025
6b3abc9
Use pyright in workflow
AdrienVannson Jan 7, 2025
e6e4575
Typecheck only source code for now
AdrienVannson Jan 7, 2025
366496f
Use poetry command
AdrienVannson Jan 7, 2025
500062a
Don't make EnumDefinitionCompiler inherit from MessageCompiler
AdrienVannson Jan 8, 2025
3ce8feb
Fix inheritance
AdrienVannson Jan 8, 2025
69feb66
Fix workflow permissions
AdrienVannson Jan 8, 2025
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
36 changes: 32 additions & 4 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,38 @@
- '**'

jobs:
check-formatting:
name: Check code/doc formatting
check:
name: Check code formatting, typecheck the code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5

- name: Install poetry
shell: bash
run: |
python -m pip install poetry
echo "$HOME/.poetry/bin" >> $GITHUB_PATH

- name: Configure poetry
shell: bash
run: poetry config virtualenvs.in-project true

- name: Set up cache
uses: actions/cache@v3
id: cache
with:
path: .venv
key: venv-quality-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
shell: bash
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv

- name: Install dependencies
shell: bash
run: poetry install

- uses: pre-commit/[email protected]
- uses: jakebailey/pyright-action@v2

Check warning on line 46 in .github/workflows/code-quality.yml

View check run for this annotation

GitHub Advanced Security / CodeQL

Workflow does not contain permissions

Actions Job or Workflow does not set permissions

Check warning on line 46 in .github/workflows/code-quality.yml

View check run for this annotation

GitHub Advanced Security / CodeQL

Unpinned tag for a non-immutable Action in workflow

Unpinned 3rd party Action 'Code Quality' step [Uses Step](1) uses 'jakebailey/pyright-action' with ref 'v2', not a pinned commit hash
106 changes: 28 additions & 78 deletions poetry.lock

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

12 changes: 5 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ packages = [

[tool.poetry.dependencies]
python = "^3.10"
betterproto2 = "^0.1.1"
betterproto2 = "^0.1.3"
# The Ruff version is pinned. To update it, also update it in .pre-commit-config.yaml
ruff = "~0.7.4"
grpclib = "^0.4.1"
jinja2 = ">=3.0.3"
typing-extensions = "^4.7.1"

[tool.poetry.group.dev.dependencies]
mypy = "^1.11.2"
pre-commit = "^2.17.0"
grpcio-tools = "^1.54.2"
mkdocs-material = {version = "^9.5.49", python = ">=3.10"}
mkdocstrings = {version = "^0.27.0", python = ">=3.10", extras = ["python"]}
poethepoet = ">=0.9.0"
pyright = "^1.1.391"

[tool.poetry.group.test.dependencies]
pytest = "^6.2.5"
Expand Down Expand Up @@ -54,8 +54,6 @@ select = [
"UP",

"I",

"COM812", # Trailing commas
]


Expand All @@ -72,9 +70,9 @@ help = "Run tests"
script = "tests.generate:main"
help = "Generate test cases"

[tool.poe.tasks.types]
cmd = "mypy src --ignore-missing-imports"
help = "Check types with mypy"
[tool.poe.tasks.typecheck]
cmd = "pyright src"
help = "Typecheck the code with Pyright"

[tool.poe.tasks.format]
sequence = ["_format", "_sort-imports"]
Expand Down
Loading
Loading