From 1ef5a549f63e1fb378a4612e1dc92106bb8d74b2 Mon Sep 17 00:00:00 2001 From: Charles OuGuo Date: Mon, 26 Feb 2024 20:43:27 -0500 Subject: [PATCH] Add README (#13) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- README.md | 5 +++++ src/__init__.py | 0 src/python/__init__.py | 0 src/python/py_proto/proto_enum.py | 12 ++++++++++-- src/python/py_proto/proto_extend.py | 6 +++++- src/python/py_proto/proto_file.py | 7 ++++++- src/python/py_proto/proto_map.py | 10 ++++++++-- src/python/py_proto/proto_message.py | 12 ++++++++++-- src/python/py_proto/proto_message_field.py | 10 ++++++++-- src/python/py_proto/proto_oneof.py | 17 ++++++++++++++--- src/python/py_proto/proto_service.py | 6 +++++- src/python/py_proto/test/proto_comment_test.py | 5 ++++- src/python/py_proto/test/proto_enum_test.py | 5 ++++- src/python/py_proto/test/proto_extend_test.py | 10 ++++++++-- src/python/py_proto/test/proto_map_test.py | 6 +++++- src/python/py_proto/test/proto_message_test.py | 17 ++++++++++++++--- src/python/py_proto/test/proto_oneof_test.py | 6 +++++- src/python/py_proto/test/proto_service_test.py | 5 ++++- src/python/py_proto/test/util/BUILD.bazel | 4 ++-- src/python/py_proto/test/util/parser_test.py | 6 +++++- 20 files changed, 122 insertions(+), 27 deletions(-) create mode 100644 README.md create mode 100644 src/__init__.py create mode 100644 src/python/__init__.py diff --git a/README.md b/README.md new file mode 100644 index 00000000..fa134d89 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# monorepo + +[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/shaldengeki/monorepo/main.svg)](https://results.pre-commit.ci/latest/github/shaldengeki/monorepo/main) [![Test](https://github.com/shaldengeki/monorepo/actions/workflows/main.yml/badge.svg)](https://github.com/shaldengeki/monorepo/actions/workflows/main.yml) + +I'm taking a stab at monorepoing my projects. More to come! diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/python/__init__.py b/src/python/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/python/py_proto/proto_enum.py b/src/python/py_proto/proto_enum.py index 44e8a565..30abb44b 100644 --- a/src/python/py_proto/proto_enum.py +++ b/src/python/py_proto/proto_enum.py @@ -5,9 +5,17 @@ ProtoMultiLineComment, ProtoSingleLineComment, ) -from src.python.py_proto.proto_identifier import ParsedProtoIdentifierNode, ProtoIdentifier +from src.python.py_proto.proto_identifier import ( + ParsedProtoIdentifierNode, + ProtoIdentifier, +) from src.python.py_proto.proto_int import ProtoInt, ProtoIntSign -from src.python.py_proto.proto_node import ParsedProtoNode, ProtoContainerNode, ProtoNode, ProtoNodeDiff +from src.python.py_proto.proto_node import ( + ParsedProtoNode, + ProtoContainerNode, + ProtoNode, + ProtoNodeDiff, +) from src.python.py_proto.proto_option import ParsedProtoOptionNode, ProtoOption from src.python.py_proto.proto_reserved import ProtoReserved diff --git a/src/python/py_proto/proto_extend.py b/src/python/py_proto/proto_extend.py index 2f3af1fd..497a24df 100644 --- a/src/python/py_proto/proto_extend.py +++ b/src/python/py_proto/proto_extend.py @@ -10,7 +10,11 @@ ProtoEnumOrMessageIdentifier, ) from src.python.py_proto.proto_message_field import ProtoMessageField -from src.python.py_proto.proto_node import ParsedProtoNode, ProtoContainerNode, ProtoNode +from src.python.py_proto.proto_node import ( + ParsedProtoNode, + ProtoContainerNode, + ProtoNode, +) class ProtoExtend(ProtoContainerNode): diff --git a/src/python/py_proto/proto_file.py b/src/python/py_proto/proto_file.py index 0aa5d725..af5c3e78 100644 --- a/src/python/py_proto/proto_file.py +++ b/src/python/py_proto/proto_file.py @@ -9,7 +9,12 @@ from src.python.py_proto.proto_extend import ProtoExtend from src.python.py_proto.proto_import import ProtoImport from src.python.py_proto.proto_message import ProtoMessage -from src.python.py_proto.proto_node import ParsedProtoNode, ProtoContainerNode, ProtoNode, ProtoNodeDiff +from src.python.py_proto.proto_node import ( + ParsedProtoNode, + ProtoContainerNode, + ProtoNode, + ProtoNodeDiff, +) from src.python.py_proto.proto_option import ProtoOption from src.python.py_proto.proto_package import ProtoPackage from src.python.py_proto.proto_service import ProtoService diff --git a/src/python/py_proto/proto_map.py b/src/python/py_proto/proto_map.py index 913e3452..e6c53806 100644 --- a/src/python/py_proto/proto_map.py +++ b/src/python/py_proto/proto_map.py @@ -1,9 +1,15 @@ from enum import Enum from typing import Optional, Sequence -from src.python.py_proto.proto_identifier import ProtoEnumOrMessageIdentifier, ProtoIdentifier +from src.python.py_proto.proto_identifier import ( + ProtoEnumOrMessageIdentifier, + ProtoIdentifier, +) from src.python.py_proto.proto_int import ProtoInt -from src.python.py_proto.proto_message_field import ProtoMessageFieldOption, ProtoMessageFieldTypesEnum +from src.python.py_proto.proto_message_field import ( + ProtoMessageFieldOption, + ProtoMessageFieldTypesEnum, +) from src.python.py_proto.proto_node import ParsedProtoNode, ProtoNode, ProtoNodeDiff diff --git a/src/python/py_proto/proto_message.py b/src/python/py_proto/proto_message.py index b1327405..c929cc3e 100644 --- a/src/python/py_proto/proto_message.py +++ b/src/python/py_proto/proto_message.py @@ -8,10 +8,18 @@ from src.python.py_proto.proto_enum import ProtoEnum from src.python.py_proto.proto_extend import ProtoExtend from src.python.py_proto.proto_extensions import ProtoExtensions -from src.python.py_proto.proto_identifier import ParsedProtoIdentifierNode, ProtoIdentifier +from src.python.py_proto.proto_identifier import ( + ParsedProtoIdentifierNode, + ProtoIdentifier, +) from src.python.py_proto.proto_map import ProtoMap from src.python.py_proto.proto_message_field import ProtoMessageField -from src.python.py_proto.proto_node import ParsedProtoNode, ProtoContainerNode, ProtoNode, ProtoNodeDiff +from src.python.py_proto.proto_node import ( + ParsedProtoNode, + ProtoContainerNode, + ProtoNode, + ProtoNodeDiff, +) from src.python.py_proto.proto_oneof import ProtoOneOf from src.python.py_proto.proto_option import ProtoOption from src.python.py_proto.proto_reserved import ProtoReserved diff --git a/src/python/py_proto/proto_message_field.py b/src/python/py_proto/proto_message_field.py index a389db65..77c0ca2b 100644 --- a/src/python/py_proto/proto_message_field.py +++ b/src/python/py_proto/proto_message_field.py @@ -1,8 +1,14 @@ from enum import Enum from typing import Optional, Sequence -from src.python.py_proto.proto_enum import ParsedProtoEnumValueOptionNode, ProtoEnumValueOption -from src.python.py_proto.proto_identifier import ProtoEnumOrMessageIdentifier, ProtoIdentifier +from src.python.py_proto.proto_enum import ( + ParsedProtoEnumValueOptionNode, + ProtoEnumValueOption, +) +from src.python.py_proto.proto_identifier import ( + ProtoEnumOrMessageIdentifier, + ProtoIdentifier, +) from src.python.py_proto.proto_int import ProtoInt from src.python.py_proto.proto_node import ParsedProtoNode, ProtoNode, ProtoNodeDiff diff --git a/src/python/py_proto/proto_oneof.py b/src/python/py_proto/proto_oneof.py index a385c097..2696e047 100644 --- a/src/python/py_proto/proto_oneof.py +++ b/src/python/py_proto/proto_oneof.py @@ -7,10 +7,21 @@ ProtoMultiLineComment, ProtoSingleLineComment, ) -from src.python.py_proto.proto_identifier import ParsedProtoIdentifierNode, ProtoIdentifier +from src.python.py_proto.proto_identifier import ( + ParsedProtoIdentifierNode, + ProtoIdentifier, +) from src.python.py_proto.proto_map import ProtoMap -from src.python.py_proto.proto_message_field import ParsedProtoMessageFieldNode, ProtoMessageField -from src.python.py_proto.proto_node import ParsedProtoNode, ProtoContainerNode, ProtoNode, ProtoNodeDiff +from src.python.py_proto.proto_message_field import ( + ParsedProtoMessageFieldNode, + ProtoMessageField, +) +from src.python.py_proto.proto_node import ( + ParsedProtoNode, + ProtoContainerNode, + ProtoNode, + ProtoNodeDiff, +) from src.python.py_proto.proto_option import ParsedProtoOptionNode, ProtoOption ProtoOneOfNodeTypes = ( diff --git a/src/python/py_proto/proto_service.py b/src/python/py_proto/proto_service.py index d8ae8f3b..20397f87 100644 --- a/src/python/py_proto/proto_service.py +++ b/src/python/py_proto/proto_service.py @@ -10,7 +10,11 @@ ProtoEnumOrMessageIdentifier, ProtoIdentifier, ) -from src.python.py_proto.proto_node import ParsedProtoNode, ProtoContainerNode, ProtoNode +from src.python.py_proto.proto_node import ( + ParsedProtoNode, + ProtoContainerNode, + ProtoNode, +) from src.python.py_proto.proto_option import ProtoOption diff --git a/src/python/py_proto/test/proto_comment_test.py b/src/python/py_proto/test/proto_comment_test.py index 1643b455..3d64c29a 100644 --- a/src/python/py_proto/test/proto_comment_test.py +++ b/src/python/py_proto/test/proto_comment_test.py @@ -1,6 +1,9 @@ import unittest -from src.python.py_proto.proto_comment import ProtoMultiLineComment, ProtoSingleLineComment +from src.python.py_proto.proto_comment import ( + ProtoMultiLineComment, + ProtoSingleLineComment, +) class ProtoSingleLineCommentTest(unittest.TestCase): diff --git a/src/python/py_proto/test/proto_enum_test.py b/src/python/py_proto/test/proto_enum_test.py index e56ea6ab..e9dc67f2 100644 --- a/src/python/py_proto/test/proto_enum_test.py +++ b/src/python/py_proto/test/proto_enum_test.py @@ -2,7 +2,10 @@ from textwrap import dedent from src.python.py_proto.proto_bool import ProtoBool -from src.python.py_proto.proto_comment import ProtoMultiLineComment, ProtoSingleLineComment +from src.python.py_proto.proto_comment import ( + ProtoMultiLineComment, + ProtoSingleLineComment, +) from src.python.py_proto.proto_constant import ProtoConstant from src.python.py_proto.proto_enum import ( ProtoEnum, diff --git a/src/python/py_proto/test/proto_extend_test.py b/src/python/py_proto/test/proto_extend_test.py index 9e9872a2..17b92470 100644 --- a/src/python/py_proto/test/proto_extend_test.py +++ b/src/python/py_proto/test/proto_extend_test.py @@ -2,9 +2,15 @@ from textwrap import dedent from src.python.py_proto.proto_extend import ProtoExtend -from src.python.py_proto.proto_identifier import ProtoEnumOrMessageIdentifier, ProtoIdentifier +from src.python.py_proto.proto_identifier import ( + ProtoEnumOrMessageIdentifier, + ProtoIdentifier, +) from src.python.py_proto.proto_int import ProtoInt, ProtoIntSign -from src.python.py_proto.proto_message_field import ProtoMessageField, ProtoMessageFieldTypesEnum +from src.python.py_proto.proto_message_field import ( + ProtoMessageField, + ProtoMessageFieldTypesEnum, +) class ExtendTest(unittest.TestCase): diff --git a/src/python/py_proto/test/proto_map_test.py b/src/python/py_proto/test/proto_map_test.py index 6b9ed569..bb5420b0 100644 --- a/src/python/py_proto/test/proto_map_test.py +++ b/src/python/py_proto/test/proto_map_test.py @@ -7,7 +7,11 @@ ProtoIdentifier, ) from src.python.py_proto.proto_int import ProtoInt, ProtoIntSign -from src.python.py_proto.proto_map import ProtoMap, ProtoMapKeyTypesEnum, ProtoMapValueTypesEnum +from src.python.py_proto.proto_map import ( + ProtoMap, + ProtoMapKeyTypesEnum, + ProtoMapValueTypesEnum, +) from src.python.py_proto.proto_message_field import ProtoMessageFieldOption from src.python.py_proto.proto_string_literal import ProtoStringLiteral diff --git a/src/python/py_proto/test/proto_message_test.py b/src/python/py_proto/test/proto_message_test.py index ea008393..06a313f1 100644 --- a/src/python/py_proto/test/proto_message_test.py +++ b/src/python/py_proto/test/proto_message_test.py @@ -2,7 +2,10 @@ from textwrap import dedent from src.python.py_proto.proto_bool import ProtoBool -from src.python.py_proto.proto_comment import ProtoMultiLineComment, ProtoSingleLineComment +from src.python.py_proto.proto_comment import ( + ProtoMultiLineComment, + ProtoSingleLineComment, +) from src.python.py_proto.proto_constant import ProtoConstant from src.python.py_proto.proto_enum import ProtoEnum, ProtoEnumValue from src.python.py_proto.proto_extend import ProtoExtend @@ -13,8 +16,16 @@ ProtoIdentifier, ) from src.python.py_proto.proto_int import ProtoInt, ProtoIntSign -from src.python.py_proto.proto_map import ProtoMap, ProtoMapKeyTypesEnum, ProtoMapValueTypesEnum -from src.python.py_proto.proto_message import ProtoMessage, ProtoMessageAdded, ProtoMessageRemoved +from src.python.py_proto.proto_map import ( + ProtoMap, + ProtoMapKeyTypesEnum, + ProtoMapValueTypesEnum, +) +from src.python.py_proto.proto_message import ( + ProtoMessage, + ProtoMessageAdded, + ProtoMessageRemoved, +) from src.python.py_proto.proto_message_field import ( ProtoMessageField, ProtoMessageFieldOption, diff --git a/src/python/py_proto/test/proto_oneof_test.py b/src/python/py_proto/test/proto_oneof_test.py index 33b63b2b..1020ac43 100644 --- a/src/python/py_proto/test/proto_oneof_test.py +++ b/src/python/py_proto/test/proto_oneof_test.py @@ -13,7 +13,11 @@ ProtoMessageFieldRemoved, ProtoMessageFieldTypesEnum, ) -from src.python.py_proto.proto_oneof import ProtoOneOf, ProtoOneOfAdded, ProtoOneOfRemoved +from src.python.py_proto.proto_oneof import ( + ProtoOneOf, + ProtoOneOfAdded, + ProtoOneOfRemoved, +) from src.python.py_proto.proto_option import ProtoOption from src.python.py_proto.proto_string_literal import ProtoStringLiteral diff --git a/src/python/py_proto/test/proto_service_test.py b/src/python/py_proto/test/proto_service_test.py index 1f9a63a8..bee6faf9 100644 --- a/src/python/py_proto/test/proto_service_test.py +++ b/src/python/py_proto/test/proto_service_test.py @@ -2,7 +2,10 @@ from textwrap import dedent from src.python.py_proto.proto_bool import ProtoBool -from src.python.py_proto.proto_comment import ProtoMultiLineComment, ProtoSingleLineComment +from src.python.py_proto.proto_comment import ( + ProtoMultiLineComment, + ProtoSingleLineComment, +) from src.python.py_proto.proto_constant import ProtoConstant from src.python.py_proto.proto_identifier import ( ProtoEnumOrMessageIdentifier, diff --git a/src/python/py_proto/test/util/BUILD.bazel b/src/python/py_proto/test/util/BUILD.bazel index 43c69b02..82d84e21 100644 --- a/src/python/py_proto/test/util/BUILD.bazel +++ b/src/python/py_proto/test/util/BUILD.bazel @@ -28,8 +28,8 @@ sh_test( name = "parser_binary_test", srcs = ["parser_binary_test.sh"], data = [ - "//src/python/py_proto/util:parser_binary", "//src/python/py_proto/test/resources:all_protos", + "//src/python/py_proto/util:parser_binary", "@com_google_protobuf//:all_proto", ], ) @@ -38,7 +38,7 @@ sh_test( name = "compatibility_checker_binary_test", srcs = ["compatibility_checker_binary_test.sh"], data = [ - "//src/python/py_proto/util:compatibility_checker_binary", "//src/python/py_proto/test/resources:all_protos", + "//src/python/py_proto/util:compatibility_checker_binary", ], ) diff --git a/src/python/py_proto/test/util/parser_test.py b/src/python/py_proto/test/util/parser_test.py index d8397cad..73574da4 100644 --- a/src/python/py_proto/test/util/parser_test.py +++ b/src/python/py_proto/test/util/parser_test.py @@ -15,7 +15,11 @@ ) from src.python.py_proto.proto_import import ProtoImport from src.python.py_proto.proto_int import ProtoInt, ProtoIntSign -from src.python.py_proto.proto_map import ProtoMap, ProtoMapKeyTypesEnum, ProtoMapValueTypesEnum +from src.python.py_proto.proto_map import ( + ProtoMap, + ProtoMapKeyTypesEnum, + ProtoMapValueTypesEnum, +) from src.python.py_proto.proto_message import ProtoMessage, ProtoOneOf from src.python.py_proto.proto_message_field import ( ProtoMessageField,