Skip to content
Open
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
40 changes: 13 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,85 +28,74 @@ jobs:
run: uv sync --locked

- name: Compile test files
working-directory: ./betterproto2_compiler
shell: bash
run: uv run poe generate
run: uv run poe generate-plugin

- name: Execute test suite
working-directory: ./betterproto2
run: uv run poe test
run: uv run poe test-lib


- name: Add Pydantic
working-directory: ./betterproto2
run: uv sync --locked --extra=pydantic

- name: Execute test suite
working-directory: ./betterproto2
run: uv run poe test
run: uv run poe test-lib


- name: Add all but Pydantic
working-directory: ./betterproto2
run: uv sync --locked --extra=grpclib --extra=grpcio --extra=protobuf

- name: Execute test suite
working-directory: ./betterproto2
run: uv run poe test
run: uv run poe test-lib


- name: Add grpclib
working-directory: ./betterproto2
run: uv sync --locked --extra=grpclib

- name: Execute test suite
working-directory: ./betterproto2
run: uv run poe test
run: uv run poe test-lib


- name: Add all but grpclib
working-directory: ./betterproto2
run: uv sync --locked --extra=pydantic --extra=grpcio --extra=protobuf

- name: Execute test suite
working-directory: ./betterproto2
run: uv run poe test
run: uv run poe test-lib


- name: Add grpcio
working-directory: ./betterproto2
run: uv sync --locked --extra=grpcio

- name: Execute test suite
working-directory: ./betterproto2
run: uv run poe test
run: uv run poe test-lib


- name: Add all but grpcio
working-directory: ./betterproto2
run: uv sync --locked --extra=pydantic --extra=grpclib --extra=protobuf

- name: Execute test suite
working-directory: ./betterproto2
run: uv run poe test
run: uv run poe test-lib


- name: Add protobuf
working-directory: ./betterproto2
run: uv sync --locked --extra=protobuf

- name: Execute test suite
working-directory: ./betterproto2
run: uv run poe test
run: uv run poe test-lib


- name: Add all but protobuf
working-directory: ./betterproto2
run: uv sync --locked --extra=pydantic --extra=grpclib --extra=grpcio

- name: Execute test suite
working-directory: ./betterproto2
run: uv run poe test
run: uv run poe test-lib

tests:
name: ${{ matrix.os }} / ${{ matrix.python-version }}
Expand All @@ -129,19 +118,16 @@ jobs:
run: uv sync --locked --all-extras --all-groups

- name: Test betterproto2_compiler
working-directory: ./betterproto2_compiler
shell: bash
run: uv run poe test
run: uv run poe test-plugin

- name: Compile test files
working-directory: ./betterproto2_compiler
shell: bash
run: uv run poe generate
run: uv run poe generate-plugin

- name: Execute test suite
working-directory: ./betterproto2
shell: bash
run: uv run poe test
run: uv run poe test-lib

# Run conformance test on all Ubuntu and MacOS versions
- name: Install Node.js
Expand Down
28 changes: 9 additions & 19 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,16 @@ jobs:
run: uv sync --locked --all-extras --all-groups

- name: Check formatting and linting (betterproto2)
working-directory: ./betterproto2
shell: bash
run: uv run poe check
run: uv run poe check-lib

- name: Check formatting and linting (betterproto2_compiler)
working-directory: ./betterproto2_compiler
shell: bash
run: uv run poe check
run: uv run poe check-plugin

- name: Check proto formatting
working-directory: ./betterproto2_compiler
shell: bash
run: uv run poe check-proto

- name: Pyright
working-directory: ./betterproto2
shell: bash
run: uv run poe typecheck

- name: Pyright
working-directory: ./betterproto2_compiler
shell: bash
run: uv run poe typecheck
run: uv run poe check-proto-plugin

- name: Pyright (betterproto2)
run: uv run poe typecheck-lib

- name: Pyright (betterproto2_compiler)
run: uv run poe typecheck-plugin
48 changes: 0 additions & 48 deletions betterproto2/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,51 +82,3 @@ python_files = "test_*.py"
python_classes = ""
norecursedirs = "**/output_*"
addopts = "-p no:warnings"

[tool.poe.tasks.test]
cmd = "pytest"
help = "Run tests"

[tool.poe.tasks.test-cov]
cmd = "pytest --cov=betterproto2 --cov-report=term --cov-report=html tests/"
help = "Run tests with code coverage report"

[tool.poe.tasks.typecheck]
cmd = "pyright src"
help = "Typecheck the code with Pyright"

[tool.poe.tasks.format]
sequence = ["_format", "_sort-imports"]
help = "Format the source code, and sort the imports"

