Skip to content

Commit ef8acd6

Browse files
authored
Merge pull request #3 from aserto-dev/gen-v3
Use remote plugin to generate typing stubs
2 parents 42c6d6d + 9516eba commit ef8acd6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+3401
-6245
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ __pycache__
77
.pytest_cache
88
.vscode
99
.coverage
10+
.python-version

buf/buf.gen.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins:
66
out: ./src
77
- plugin: buf.build/protocolbuffers/python
88
out: ./src
9-
- name: "mypy"
9+
- plugin: buf.build/protocolbuffers/pyi
1010
out: "./src"
11-
- name: "mypy_grpc"
11+
- plugin: "buf.build/community/nipunn1313-mypy-grpc"
1212
out: "./src"

init_gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __init__(self):
9090
self._in_const: bool = False
9191

9292
def visit_ClassDef(self, node: ast.ClassDef):
93-
if self.is_public(node.name):
93+
if self.is_public(node.name) and not node.name.endswith("AsyncStub"):
9494
self.symbols.append(node.name)
9595

9696
def is_public(self, name: str) -> bool:

magefiles/magefile.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ func gen(bufImage, fileSources string) error {
9999
for bufImage, clientFiles := range files {
100100
err = buf.Run(
101101
buf.AddArg("generate"),
102+
buf.AddArg("--include-imports"),
102103
buf.AddArg("--template"),
103104
buf.AddArg(filepath.Join("buf", "buf.gen.yaml")),
104105
buf.AddArg(bufImage),

poetry.lock

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

pyproject.toml

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,21 @@ classifiers = [
2525
]
2626
packages = [
2727
{ include = "aserto", from = "src" },
28+
{ include = "google", from = "src" },
29+
{ include = "buf", from = "src" },
2830
]
2931

3032

3133
[tool.poetry.dependencies]
32-
python = ">=3.8"
34+
python = ">=3.8,<4"
35+
grpcio = "^1.49"
36+
protobuf = "^4.21.0"
37+
protovalidate = { version = "^0.3.0", python = ">=3.11"}
3338

3439
[tool.poetry.dev-dependencies]
35-
mypy = "^1.6.1"
36-
mypy-protobuf = "^3.5.0"
37-
black = "^23.10.1"
38-
isort = "^5.10.1"
39-
40-
[tool.mypy]
41-
show_error_codes = true
42-
check_untyped_defs = false
43-
disallow_any_decorated = false
44-
disallow_any_explicit = false
45-
disallow_any_expr = false
46-
disallow_any_generics = false
47-
disallow_any_unimported = true
48-
disallow_incomplete_defs = true
49-
disallow_subclassing_any = true
50-
disallow_untyped_calls = true
51-
disallow_untyped_decorators = true
52-
disallow_untyped_defs = true
53-
implicit_reexport = true
54-
no_implicit_optional = true
55-
strict_equality = true
56-
strict_optional = false
57-
warn_no_return = true
58-
warn_redundant_casts = true
59-
warn_return_any = true
60-
warn_unreachable = true
61-
warn_unused_ignores = true
40+
black = "^23.11.0"
41+
isort = "^5.10.0"
42+
pyright = "^1.1.0"
6243

6344
[build-system]
6445
requires = ["poetry-core>=1.0.0"]

src/aserto/directory/common/v2/common_pb2.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)