plexus-python-protobuf-setup 1.0.3__tar.gz → 1.0.5__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.
Files changed (26) hide show
  1. {plexus_python_protobuf_setup-1.0.3 → plexus_python_protobuf_setup-1.0.5}/PKG-INFO +1 -1
  2. plexus_python_protobuf_setup-1.0.5/README.md +29 -0
  3. {plexus_python_protobuf_setup-1.0.3 → plexus_python_protobuf_setup-1.0.5}/src/plexus_python_protobuf_setup.egg-info/PKG-INFO +1 -1
  4. plexus_python_protobuf_setup-1.0.5/src/plexus_python_protobuf_setup.egg-info/SOURCES.txt +12 -0
  5. plexus_python_protobuf_setup-1.0.3/.editorconfig +0 -80
  6. plexus_python_protobuf_setup-1.0.3/.github/workflows/pr.yml +0 -31
  7. plexus_python_protobuf_setup-1.0.3/.github/workflows/push.yml +0 -37
  8. plexus_python_protobuf_setup-1.0.3/.gitignore +0 -187
  9. plexus_python_protobuf_setup-1.0.3/README.md +0 -1
  10. plexus_python_protobuf_setup-1.0.3/resources/unittest/setup/protos/dummy/person.proto +0 -9
  11. plexus_python_protobuf_setup-1.0.3/resources/unittest/setup/protos/dummy/relationship/company.proto +0 -12
  12. plexus_python_protobuf_setup-1.0.3/resources/unittest/setup/protos/dummy/relationship/family.proto +0 -13
  13. plexus_python_protobuf_setup-1.0.3/src/plexus_python_protobuf_setup.egg-info/SOURCES.txt +0 -22
  14. plexus_python_protobuf_setup-1.0.3/test/plexus_test.py +0 -13
  15. plexus_python_protobuf_setup-1.0.3/test/plexus_tests/__init__.py +0 -15
  16. plexus_python_protobuf_setup-1.0.3/test/plexus_tests/protobuf/setup_test.py +0 -49
  17. {plexus_python_protobuf_setup-1.0.3 → plexus_python_protobuf_setup-1.0.5}/MANIFEST.in +0 -0
  18. {plexus_python_protobuf_setup-1.0.3 → plexus_python_protobuf_setup-1.0.5}/VERSION +0 -0
  19. {plexus_python_protobuf_setup-1.0.3 → plexus_python_protobuf_setup-1.0.5}/pyproject.toml +0 -0
  20. {plexus_python_protobuf_setup-1.0.3 → plexus_python_protobuf_setup-1.0.5}/setup.cfg +0 -0
  21. {plexus_python_protobuf_setup-1.0.3 → plexus_python_protobuf_setup-1.0.5}/setup.py +0 -0
  22. {plexus_python_protobuf_setup-1.0.3 → plexus_python_protobuf_setup-1.0.5}/src/plexus/protobuf/setup/__init__.py +0 -0
  23. {plexus_python_protobuf_setup-1.0.3 → plexus_python_protobuf_setup-1.0.5}/src/plexus_python_protobuf_setup.egg-info/dependency_links.txt +0 -0
  24. {plexus_python_protobuf_setup-1.0.3 → plexus_python_protobuf_setup-1.0.5}/src/plexus_python_protobuf_setup.egg-info/not-zip-safe +0 -0
  25. {plexus_python_protobuf_setup-1.0.3 → plexus_python_protobuf_setup-1.0.5}/src/plexus_python_protobuf_setup.egg-info/requires.txt +0 -0
  26. {plexus_python_protobuf_setup-1.0.3 → plexus_python_protobuf_setup-1.0.5}/src/plexus_python_protobuf_setup.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plexus-python-protobuf-setup
3
- Version: 1.0.3
3
+ Version: 1.0.5
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: 3.11
6
6
  Classifier: Programming Language :: Python :: 3.12
