Misc cleanup, see commit body (#227)

- Enable oneof_enum test case that passes now (removed the xfail)
- Switch from toml to tomlkit as a dev dep for better toml support
- upgrade poethepoet to latest stable release
- use full table format for poe tasks to avoid long lines in pyproject.toml
- remove redundant _WrappedMessage class
- fix various Mypy warnings
- reformat some comments for consistent line length
This commit is contained in:
nat
2021-04-06 02:43:09 +02:00
committed by GitHub
parent 5b639c82b2
commit 95339bf74d
9 changed files with 140 additions and 120 deletions

View File

@@ -13,7 +13,7 @@ from betterproto.lib.google.protobuf.compiler import (
import itertools
import pathlib
import sys
from typing import Iterator, List, Tuple, TYPE_CHECKING, Union
from typing import Iterator, List, Set, Tuple, TYPE_CHECKING, Union
from .compiler import outputfile_compiler
from .models import (
EnumDefinitionCompiler,
@@ -38,7 +38,7 @@ def traverse(
) -> "itertools.chain[Tuple[Union[str, EnumDescriptorProto], List[int]]]":
# Todo: Keep information about nested hierarchy
def _traverse(
path: List[int], items: List["Descriptor"], prefix=""
path: List[int], items: List["EnumDescriptorProto"], prefix=""
) -> Iterator[Tuple[Union[str, EnumDescriptorProto], List[int]]]:
for i, item in enumerate(items):
# Adjust the name since we flatten the hierarchy.