[tool.poe.tasks.check]
sequence = ["_check-format", "_check"]
help = "Check that the source code is formatted and the imports sorted"

[tool.poe.tasks._format]
cmd = "ruff format src tests"
help = "Format the source code without sorting the imports"

[tool.poe.tasks._sort-imports]
cmd = "ruff check --select I --fix src tests"
help = "Sort the imports"

[tool.poe.tasks._check-format]
cmd = "ruff format --diff src tests"
help = "Check that the source code is formatted"

[tool.poe.tasks._check]
cmd = "ruff check src tests"
help = "Check the code"

[tool.poe.tasks.clean]
cmd = """
rm -rf .coverage .mypy_cache .pytest_cache
dist betterproto.egg-info **/__pycache__
testsoutput_*
"""
help = "Clean out generated files from the workspace"

[tool.poe.tasks.serve-docs]
cmd = "mkdocs serve"
help = "Serve the documentation locally"
102 changes: 0 additions & 102 deletions betterproto2_compiler/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,105 +76,3 @@ select = [

[tool.ruff.lint.isort]
combine-as-imports = true

[tool.poe.tasks.test]
cmd = "pytest"
help = "Run tests"

[tool.poe.tasks.generate]
# sequence = ["_generate_tests", "_generate_tests_lib"]
sequence = ["_generate_tests"]
help = "Generate test cases"

[tool.poe.tasks._generate_tests]
script = "tests.generate:main"

[tool.poe.tasks._generate_tests_lib]
shell = """
python -m grpc.tools.protoc \
--python_betterproto2_out=tests/output_betterproto \
google/protobuf/any.proto \
google/protobuf/api.proto \
google/protobuf/duration.proto \
google/protobuf/empty.proto \
google/protobuf/field_mask.proto \
google/protobuf/source_context.proto \
google/protobuf/struct.proto \
google/protobuf/timestamp.proto \
google/protobuf/type.proto \
google/protobuf/wrappers.proto

python -m grpc.tools.protoc \
--python_betterproto2_out=tests/output_betterproto_pydantic \
--python_betterproto2_opt=pydantic_dataclasses \
google/protobuf/any.proto \
google/protobuf/api.proto \
google/protobuf/duration.proto \
google/protobuf/empty.proto \
google/protobuf/field_mask.proto \
google/protobuf/source_context.proto \
google/protobuf/struct.proto \
google/protobuf/timestamp.proto \
google/protobuf/type.proto \
google/protobuf/wrappers.proto

python -m grpc.tools.protoc \
--python_betterproto2_out=tests/output_betterproto_descriptor \
--python_betterproto2_opt=google_protobuf_descriptors \
google/protobuf/any.proto \
google/protobuf/api.proto \
google/protobuf/duration.proto \
google/protobuf/empty.proto \
google/protobuf/field_mask.proto \
google/protobuf/source_context.proto \
google/protobuf/struct.proto \
google/protobuf/timestamp.proto \
google/protobuf/type.proto \
google/protobuf/wrappers.proto
"""

[tool.poe.tasks.typecheck]
cmd = "pyright src"
help = "Typecheck the code with Pyright"

[tool.poe.tasks.format]
sequence = ["_format", "_sort-imports"]
help = "Format the source code, and sort the imports"

[tool.poe.tasks.check]
sequence = ["_check-format", "_check-ruff-lint"]
help = "Check that the source code is formatted and the code passes the linter"

[tool.poe.tasks._format]
cmd = "ruff format src tests"
help = "Format the source code without sorting the imports"

[tool.poe.tasks._sort-imports]
cmd = "ruff check --select I --fix src tests"
help = "Sort the imports"

[tool.poe.tasks._check-format]
cmd = "ruff format --diff src tests"
help = "Check that the source code is formatted"

[tool.poe.tasks._check-ruff-lint]
cmd = "ruff check src tests"
help = "Check the code with the Ruff linter"

[tool.poe.tasks.check-proto]
cmd = "buf format --exit-code tests/inputs"
help = "Check that .proto files are formatted"

# python -m grpc.tools.protoc \
# --python_betterproto2_out=src/lib2 \
# google/protobuf/any.proto \
# google/protobuf/api.proto \
# google/protobuf/duration.proto \
# google/protobuf/empty.proto \
# google/protobuf/field_mask.proto \
# google/protobuf/source_context.proto \
# google/protobuf/struct.proto \
# google/protobuf/timestamp.proto \
# google/protobuf/type.proto \
# google/protobuf/wrappers.proto \
# google/protobuf/compiler/plugin.proto
Loading
Loading