@@ -0,0 +1,29 @@
1
+ # Plexus Python Protocol Buffer Setup Module
2
+
3
+ [![codecov](https://codecov.io/gh/ruyangshou/plexus-python-protobuf-setup/graph/badge.svg?token=J4rQVKXeRx)](
4
+ https://codecov.io/gh/ruyangshou/plexus-python-protobuf-setup)
5
+
6
+ ## Usage
7
+
8
+ 1. **Modify the `pyproject.toml` file** as follows:
9
+ ```toml
10
+ [build-system]
11
+ requires = [
12
+ "setuptools>=68.0",
13
+ "setuptools-scm>=8.0",
14
+ "plexus-python-protobuf-setup>=1.0" # This is required
15
+ ]
16
+ ```
17
+ 2. **Use this tool in your `setup.py` script**:
18
+ ```python
19
+ import os
20
+ from setuptools import setup
21
+ from plexus.protobuf.setup import compile_protos
22
+
23
+ # Call this code generation before setup
24
+ compile_protos(out_dir,
25
+ proto_dirs,
26
+ include_dirs,
27
+ descriptor_path=os.path.join(out_dir, "descriptor.proto"))
28
+ setup()
29
+ ```
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plexus-python-protobuf-setup
3
- Version: 1.0.3
3
+ Version: 1.0.5
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: 3.11
6
6
  Classifier: Programming Language :: Python :: 3.12
@@ -0,0 +1,12 @@
1
+ MANIFEST.in
2
+ README.md
3
+ VERSION
4
+ pyproject.toml
5
+ setup.py
6
+ src/plexus/protobuf/setup/__init__.py
7
+ src/plexus_python_protobuf_setup.egg-info/PKG-INFO
8
+ src/plexus_python_protobuf_setup.egg-info/SOURCES.txt
9
+ src/plexus_python_protobuf_setup.egg-info/dependency_links.txt
10
+ src/plexus_python_protobuf_setup.egg-info/not-zip-safe
11
+ src/plexus_python_protobuf_setup.egg-info/requires.txt
12
+ src/plexus_python_protobuf_setup.egg-info/top_level.txt
@@ -1,80 +0,0 @@
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
@@ -1,31 +0,0 @@
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
@@ -1,37 +0,0 @@
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
@@ -1,187 +0,0 @@
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/
@@ -1 +0,0 @@
1
- # Plexus Python Protocol Buffer Setup Module
@@ -1,9 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package dummy;
4
-
5
- message Person {
6
- optional string name = 1;
7
- optional int32 age = 2;
8
- repeated string hobbies = 3;
9
- }
@@ -1,12 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package dummy.relationship;
4
-
5
- import "dummy/person.proto";
6
-
7
- message Company {
8
-
9
- optional dummy.Person boss = 1;
10
- repeated dummy.Person staff = 2;
11
-
12
- }
@@ -1,13 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package dummy.relationship;
4
-
5
- import "dummy/person.proto";
6
-
7
- message Family {
8
-
9
- optional dummy.Person father = 1;
10
- optional dummy.Person mother = 2;
11
- repeated dummy.Person children = 3;
12
-
13
- }
@@ -1,22 +0,0 @@
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
- resources/unittest/setup/protos/dummy/person.proto
11
- resources/unittest/setup/protos/dummy/relationship/company.proto
12
- resources/unittest/setup/protos/dummy/relationship/family.proto
13
- src/plexus/protobuf/setup/__init__.py
14
- src/plexus_python_protobuf_setup.egg-info/PKG-INFO
15
- src/plexus_python_protobuf_setup.egg-info/SOURCES.txt
16
- src/plexus_python_protobuf_setup.egg-info/dependency_links.txt
17
- src/plexus_python_protobuf_setup.egg-info/not-zip-safe
18
- src/plexus_python_protobuf_setup.egg-info/requires.txt
19
- src/plexus_python_protobuf_setup.egg-info/top_level.txt
20
- test/plexus_test.py
21
- test/plexus_tests/__init__.py
22
- test/plexus_tests/protobuf/setup_test.py
@@ -1,13 +0,0 @@
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)
@@ -1,15 +0,0 @@
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"))
@@ -1,49 +0,0 @@
1
- import os
2
- import tempfile
3
- import unittest
4
-
5
- import plexus.protobuf.setup
6
- from plexus_tests import resources_directory
7
-
8
-
9
- class TestSetup(unittest.TestCase):
10
-
11
- def test_compile_protos(self):
12
- with tempfile.TemporaryDirectory() as temp_dir:
13
- proto_dirs = [os.path.join(resources_directory, "unittest", "setup", "protos")]
14
- include_dirs = [os.path.join(resources_directory, "unittest", "setup", "protos")]
15
-
16
- plexus.protobuf.setup.compile_protos(temp_dir,
17
- proto_dirs,
18
- include_dirs,
19
- descriptor_path=os.path.join(temp_dir, "descriptor.proto"),
20
- with_grpc=True)
21
-
22
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "descriptor.proto")))
23
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "dummy", "person_pb2.py")))
24
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "dummy", "person_pb2.pyi")))
25
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "dummy", "person_pb2_grpc.py")))
26
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "dummy", "relationship", "company_pb2.py")))
27
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "dummy", "relationship", "company_pb2.pyi")))
28
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "dummy", "relationship", "company_pb2_grpc.py")))
29
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "dummy", "relationship", "family_pb2.py")))
30
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "dummy", "relationship", "family_pb2.pyi")))
31
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "dummy", "relationship", "family_pb2_grpc.py")))
32
-
33
- def test_compile_protos__without_grpc(self):
34
- with tempfile.TemporaryDirectory() as temp_dir:
35
- proto_dirs = [os.path.join(resources_directory, "unittest", "setup", "protos")]
36
- include_dirs = [os.path.join(resources_directory, "unittest", "setup", "protos")]
37
-
38
- plexus.protobuf.setup.compile_protos(temp_dir, proto_dirs, include_dirs, with_grpc=False)
39
-
40
- self.assertFalse(os.path.exists(os.path.join(temp_dir, "descriptor.proto")))
41
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "dummy", "person_pb2.py")))
42
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "dummy", "person_pb2.pyi")))
43
- self.assertFalse(os.path.exists(os.path.join(temp_dir, "dummy", "person_pb2_grpc.py")))
44
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "dummy", "relationship", "company_pb2.py")))
45
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "dummy", "relationship", "company_pb2.pyi")))
46
- self.assertFalse(os.path.exists(os.path.join(temp_dir, "dummy", "relationship", "company_pb2_grpc.py")))
47
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "dummy", "relationship", "family_pb2.py")))
48
- self.assertTrue(os.path.exists(os.path.join(temp_dir, "dummy", "relationship", "family_pb2.pyi")))
49
- self.assertFalse(os.path.exists(os.path.join(temp_dir, "dummy", "relationship", "family_pb2_grpc.py")))