plexus-python-protobuf-setup 1.0.2__tar.gz
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.
- plexus_python_protobuf_setup-1.0.2/.editorconfig +80 -0
- plexus_python_protobuf_setup-1.0.2/.github/workflows/pr.yml +31 -0
- plexus_python_protobuf_setup-1.0.2/.github/workflows/push.yml +37 -0
- plexus_python_protobuf_setup-1.0.2/.gitignore +187 -0
- plexus_python_protobuf_setup-1.0.2/MANIFEST.in +1 -0
- plexus_python_protobuf_setup-1.0.2/PKG-INFO +16 -0
- plexus_python_protobuf_setup-1.0.2/README.md +1 -0
- plexus_python_protobuf_setup-1.0.2/VERSION +1 -0
- plexus_python_protobuf_setup-1.0.2/pyproject.toml +61 -0
- plexus_python_protobuf_setup-1.0.2/setup.cfg +4 -0
- plexus_python_protobuf_setup-1.0.2/setup.py +13 -0
- plexus_python_protobuf_setup-1.0.2/src/plexus/protobuf/setup/__init__.py +68 -0
- plexus_python_protobuf_setup-1.0.2/src/plexus_python_protobuf_setup.egg-info/PKG-INFO +16 -0
- plexus_python_protobuf_setup-1.0.2/src/plexus_python_protobuf_setup.egg-info/SOURCES.txt +18 -0
- plexus_python_protobuf_setup-1.0.2/src/plexus_python_protobuf_setup.egg-info/dependency_links.txt +1 -0
- plexus_python_protobuf_setup-1.0.2/src/plexus_python_protobuf_setup.egg-info/not-zip-safe +1 -0
- plexus_python_protobuf_setup-1.0.2/src/plexus_python_protobuf_setup.egg-info/requires.txt +10 -0
- plexus_python_protobuf_setup-1.0.2/src/plexus_python_protobuf_setup.egg-info/top_level.txt +1 -0
- plexus_python_protobuf_setup-1.0.2/test/plexus_test.py +13 -0
- plexus_python_protobuf_setup-1.0.2/test/plexus_tests/__init__.py +15 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*.py]
|
|
4
|
+
charset = utf-8
|
|
5
|
+
end_of_line = lf
|
|
6
|
+
insert_final_newline = true
|
|
7
|
+
trim_trailing_whitespace = true
|
|
8
|
+
indent_style = space
|
|
9
|
+
indent_size = 4
|
|
10
|
+
|
|
11
|
+
ij_python_align_collections_and_comprehensions = true
|
|
12
|
+
ij_python_align_multiline_imports = true
|
|
13
|
+
ij_python_align_multiline_parameters = true
|
|
14
|
+
ij_python_align_multiline_parameters_in_calls = true
|
|
15
|
+
ij_python_blank_line_at_file_end = true
|
|
16
|
+
ij_python_blank_lines_after_imports = 1
|
|
17
|
+
ij_python_blank_lines_after_local_imports = 0
|
|
18
|
+
ij_python_blank_lines_around_class = 1
|
|
19
|
+
ij_python_blank_lines_around_method = 1
|
|
20
|
+
ij_python_blank_lines_around_top_level_classes_functions = 2
|
|
21
|
+
ij_python_blank_lines_before_first_method = 0
|
|
22
|
+
ij_python_call_parameters_new_line_after_left_paren = false
|
|
23
|
+
ij_python_call_parameters_right_paren_on_new_line = false
|
|
24
|
+
ij_python_call_parameters_wrap = normal
|
|
25
|
+
ij_python_dict_alignment = 0
|
|
26
|
+
ij_python_dict_new_line_after_left_brace = false
|
|
27
|
+
ij_python_dict_new_line_before_right_brace = false
|
|
28
|
+
ij_python_dict_wrapping = 1
|
|
29
|
+
ij_python_from_import_new_line_after_left_parenthesis = false
|
|
30
|
+
ij_python_from_import_new_line_before_right_parenthesis = false
|
|
31
|
+
ij_python_from_import_parentheses_force_if_multiline = false
|
|
32
|
+
ij_python_from_import_trailing_comma_if_multiline = false
|
|
33
|
+
ij_python_from_import_wrapping = 1
|
|
34
|
+
ij_python_hang_closing_brackets = false
|
|
35
|
+
ij_python_keep_blank_lines_in_code = 1
|
|
36
|
+
ij_python_keep_blank_lines_in_declarations = 1
|
|
37
|
+
ij_python_keep_indents_on_empty_lines = false
|
|
38
|
+
ij_python_keep_line_breaks = true
|
|
39
|
+
ij_python_method_parameters_new_line_after_left_paren = false
|
|
40
|
+
ij_python_method_parameters_right_paren_on_new_line = false
|
|
41
|
+
ij_python_method_parameters_wrap = normal
|
|
42
|
+
ij_python_new_line_after_colon = false
|
|
43
|
+
ij_python_new_line_after_colon_multi_clause = true
|
|
44
|
+
ij_python_optimize_imports_always_split_from_imports = false
|
|
45
|
+
ij_python_optimize_imports_case_insensitive_order = false
|
|
46
|
+
ij_python_optimize_imports_join_from_imports_with_same_source = false
|
|
47
|
+
ij_python_optimize_imports_sort_by_type_first = true
|
|
48
|
+
ij_python_optimize_imports_sort_imports = true
|
|
49
|
+
ij_python_optimize_imports_sort_names_in_from_imports = true
|
|
50
|
+
ij_python_space_after_comma = true
|
|
51
|
+
ij_python_space_after_number_sign = true
|
|
52
|
+
ij_python_space_after_py_colon = true
|
|
53
|
+
ij_python_space_before_backslash = true
|
|
54
|
+
ij_python_space_before_comma = false
|
|
55
|
+
ij_python_space_before_for_semicolon = false
|
|
56
|
+
ij_python_space_before_lbracket = false
|
|
57
|
+
ij_python_space_before_method_call_parentheses = false
|
|
58
|
+
ij_python_space_before_method_parentheses = false
|
|
59
|
+
ij_python_space_before_number_sign = true
|
|
60
|
+
ij_python_space_before_py_colon = false
|
|
61
|
+
ij_python_space_within_empty_method_call_parentheses = false
|
|
62
|
+
ij_python_space_within_empty_method_parentheses = false
|
|
63
|
+
ij_python_spaces_around_additive_operators = true
|
|
64
|
+
ij_python_spaces_around_assignment_operators = true
|
|
65
|
+
ij_python_spaces_around_bitwise_operators = true
|
|
66
|
+
ij_python_spaces_around_eq_in_keyword_argument = false
|
|
67
|
+
ij_python_spaces_around_eq_in_named_parameter = false
|
|
68
|
+
ij_python_spaces_around_equality_operators = true
|
|
69
|
+
ij_python_spaces_around_multiplicative_operators = true
|
|
70
|
+
ij_python_spaces_around_power_operator = true
|
|
71
|
+
ij_python_spaces_around_relational_operators = true
|
|
72
|
+
ij_python_spaces_around_shift_operators = true
|
|
73
|
+
ij_python_spaces_within_braces = false
|
|
74
|
+
ij_python_spaces_within_brackets = false
|
|
75
|
+
ij_python_spaces_within_method_call_parentheses = false
|
|
76
|
+
ij_python_spaces_within_method_parentheses = false
|
|
77
|
+
ij_python_use_continuation_indent_for_arguments = false
|
|
78
|
+
ij_python_use_continuation_indent_for_collection_and_comprehensions = false
|
|
79
|
+
ij_python_use_continuation_indent_for_parameters = false
|
|
80
|
+
ij_python_wrap_long_lines = false
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Pull Request
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [ "master" ]
|
|
6
|
+
|
|
7
|
+
env:
|
|
8
|
+
BUILD_NUMBER: ${{ github.run_number }}
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build-python:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: [ "3.11", "3.12", "3.13" ]
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Setup Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: "${{ matrix.python-version }}"
|
|
24
|
+
|
|
25
|
+
- name: Build and Test
|
|
26
|
+
run: |
|
|
27
|
+
sudo apt-get update
|
|
28
|
+
sudo apt-get install libxml2-dev libxslt1-dev llvm-14-dev
|
|
29
|
+
python -m pip install --upgrade pip
|
|
30
|
+
python -m pip install .[test]
|
|
31
|
+
python -m pytest . --cov --cov-report xml --cov-config pyproject.toml
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Push
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "master" ]
|
|
6
|
+
|
|
7
|
+
env:
|
|
8
|
+
BUILD_NUMBER: ${{ github.run_number }}
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
push:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Setup Python
|
|
18
|
+
uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.13"
|
|
21
|
+
|
|
22
|
+
- name: Build and Upload
|
|
23
|
+
run: |
|
|
24
|
+
sudo apt-get update
|
|
25
|
+
sudo apt-get install libxml2-dev libxslt1-dev llvm-14-dev
|
|
26
|
+
python -m pip install --upgrade pip build twine
|
|
27
|
+
python -m pip install .[test]
|
|
28
|
+
python -m pytest . --cov --cov-report xml --cov-config pyproject.toml
|
|
29
|
+
python -m build -sw .
|
|
30
|
+
python -m twine upload --username __token__ --password ${{ secrets.PYPI_TOKEN }} dist/*
|
|
31
|
+
|
|
32
|
+
- name: Upload Coverage Report
|
|
33
|
+
uses: codecov/codecov-action@v5
|
|
34
|
+
with:
|
|
35
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
36
|
+
slug: ${{ github.repository }}
|
|
37
|
+
fail_ci_if_error: true
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# System junks
|
|
2
|
+
*.[oa]
|
|
3
|
+
*~
|
|
4
|
+
.DS_Store
|
|
5
|
+
Thumbs.db
|
|
6
|
+
|
|
7
|
+
# Git
|
|
8
|
+
.git/
|
|
9
|
+
|
|
10
|
+
# General
|
|
11
|
+
target/
|
|
12
|
+
output/
|
|
13
|
+
build/
|
|
14
|
+
opt/
|
|
15
|
+
gen/
|
|
16
|
+
tmp/
|
|
17
|
+
temp/
|
|
18
|
+
|
|
19
|
+
# IDEs
|
|
20
|
+
*.iml
|
|
21
|
+
.idea/
|
|
22
|
+
.classpath
|
|
23
|
+
.project
|
|
24
|
+
.settings/
|
|
25
|
+
.vscode/
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# Byte-compiled / optimized / DLL files
|
|
29
|
+
__pycache__/
|
|
30
|
+
*.py[cod]
|
|
31
|
+
*$py.class
|
|
32
|
+
|
|
33
|
+
# C extensions
|
|
34
|
+
*.so
|
|
35
|
+
|
|
36
|
+
# Distribution / packaging
|
|
37
|
+
.Python
|
|
38
|
+
build/
|
|
39
|
+
develop-eggs/
|
|
40
|
+
dist/
|
|
41
|
+
downloads/
|
|
42
|
+
eggs/
|
|
43
|
+
.eggs/
|
|
44
|
+
lib/
|
|
45
|
+
lib64/
|
|
46
|
+
parts/
|
|
47
|
+
sdist/
|
|
48
|
+
var/
|
|
49
|
+
wheels/
|
|
50
|
+
share/python-wheels/
|
|
51
|
+
*.egg-info/
|
|
52
|
+
.installed.cfg
|
|
53
|
+
*.egg
|
|
54
|
+
MANIFEST
|
|
55
|
+
|
|
56
|
+
# PyInstaller
|
|
57
|
+
# Usually these files are written by a python script from a template
|
|
58
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
59
|
+
*.manifest
|
|
60
|
+
*.spec
|
|
61
|
+
|
|
62
|
+
# Installer logs
|
|
63
|
+
pip-log.txt
|
|
64
|
+
pip-delete-this-directory.txt
|
|
65
|
+
|
|
66
|
+
# Unit test / coverage reports
|
|
67
|
+
htmlcov/
|
|
68
|
+
.tox/
|
|
69
|
+
.nox/
|
|
70
|
+
.coverage
|
|
71
|
+
.coverage.*
|
|
72
|
+
.cache
|
|
73
|
+
nosetests.xml
|
|
74
|
+
coverage.xml
|
|
75
|
+
*.cover
|
|
76
|
+
*.py,cover
|
|
77
|
+
.hypothesis/
|
|
78
|
+
.pytest_cache/
|
|
79
|
+
cover/
|
|
80
|
+
|
|
81
|
+
# Translations
|
|
82
|
+
*.mo
|
|
83
|
+
*.pot
|
|
84
|
+
|
|
85
|
+
# Django stuff:
|
|
86
|
+
*.log
|
|
87
|
+
local_settings.py
|
|
88
|
+
db.sqlite3
|
|
89
|
+
db.sqlite3-journal
|
|
90
|
+
|
|
91
|
+
# Flask stuff:
|
|
92
|
+
instance/
|
|
93
|
+
.webassets-cache
|
|
94
|
+
|
|
95
|
+
# Scrapy stuff:
|
|
96
|
+
.scrapy
|
|
97
|
+
|
|
98
|
+
# Sphinx documentation
|
|
99
|
+
docs/_build/
|
|
100
|
+
|
|
101
|
+
# PyBuilder
|
|
102
|
+
.pybuilder/
|
|
103
|
+
target/
|
|
104
|
+
|
|
105
|
+
# Jupyter Notebook
|
|
106
|
+
.ipynb_checkpoints
|
|
107
|
+
|
|
108
|
+
# IPython
|
|
109
|
+
profile_default/
|
|
110
|
+
ipython_config.py
|
|
111
|
+
|
|
112
|
+
# pyenv
|
|
113
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
114
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
115
|
+
# .python-version
|
|
116
|
+
|
|
117
|
+
# pipenv
|
|
118
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
119
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
120
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
121
|
+
# install all needed dependencies.
|
|
122
|
+
#Pipfile.lock
|
|
123
|
+
|
|
124
|
+
# poetry
|
|
125
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
126
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
127
|
+
# commonly ignored for libraries.
|
|
128
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
129
|
+
#poetry.lock
|
|
130
|
+
|
|
131
|
+
# pdm
|
|
132
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
133
|
+
#pdm.lock
|
|
134
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
135
|
+
# in version control.
|
|
136
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
137
|
+
.pdm.toml
|
|
138
|
+
|
|
139
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
140
|
+
__pypackages__/
|
|
141
|
+
|
|
142
|
+
# Celery stuff
|
|
143
|
+
celerybeat-schedule
|
|
144
|
+
celerybeat.pid
|
|
145
|
+
|
|
146
|
+
# SageMath parsed files
|
|
147
|
+
*.sage.py
|
|
148
|
+
|
|
149
|
+
# Environments
|
|
150
|
+
.env
|
|
151
|
+
.venv
|
|
152
|
+
env/
|
|
153
|
+
venv/
|
|
154
|
+
ENV/
|
|
155
|
+
env.bak/
|
|
156
|
+
venv.bak/
|
|
157
|
+
|
|
158
|
+
# Spyder project settings
|
|
159
|
+
.spyderproject
|
|
160
|
+
.spyproject
|
|
161
|
+
|
|
162
|
+
# Rope project settings
|
|
163
|
+
.ropeproject
|
|
164
|
+
|
|
165
|
+
# mkdocs documentation
|
|
166
|
+
/site
|
|
167
|
+
|
|
168
|
+
# mypy
|
|
169
|
+
.mypy_cache/
|
|
170
|
+
.dmypy.json
|
|
171
|
+
dmypy.json
|
|
172
|
+
|
|
173
|
+
# Pyre type checker
|
|
174
|
+
.pyre/
|
|
175
|
+
|
|
176
|
+
# pytype static type analyzer
|
|
177
|
+
.pytype/
|
|
178
|
+
|
|
179
|
+
# Cython debug symbols
|
|
180
|
+
cython_debug/
|
|
181
|
+
|
|
182
|
+
# PyCharm
|
|
183
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
184
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
185
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
186
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
187
|
+
#.idea/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include VERSION
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: plexus-python-protobuf-setup
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Classifier: Programming Language :: Python :: 3
|
|
5
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
6
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
8
|
+
Requires-Python: <3.14,>=3.11
|
|
9
|
+
Requires-Dist: protobuf>=5.0
|
|
10
|
+
Requires-Dist: grpcio-tools>=1.71
|
|
11
|
+
Provides-Extra: all
|
|
12
|
+
Requires-Dist: plexus-python-protobuf-setup; extra == "all"
|
|
13
|
+
Provides-Extra: test
|
|
14
|
+
Requires-Dist: pytest-cov>=5.0; extra == "test"
|
|
15
|
+
Requires-Dist: pytest-order>=1.3; extra == "test"
|
|
16
|
+
Requires-Dist: pytest>=8.3; extra == "test"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Plexus Python Protocol Buffer Setup Module
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.0
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = [
|
|
3
|
+
"setuptools>=75.0",
|
|
4
|
+
"setuptools-scm>=8.0",
|
|
5
|
+
"iker-python-setup>=1.0",
|
|
6
|
+
]
|
|
7
|
+
build-backend = "setuptools.build_meta"
|
|
8
|
+
|
|
9
|
+
[dependency-groups]
|
|
10
|
+
dev = [
|
|
11
|
+
"protobuf>=5.0",
|
|
12
|
+
"grpcio-tools>=1.71",
|
|
13
|
+
]
|
|
14
|
+
test = [
|
|
15
|
+
"pytest-cov>=5.0",
|
|
16
|
+
"pytest-order>=1.3",
|
|
17
|
+
"pytest>=8.3",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project]
|
|
21
|
+
name = "plexus-python-protobuf-setup"
|
|
22
|
+
dynamic = ["version"]
|
|
23
|
+
requires-python = ">=3.11,<3.14"
|
|
24
|
+
classifiers = [
|
|
25
|
+
"Programming Language :: Python :: 3",
|
|
26
|
+
"Programming Language :: Python :: 3.11",
|
|
27
|
+
"Programming Language :: Python :: 3.12",
|
|
28
|
+
"Programming Language :: Python :: 3.13",
|
|
29
|
+
]
|
|
30
|
+
dependencies = [
|
|
31
|
+
"protobuf>=5.0",
|
|
32
|
+
"grpcio-tools>=1.71",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
all = [
|
|
37
|
+
"plexus-python-protobuf-setup",
|
|
38
|
+
]
|
|
39
|
+
test = [
|
|
40
|
+
"pytest-cov>=5.0",
|
|
41
|
+
"pytest-order>=1.3",
|
|
42
|
+
"pytest>=8.3",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
[tool.setuptools]
|
|
46
|
+
package-dir = { "" = "src" }
|
|
47
|
+
zip-safe = false
|
|
48
|
+
include-package-data = true
|
|
49
|
+
|
|
50
|
+
[tool.setuptools.packages.find]
|
|
51
|
+
where = ["src"]
|
|
52
|
+
namespaces = true
|
|
53
|
+
|
|
54
|
+
[tool.pytest.ini_options]
|
|
55
|
+
pythonpath = ["src"]
|
|
56
|
+
|
|
57
|
+
[tool.coverage.run]
|
|
58
|
+
branch = true
|
|
59
|
+
include = [
|
|
60
|
+
"src/plexus/*",
|
|
61
|
+
]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
|
|
3
|
+
from iker.setup import setup, version_string
|
|
4
|
+
|
|
5
|
+
if __name__ == "__main__":
|
|
6
|
+
parser = argparse.ArgumentParser(description="setup script integrating dynamic version printer")
|
|
7
|
+
parser.add_argument("--print-version-string", action="store_true", help="print version string and exit")
|
|
8
|
+
|
|
9
|
+
args, _ = parser.parse_known_args()
|
|
10
|
+
if args.print_version_string:
|
|
11
|
+
print(version_string())
|
|
12
|
+
else:
|
|
13
|
+
setup()
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import importlib.metadata
|
|
2
|
+
from os import PathLike
|
|
3
|
+
from typing import Iterable
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
__version__ = importlib.metadata.version("plexus-python-protobuf-setup")
|
|
7
|
+
except importlib.metadata.PackageNotFoundError:
|
|
8
|
+
__version__ = "unknown"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def compile_protos(
|
|
12
|
+
out_dir: str | PathLike[str],
|
|
13
|
+
proto_dirs: Iterable[str | PathLike[str]],
|
|
14
|
+
include_dirs: Iterable[str | PathLike[str]],
|
|
15
|
+
*,
|
|
16
|
+
descriptor_path: str | PathLike[str] | None = None,
|
|
17
|
+
with_grpc: bool = False,
|
|
18
|
+
) -> None:
|
|
19
|
+
"""
|
|
20
|
+
Compiles .proto files in the specified directory
|
|
21
|
+
|
|
22
|
+
:param out_dir: Directory where the compiled files will be placed.
|
|
23
|
+
:param proto_dirs: Directories containing .proto files which are used for generating target source codes
|
|
24
|
+
:param include_dirs: Directories containing .proto files which are used only in compiling
|
|
25
|
+
:param descriptor_path: Optional path to output the descriptor set file.
|
|
26
|
+
:param with_grpc: If True, also generates gRPC Python code.
|
|
27
|
+
:raises FileNotFoundError: If the proto directory does not exist.
|
|
28
|
+
"""
|
|
29
|
+
import glob
|
|
30
|
+
import os
|
|
31
|
+
import subprocess
|
|
32
|
+
import sys
|
|
33
|
+
|
|
34
|
+
proto_files = []
|
|
35
|
+
for proto_dir in proto_dirs:
|
|
36
|
+
if not os.path.exists(proto_dir):
|
|
37
|
+
raise FileNotFoundError(f"proto directory '{proto_dir}' does not exist")
|
|
38
|
+
proto_files.extend(glob.glob(os.path.join(proto_dir, "**", "*.proto"), recursive=True))
|
|
39
|
+
|
|
40
|
+
if not proto_files:
|
|
41
|
+
print("No .proto files found")
|
|
42
|
+
return
|
|
43
|
+
|
|
44
|
+
cmd = [sys.executable, "-m", "grpc_tools.protoc"]
|
|
45
|
+
|
|
46
|
+
for include_dir in include_dirs:
|
|
47
|
+
if not os.path.exists(include_dir):
|
|
48
|
+
raise FileNotFoundError(f"include directory '{include_dir}' does not exist")
|
|
49
|
+
cmd.extend(("--proto_path", include_dir))
|
|
50
|
+
|
|
51
|
+
cmd.extend(("--python_out", out_dir))
|
|
52
|
+
cmd.extend(("--pyi_out", out_dir))
|
|
53
|
+
if with_grpc:
|
|
54
|
+
cmd.extend(("--grpc_python_out", out_dir))
|
|
55
|
+
|
|
56
|
+
if descriptor_path:
|
|
57
|
+
cmd.extend(("--descriptor_set_out",
|
|
58
|
+
descriptor_path,
|
|
59
|
+
"--include_imports",
|
|
60
|
+
"--include_source_info",
|
|
61
|
+
"--retain_options",
|
|
62
|
+
))
|
|
63
|
+
cmd.extend(proto_files)
|
|
64
|
+
|
|
65
|
+
if not os.path.exists(out_dir):
|
|
66
|
+
os.makedirs(out_dir)
|
|
67
|
+
|
|
68
|
+
subprocess.check_call(cmd)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: plexus-python-protobuf-setup
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Classifier: Programming Language :: Python :: 3
|
|
5
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
6
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
8
|
+
Requires-Python: <3.14,>=3.11
|
|
9
|
+
Requires-Dist: protobuf>=5.0
|
|
10
|
+
Requires-Dist: grpcio-tools>=1.71
|
|
11
|
+
Provides-Extra: all
|
|
12
|
+
Requires-Dist: plexus-python-protobuf-setup; extra == "all"
|
|
13
|
+
Provides-Extra: test
|
|
14
|
+
Requires-Dist: pytest-cov>=5.0; extra == "test"
|
|
15
|
+
Requires-Dist: pytest-order>=1.3; extra == "test"
|
|
16
|
+
Requires-Dist: pytest>=8.3; extra == "test"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.editorconfig
|
|
2
|
+
.gitignore
|
|
3
|
+
MANIFEST.in
|
|
4
|
+
README.md
|
|
5
|
+
VERSION
|
|
6
|
+
pyproject.toml
|
|
7
|
+
setup.py
|
|
8
|
+
.github/workflows/pr.yml
|
|
9
|
+
.github/workflows/push.yml
|
|
10
|
+
src/plexus/protobuf/setup/__init__.py
|
|
11
|
+
src/plexus_python_protobuf_setup.egg-info/PKG-INFO
|
|
12
|
+
src/plexus_python_protobuf_setup.egg-info/SOURCES.txt
|
|
13
|
+
src/plexus_python_protobuf_setup.egg-info/dependency_links.txt
|
|
14
|
+
src/plexus_python_protobuf_setup.egg-info/not-zip-safe
|
|
15
|
+
src/plexus_python_protobuf_setup.egg-info/requires.txt
|
|
16
|
+
src/plexus_python_protobuf_setup.egg-info/top_level.txt
|
|
17
|
+
test/plexus_test.py
|
|
18
|
+
test/plexus_tests/__init__.py
|
plexus_python_protobuf_setup-1.0.2/src/plexus_python_protobuf_setup.egg-info/dependency_links.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
plexus
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
|
|
3
|
+
from plexus_tests import *
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Test(unittest.TestCase):
|
|
7
|
+
|
|
8
|
+
def test(self):
|
|
9
|
+
self.assertIsNotNone(module_directory)
|
|
10
|
+
self.assertIsNotNone(source_directory)
|
|
11
|
+
self.assertIsNotNone(test_directory)
|
|
12
|
+
self.assertIsNotNone(resources_directory)
|
|
13
|
+
self.assertIsNotNone(temporary_directory)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
__all__ = [
|
|
4
|
+
"module_directory",
|
|
5
|
+
"source_directory",
|
|
6
|
+
"test_directory",
|
|
7
|
+
"resources_directory",
|
|
8
|
+
"temporary_directory",
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
module_directory: str = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
|
12
|
+
source_directory: str = os.path.abspath(os.path.join(module_directory, "src"))
|
|
13
|
+
test_directory: str = os.path.abspath(os.path.join(module_directory, "test"))
|
|
14
|
+
resources_directory: str = os.path.abspath(os.path.join(module_directory, "resources"))
|
|
15
|
+
temporary_directory: str = os.path.abspath(os.path.join(module_directory, "tmp"))
|