plexus-python-protobuf-setup 1.0.2__tar.gz → 1.0.3__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 → plexus_python_protobuf_setup-1.0.3}/PKG-INFO +1 -1
- plexus_python_protobuf_setup-1.0.3/resources/unittest/setup/protos/dummy/person.proto +9 -0
- plexus_python_protobuf_setup-1.0.3/resources/unittest/setup/protos/dummy/relationship/company.proto +12 -0
- plexus_python_protobuf_setup-1.0.3/resources/unittest/setup/protos/dummy/relationship/family.proto +13 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/src/plexus/protobuf/setup/__init__.py +1 -1
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/src/plexus_python_protobuf_setup.egg-info/PKG-INFO +1 -1
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/src/plexus_python_protobuf_setup.egg-info/SOURCES.txt +5 -1
- plexus_python_protobuf_setup-1.0.3/test/plexus_tests/protobuf/setup_test.py +49 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/.editorconfig +0 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/.github/workflows/pr.yml +0 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/.github/workflows/push.yml +0 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/.gitignore +0 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/MANIFEST.in +0 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/README.md +0 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/VERSION +0 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/pyproject.toml +0 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/setup.cfg +0 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/setup.py +0 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/src/plexus_python_protobuf_setup.egg-info/dependency_links.txt +0 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/src/plexus_python_protobuf_setup.egg-info/not-zip-safe +0 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/src/plexus_python_protobuf_setup.egg-info/requires.txt +0 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/src/plexus_python_protobuf_setup.egg-info/top_level.txt +0 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/test/plexus_test.py +0 -0
- {plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/test/plexus_tests/__init__.py +0 -0
|
@@ -24,7 +24,7 @@ def compile_protos(
|
|
|
24
24
|
:param include_dirs: Directories containing .proto files which are used only in compiling
|
|
25
25
|
:param descriptor_path: Optional path to output the descriptor set file.
|
|
26
26
|
:param with_grpc: If True, also generates gRPC Python code.
|
|
27
|
-
:raises FileNotFoundError: If the proto
|
|
27
|
+
:raises FileNotFoundError: If any of the proto directories and include directories does not exist.
|
|
28
28
|
"""
|
|
29
29
|
import glob
|
|
30
30
|
import os
|
|
@@ -7,6 +7,9 @@ pyproject.toml
|
|
|
7
7
|
setup.py
|
|
8
8
|
.github/workflows/pr.yml
|
|
9
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
|
|
10
13
|
src/plexus/protobuf/setup/__init__.py
|
|
11
14
|
src/plexus_python_protobuf_setup.egg-info/PKG-INFO
|
|
12
15
|
src/plexus_python_protobuf_setup.egg-info/SOURCES.txt
|
|
@@ -15,4 +18,5 @@ src/plexus_python_protobuf_setup.egg-info/not-zip-safe
|
|
|
15
18
|
src/plexus_python_protobuf_setup.egg-info/requires.txt
|
|
16
19
|
src/plexus_python_protobuf_setup.egg-info/top_level.txt
|
|
17
20
|
test/plexus_test.py
|
|
18
|
-
test/plexus_tests/__init__.py
|
|
21
|
+
test/plexus_tests/__init__.py
|
|
22
|
+
test/plexus_tests/protobuf/setup_test.py
|
|
@@ -0,0 +1,49 @@
|
|
|
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")))
|
|
File without changes
|
{plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/.github/workflows/pr.yml
RENAMED
|
File without changes
|
{plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/.github/workflows/push.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plexus_python_protobuf_setup-1.0.2 → plexus_python_protobuf_setup-1.0.3}/test/plexus_test.py
RENAMED
|
File without changes
|
|
File without changes
|