Skip to content

Commit 010c1c0

Browse files
committed
Merged in develop (pull request #187)
Release 3.5.4
2 parents c0da442 + e27adfa commit 010c1c0

7 files changed

Lines changed: 61 additions & 30 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ You can request more information about a commercial license on our [website](htt
9292
What is required to be able to generate source files based on .proto files:
9393
1. Python 3.8 and up
9494
2. Pip
95-
3. Protobuf v21.5 and up (tested with v26.1)
95+
3. Protobuf v21.5 and up (tested with v27.1)
9696
4. Git
9797

9898
After installing the requirements, continue by cloning the Embedded Proto repo. We advised using Embedded Proto as a submodule in your project. This way, you can track the version of Embedded Proto with the version of your project.

generator/EmbeddedProto/templates/TypeDefMsg.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ class {{ typedef.get_name() }} final: public ::EmbeddedProto::MessageInterface
246246

247247
}
248248

249+
#ifndef DISABLE_FIELD_NUMBER_TO_NAME
250+
249251
static char const* field_number_to_name(const FieldNumber fieldNumber)
250252
{
251253
char const* name = nullptr;
@@ -270,6 +272,8 @@ class {{ typedef.get_name() }} final: public ::EmbeddedProto::MessageInterface
270272
return name;
271273
}
272274

275+
#endif
276+
273277
#ifdef MSG_TO_STRING
274278

275279
::EmbeddedProto::string_view to_string(::EmbeddedProto::string_view& str) const

release_to_github.sh

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,41 @@
3232

3333

3434
if [ $# -eq 0 ]; then
35-
echo "Please provice version number: \"./release_to_github.sh X.Y.Z\""
35+
echo "Please provide a version number: \"./release_to_github.sh X.Y.Z\""
3636
else
37-
git fetch --prune
38-
39-
git checkout develop
40-
git pull
41-
git push github develop
42-
43-
git checkout master
44-
git pull
45-
git push github master
46-
47-
git tag -d latest
48-
git push --delete origin latest
49-
git push --delete github latest
50-
51-
git tag latest
52-
git push origin latest
53-
git push github latest
54-
55-
git tag "$1"
56-
git push origin "$1"
57-
git push github "$1"
37+
38+
echo 'When updating the protobuf version did you: '
39+
echo ' 1. Update the pyproject.toml file?'
40+
echo ' 2. Update the version in the README installation section?'
41+
echo ' 3. Update the release notes?'
42+
read answer
43+
44+
if [ "$answer" != "${answer#[Yy]}" ] ;then
45+
46+
git fetch --prune
47+
48+
git checkout develop
49+
git pull
50+
git push github develop
51+
52+
git checkout master
53+
git pull
54+
git push github master
55+
56+
git tag -d latest
57+
git push --delete origin latest
58+
git push --delete github latest
59+
60+
git tag latest
61+
git push origin latest
62+
git push github latest
63+
64+
git tag "$1"
65+
git push origin "$1"
66+
git push github "$1"
67+
68+
else
69+
echo "Aborting"
70+
fi
71+
5872
fi

setup.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,26 +112,26 @@ def check_protoc_version(arguments):
112112
text = "\n"
113113
text += "The version of Protoc (v{0}.{1})".format(installed_version_minor,
114114
installed_version_patch)
115-
text += " you have installed is not the same as the version of\nthe protobuf python package " \
116-
"(v{0}.{1}).".format(required_version.group('minor'), required_version.group('patch'))
115+
text += " you installed is different from the Protobuf Python\npackage version" \
116+
"(v{0}.{1}). ".format(required_version.group('minor'), required_version.group('patch'))
117117
text += "These are your options:\n" \
118-
"\t1. Install a matching version of Protoc.\n" \
119-
"\t2. Change the version of Embedded Proto.\n"
118+
"\t1. Manually install a matching version of Protoc.\n" \
119+
"\t2. Manually change the version of Embedded Proto.\n"
120120

121121
# Check if all versions are above v21.0
122122
if ((21 <= int(installed_version_minor)) and (21 <= int(required_version.group('minor')))) or \
123123
((21 > int(installed_version_minor)) and (21 > int(required_version.group('minor')))):
124124

125125
print(" [" + CYELLOW + "Caution" + CEND + "]")
126-
text += ("\t3. Ignore the difference and try if it works for you (please let us know if it does not stating"
127-
" the versions you used).\n")
126+
text += "\t3. Ignore the difference and try if it works for you (please let us know\n" \
127+
"\t if it does not stating the versions you used).\n"
128128
print(text)
129129
if arguments.ignore_version_diff:
130130
# Continue the setup
131131
print("Automatically ignoring the difference.")
132132
else:
133133
while True:
134-
user_input = input("Ignore the difference [Y/n]: ")
134+
user_input = input("Would you like to try option 3? [Y/n]: ")
135135
if ('Y' == user_input) or ('y' == user_input):
136136
# Continue the setup
137137
print("Ignoring the difference.")

test/test_SimpleTypes.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,8 @@ TEST(SimpleTypes, deserialize_fault_overlong_varint)
542542
EXPECT_EQ(::EmbeddedProto::Error::OVERLONG_VARINT, msg.deserialize(buffer));
543543
}
544544

545+
#ifndef DISABLE_FIELD_NUMBER_TO_NAME
546+
545547
TEST(SimpleTypes, field_number_to_name)
546548
{
547549
EXPECT_TRUE(0 == strcmp(::Test_Simple_Types::field_number_to_name(::Test_Simple_Types::FieldNumber::A_INT32),
@@ -557,6 +559,8 @@ TEST(SimpleTypes, field_number_to_name)
557559
"Invalid FieldNumber"));
558560
}
559561

562+
#endif
563+
560564
#ifdef MSG_TO_STRING
561565

562566
TEST(SimpleTypes, to_string)

test/test_oneof_fields.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,9 @@ TEST(OneofField, sb_oneof_serialize_empty)
441441

442442
}
443443

444+
445+
#ifndef DISABLE_FIELD_NUMBER_TO_NAME
446+
444447
TEST(OneofField, field_number_to_name)
445448
{
446449
EXPECT_TRUE(0 == strcmp(::message_oneof::field_number_to_name(::message_oneof::FieldNumber::X),
@@ -453,6 +456,8 @@ TEST(OneofField, field_number_to_name)
453456
"msg_ABC"));
454457
}
455458

459+
#endif
460+
456461

457462
#ifdef MSG_TO_STRING
458463

test/test_string_bytes.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,8 @@ TEST(RepeatedStringBytes, deserialize)
785785
EXPECT_STREQ(msg.array_of_txt(2).get_const(), "Foo bar 3");
786786
}
787787

788+
#ifndef DISABLE_FIELD_NUMBER_TO_NAME
789+
788790
TEST(RepeatedStringBytes, field_number_to_name)
789791
{
790792
using RSB = repeated_string_bytes<3, 15, 3, 15, 3, 3>;
@@ -797,6 +799,8 @@ TEST(RepeatedStringBytes, field_number_to_name)
797799
"nested_bytes"));
798800
}
799801

802+
#endif
803+
800804
#ifdef MSG_TO_STRING
801805

802806
TEST(RepeatedStringBytes, to_string)

0 commit comments

Comments
 (0)