reproto 0.0.3__py3-none-any.whl → 0.0.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. .git/COMMIT_EDITMSG +24 -0
  2. .git/HEAD +1 -0
  3. .git/config +15 -0
  4. .git/description +1 -0
  5. .git/hooks/applypatch-msg.sample +15 -0
  6. .git/hooks/commit-msg.sample +24 -0
  7. .git/hooks/fsmonitor-watchman.sample +174 -0
  8. .git/hooks/post-update.sample +8 -0
  9. .git/hooks/pre-applypatch.sample +14 -0
  10. .git/hooks/pre-commit.sample +49 -0
  11. .git/hooks/pre-merge-commit.sample +13 -0
  12. .git/hooks/pre-push.sample +53 -0
  13. .git/hooks/pre-rebase.sample +169 -0
  14. .git/hooks/pre-receive.sample +24 -0
  15. .git/hooks/prepare-commit-msg.sample +42 -0
  16. .git/hooks/push-to-checkout.sample +78 -0
  17. .git/hooks/sendemail-validate.sample +77 -0
  18. .git/hooks/update.sample +128 -0
  19. .git/index +0 -0
  20. .git/info/exclude +6 -0
  21. .git/logs/HEAD +2 -0
  22. .git/logs/refs/heads/iyue +2 -0
  23. .git/logs/refs/remotes/gitlab/iyue +1 -0
  24. .git/logs/refs/remotes/origin/HEAD +1 -0
  25. .git/logs/refs/remotes/origin/iyue +1 -0
  26. .git/objects/09/a92517fe9eeb33d2fd7c979e01d163665f7abc +0 -0
  27. .git/objects/14/d323d58fb90c209a730c17e23fd82a6c735fc1 +0 -0
  28. .git/objects/23/bfbca38e177bcbb423dd782c35b19d127a5ab0 +0 -0
  29. .git/objects/48/369b05749e384be9be58e5f943f3a0040d0f37 +0 -0
  30. .git/objects/7c/00eec7ae9ef5f94fc337e5c8f9793a2a48810d +0 -0
  31. .git/objects/a3/cedc28e563a1845a7860161b39b0fe58d5f0d3 +0 -0
  32. .git/objects/d0/9c84ad2142a187bf26a1714b7041b62e404c8f +0 -0
  33. .git/objects/d9/6d7456245232b3e159dcf691f11e51224c557a +0 -0
  34. .git/objects/ed/fb5bbf938de738d1f658f80e23c675bb8b3fae +0 -0
  35. .git/objects/ef/4844af55f7f64b8dd24b81b5a8322a8c80208e +0 -0
  36. .git/objects/f2/2bfffda9fb6a7f37bed04b7c40c9466ef09454 +0 -0
  37. .git/objects/pack/pack-289f7bb06603881c49190e6036de6390223baf77.idx +0 -0
  38. .git/objects/pack/pack-289f7bb06603881c49190e6036de6390223baf77.pack +0 -0
  39. .git/objects/pack/pack-289f7bb06603881c49190e6036de6390223baf77.rev +0 -0
  40. .git/packed-refs +2 -0
  41. .git/refs/heads/iyue +1 -0
  42. .git/refs/remotes/gitlab/iyue +1 -0
  43. .git/refs/remotes/origin/HEAD +1 -0
  44. .git/refs/remotes/origin/iyue +1 -0
  45. .gitignore +142 -0
  46. .python-version +1 -0
  47. ARCHITECTURE.md +266 -0
  48. README.md +231 -0
  49. core/info_decoder.py +332 -10
  50. core/reconstructor.py +107 -3
  51. generation/proto_generator.py +34 -0
  52. main.py +172 -0
  53. parsing/enum_parser.py +4 -4
  54. parsing/java_parser.py +101 -1
  55. pyproject.toml +36 -0
  56. {reproto-0.0.3.dist-info → reproto-0.0.5.dist-info}/METADATA +1 -1
  57. reproto-0.0.5.dist-info/RECORD +69 -0
  58. requirements.txt +3 -0
  59. reproto-0.0.3.dist-info/RECORD +0 -18
  60. {reproto-0.0.3.dist-info → reproto-0.0.5.dist-info}/WHEEL +0 -0
  61. {reproto-0.0.3.dist-info → reproto-0.0.5.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,78 @@
1
+ #!/bin/sh
2
+
3
+ # An example hook script to update a checked-out tree on a git push.
4
+ #
5
+ # This hook is invoked by git-receive-pack(1) when it reacts to git
6
+ # push and updates reference(s) in its repository, and when the push
7
+ # tries to update the branch that is currently checked out and the
8
+ # receive.denyCurrentBranch configuration variable is set to
9
+ # updateInstead.
10
+ #
11
+ # By default, such a push is refused if the working tree and the index
12
+ # of the remote repository has any difference from the currently
13
+ # checked out commit; when both the working tree and the index match
14
+ # the current commit, they are updated to match the newly pushed tip
15
+ # of the branch. This hook is to be used to override the default
16
+ # behaviour; however the code below reimplements the default behaviour
17
+ # as a starting point for convenient modification.
18
+ #
19
+ # The hook receives the commit with which the tip of the current
20
+ # branch is going to be updated:
21
+ commit=$1
22
+
23
+ # It can exit with a non-zero status to refuse the push (when it does
24
+ # so, it must not modify the index or the working tree).
25
+ die () {
26
+ echo >&2 "$*"
27
+ exit 1
28
+ }
29
+
30
+ # Or it can make any necessary changes to the working tree and to the
31
+ # index to bring them to the desired state when the tip of the current
32
+ # branch is updated to the new commit, and exit with a zero status.
33
+ #
34
+ # For example, the hook can simply run git read-tree -u -m HEAD "$1"
35
+ # in order to emulate git fetch that is run in the reverse direction
36
+ # with git push, as the two-tree form of git read-tree -u -m is
37
+ # essentially the same as git switch or git checkout that switches
38
+ # branches while keeping the local changes in the working tree that do
39
+ # not interfere with the difference between the branches.
40
+
41
+ # The below is a more-or-less exact translation to shell of the C code
42
+ # for the default behaviour for git's push-to-checkout hook defined in
43
+ # the push_to_deploy() function in builtin/receive-pack.c.
44
+ #
45
+ # Note that the hook will be executed from the repository directory,
46
+ # not from the working tree, so if you want to perform operations on
47
+ # the working tree, you will have to adapt your code accordingly, e.g.
48
+ # by adding "cd .." or using relative paths.
49
+
50
+ if ! git update-index -q --ignore-submodules --refresh
51
+ then
52
+ die "Up-to-date check failed"
53
+ fi
54
+
55
+ if ! git diff-files --quiet --ignore-submodules --
56
+ then
57
+ die "Working directory has unstaged changes"
58
+ fi
59
+
60
+ # This is a rough translation of:
61
+ #
62
+ # head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX
63
+ if git cat-file -e HEAD 2>/dev/null
64
+ then
65
+ head=HEAD
66
+ else
67
+ head=$(git hash-object -t tree --stdin </dev/null)
68
+ fi
69
+
70
+ if ! git diff-index --quiet --cached --ignore-submodules $head --
71
+ then
72
+ die "Working directory has staged changes"
73
+ fi
74
+
75
+ if ! git read-tree -u -m "$commit"
76
+ then
77
+ die "Could not update working tree to new HEAD"
78
+ fi
@@ -0,0 +1,77 @@
1
+ #!/bin/sh
2
+
3
+ # An example hook script to validate a patch (and/or patch series) before
4
+ # sending it via email.
5
+ #
6
+ # The hook should exit with non-zero status after issuing an appropriate
7
+ # message if it wants to prevent the email(s) from being sent.
8
+ #
9
+ # To enable this hook, rename this file to "sendemail-validate".
10
+ #
11
+ # By default, it will only check that the patch(es) can be applied on top of
12
+ # the default upstream branch without conflicts in a secondary worktree. After
13
+ # validation (successful or not) of the last patch of a series, the worktree
14
+ # will be deleted.
15
+ #
16
+ # The following config variables can be set to change the default remote and
17
+ # remote ref that are used to apply the patches against:
18
+ #
19
+ # sendemail.validateRemote (default: origin)
20
+ # sendemail.validateRemoteRef (default: HEAD)
21
+ #
22
+ # Replace the TODO placeholders with appropriate checks according to your
23
+ # needs.
24
+
25
+ validate_cover_letter () {
26
+ file="$1"
27
+ # TODO: Replace with appropriate checks (e.g. spell checking).
28
+ true
29
+ }
30
+
31
+ validate_patch () {
32
+ file="$1"
33
+ # Ensure that the patch applies without conflicts.
34
+ git am -3 "$file" || return
35
+ # TODO: Replace with appropriate checks for this patch
36
+ # (e.g. checkpatch.pl).
37
+ true
38
+ }
39
+
40
+ validate_series () {
41
+ # TODO: Replace with appropriate checks for the whole series
42
+ # (e.g. quick build, coding style checks, etc.).
43
+ true
44
+ }
45
+
46
+ # main -------------------------------------------------------------------------
47
+
48
+ if test "$GIT_SENDEMAIL_FILE_COUNTER" = 1
49
+ then
50
+ remote=$(git config --default origin --get sendemail.validateRemote) &&
51
+ ref=$(git config --default HEAD --get sendemail.validateRemoteRef) &&
52
+ worktree=$(mktemp --tmpdir -d sendemail-validate.XXXXXXX) &&
53
+ git worktree add -fd --checkout "$worktree" "refs/remotes/$remote/$ref" &&
54
+ git config --replace-all sendemail.validateWorktree "$worktree"
55
+ else
56
+ worktree=$(git config --get sendemail.validateWorktree)
57
+ fi || {
58
+ echo "sendemail-validate: error: failed to prepare worktree" >&2
59
+ exit 1
60
+ }
61
+
62
+ unset GIT_DIR GIT_WORK_TREE
63
+ cd "$worktree" &&
64
+
65
+ if grep -q "^diff --git " "$1"
66
+ then
67
+ validate_patch "$1"
68
+ else
69
+ validate_cover_letter "$1"
70
+ fi &&
71
+
72
+ if test "$GIT_SENDEMAIL_FILE_COUNTER" = "$GIT_SENDEMAIL_FILE_TOTAL"
73
+ then
74
+ git config --unset-all sendemail.validateWorktree &&
75
+ trap 'git worktree remove -ff "$worktree"' EXIT &&
76
+ validate_series
77
+ fi
@@ -0,0 +1,128 @@
1
+ #!/bin/sh
2
+ #
3
+ # An example hook script to block unannotated tags from entering.
4
+ # Called by "git receive-pack" with arguments: refname sha1-old sha1-new
5
+ #
6
+ # To enable this hook, rename this file to "update".
7
+ #
8
+ # Config
9
+ # ------
10
+ # hooks.allowunannotated
11
+ # This boolean sets whether unannotated tags will be allowed into the
12
+ # repository. By default they won't be.
13
+ # hooks.allowdeletetag
14
+ # This boolean sets whether deleting tags will be allowed in the
15
+ # repository. By default they won't be.
16
+ # hooks.allowmodifytag
17
+ # This boolean sets whether a tag may be modified after creation. By default
18
+ # it won't be.
19
+ # hooks.allowdeletebranch
20
+ # This boolean sets whether deleting branches will be allowed in the
21
+ # repository. By default they won't be.
22
+ # hooks.denycreatebranch
23
+ # This boolean sets whether remotely creating branches will be denied
24
+ # in the repository. By default this is allowed.
25
+ #
26
+
27
+ # --- Command line
28
+ refname="$1"
29
+ oldrev="$2"
30
+ newrev="$3"
31
+
32
+ # --- Safety check
33
+ if [ -z "$GIT_DIR" ]; then
34
+ echo "Don't run this script from the command line." >&2
35
+ echo " (if you want, you could supply GIT_DIR then run" >&2
36
+ echo " $0 <ref> <oldrev> <newrev>)" >&2
37
+ exit 1
38
+ fi
39
+
40
+ if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
41
+ echo "usage: $0 <ref> <oldrev> <newrev>" >&2
42
+ exit 1
43
+ fi
44
+
45
+ # --- Config
46
+ allowunannotated=$(git config --type=bool hooks.allowunannotated)
47
+ allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch)
48
+ denycreatebranch=$(git config --type=bool hooks.denycreatebranch)
49
+ allowdeletetag=$(git config --type=bool hooks.allowdeletetag)
50
+ allowmodifytag=$(git config --type=bool hooks.allowmodifytag)
51
+
52
+ # check for no description
53
+ projectdesc=$(sed -e '1q' "$GIT_DIR/description")
54
+ case "$projectdesc" in
55
+ "Unnamed repository"* | "")
56
+ echo "*** Project description file hasn't been set" >&2
57
+ exit 1
58
+ ;;
59
+ esac
60
+
61
+ # --- Check types
62
+ # if $newrev is 0000...0000, it's a commit to delete a ref.
63
+ zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
64
+ if [ "$newrev" = "$zero" ]; then
65
+ newrev_type=delete
66
+ else
67
+ newrev_type=$(git cat-file -t $newrev)
68
+ fi
69
+
70
+ case "$refname","$newrev_type" in
71
+ refs/tags/*,commit)
72
+ # un-annotated tag
73
+ short_refname=${refname##refs/tags/}
74
+ if [ "$allowunannotated" != "true" ]; then
75
+ echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
76
+ echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
77
+ exit 1
78
+ fi
79
+ ;;
80
+ refs/tags/*,delete)
81
+ # delete tag
82
+ if [ "$allowdeletetag" != "true" ]; then
83
+ echo "*** Deleting a tag is not allowed in this repository" >&2
84
+ exit 1
85
+ fi
86
+ ;;
87
+ refs/tags/*,tag)
88
+ # annotated tag
89
+ if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1
90
+ then
91
+ echo "*** Tag '$refname' already exists." >&2
92
+ echo "*** Modifying a tag is not allowed in this repository." >&2
93
+ exit 1
94
+ fi
95
+ ;;
96
+ refs/heads/*,commit)
97
+ # branch
98
+ if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then
99
+ echo "*** Creating a branch is not allowed in this repository" >&2
100
+ exit 1
101
+ fi
102
+ ;;
103
+ refs/heads/*,delete)
104
+ # delete branch
105
+ if [ "$allowdeletebranch" != "true" ]; then
106
+ echo "*** Deleting a branch is not allowed in this repository" >&2
107
+ exit 1
108
+ fi
109
+ ;;
110
+ refs/remotes/*,commit)
111
+ # tracking branch
112
+ ;;
113
+ refs/remotes/*,delete)
114
+ # delete tracking branch
115
+ if [ "$allowdeletebranch" != "true" ]; then
116
+ echo "*** Deleting a tracking branch is not allowed in this repository" >&2
117
+ exit 1
118
+ fi
119
+ ;;
120
+ *)
121
+ # Anything else (is there anything else?)
122
+ echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
123
+ exit 1
124
+ ;;
125
+ esac
126
+
127
+ # --- Finished
128
+ exit 0
.git/index ADDED
Binary file
.git/info/exclude ADDED
@@ -0,0 +1,6 @@
1
+ # git ls-files --others --exclude-from=.git/info/exclude
2
+ # Lines that start with '#' are comments.
3
+ # For a project mostly in C, the following would be a good set of
4
+ # exclude patterns (uncomment them if you want to use them):
5
+ # *.[oa]
6
+ # *~
.git/logs/HEAD ADDED
@@ -0,0 +1,2 @@
1
+ 0000000000000000000000000000000000000000 2e11d561668286f3d6d48f399ffab1943a5cdcb2 iyue <ys1231@126.com> 1750922365 +0800 clone: from github.com:ys1231/reproto.git
2
+ 2e11d561668286f3d6d48f399ffab1943a5cdcb2 f22bfffda9fb6a7f37bed04b7c40c9466ef09454 iyue <ys1231@126.com> 1750925875 +0800 commit: feat: 完善Protobuf类型推断系统,支持map和未知类型处理
@@ -0,0 +1,2 @@
1
+ 0000000000000000000000000000000000000000 2e11d561668286f3d6d48f399ffab1943a5cdcb2 iyue <ys1231@126.com> 1750922365 +0800 clone: from github.com:ys1231/reproto.git
2
+ 2e11d561668286f3d6d48f399ffab1943a5cdcb2 f22bfffda9fb6a7f37bed04b7c40c9466ef09454 iyue <ys1231@126.com> 1750925875 +0800 commit: feat: 完善Protobuf类型推断系统,支持map和未知类型处理
@@ -0,0 +1 @@
1
+ 0000000000000000000000000000000000000000 f22bfffda9fb6a7f37bed04b7c40c9466ef09454 iyue <ys1231@126.com> 1750926057 +0800 update by push
@@ -0,0 +1 @@
1
+ 0000000000000000000000000000000000000000 2e11d561668286f3d6d48f399ffab1943a5cdcb2 iyue <ys1231@126.com> 1750922365 +0800 clone: from github.com:ys1231/reproto.git
@@ -0,0 +1 @@
1
+ 2e11d561668286f3d6d48f399ffab1943a5cdcb2 f22bfffda9fb6a7f37bed04b7c40c9466ef09454 iyue <ys1231@126.com> 1750925918 +0800 update by push
.git/packed-refs ADDED
@@ -0,0 +1,2 @@
1
+ # pack-refs with: peeled fully-peeled sorted
2
+ 2e11d561668286f3d6d48f399ffab1943a5cdcb2 refs/remotes/origin/iyue
.git/refs/heads/iyue ADDED
@@ -0,0 +1 @@
1
+ f22bfffda9fb6a7f37bed04b7c40c9466ef09454
@@ -0,0 +1 @@
1
+ f22bfffda9fb6a7f37bed04b7c40c9466ef09454
@@ -0,0 +1 @@
1
+ ref: refs/remotes/origin/iyue
@@ -0,0 +1 @@
1
+ f22bfffda9fb6a7f37bed04b7c40c9466ef09454
.gitignore ADDED
@@ -0,0 +1,142 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
98
+ __pypackages__/
99
+
100
+ # Celery stuff
101
+ celerybeat-schedule
102
+ celerybeat.pid
103
+
104
+ # SageMath parsed files
105
+ *.sage.py
106
+
107
+ # Environments
108
+ .env
109
+ .venv
110
+ env/
111
+ venv/
112
+ ENV/
113
+ env.bak/
114
+ venv.bak/
115
+
116
+ # Spyder project settings
117
+ .spyderproject
118
+ .spyproject
119
+
120
+ # Rope project settings
121
+ .ropeproject
122
+
123
+ # mkdocs documentation
124
+ /site
125
+
126
+ # mypy
127
+ .mypy_cache/
128
+ .dmypy.json
129
+ dmypy.json
130
+
131
+ # Pyre type checker
132
+ .pyre/
133
+
134
+ # pytype static type analyzer
135
+ .pytype/
136
+
137
+ # Cython debug symbols
138
+ cython_debug/
139
+ .vscode
140
+ .idea
141
+ poetry.lock
142
+ uv.lock
.python-version ADDED
@@ -0,0 +1 @@
1
+ 3.13.0