Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()


@nox.session(python=["3.6", "3.7", "3.8", "3.9"])
PYTHON_VERSIONS = [
"3.6",
"3.7",
"3.8",
"3.9",
"3.10",
]


@nox.session(python=PYTHON_VERSIONS)
def unit(session, proto="python"):
"""Run the unit test suite."""

Expand Down Expand Up @@ -54,12 +63,13 @@ def unit(session, proto="python"):
# Check if protobuf has released wheels for new python versions
# https://pypi.org/project/protobuf/#files
# This list will generally be shorter than 'unit'
@nox.session(python=["3.6", "3.7", "3.8", "3.9"])
@nox.session(python=PYTHON_VERSIONS)
def unitcpp(session):
return unit(session, proto="cpp")


@nox.session(python="3.9")
# Just use the most recent version for docs
@nox.session(python=PYTHON_VERSIONS[-1])
def docs(session):
"""Build the docs."""

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
long_description=README,
platforms="Posix; MacOS X",
include_package_data=True,
install_requires=("protobuf >= 3.12.0",),
install_requires=("protobuf >= 3.19.0",),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not have been included in a patch release. It's causing problems over in the conda ecosystem, where the version of libprotobuf is a bit slower to update as it require recompilation of many many packages. Currently the latest grcp-cpp package is compiled with libprotobuf==3.18.1.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: literally today is when they are rolling out changes to the build environment to support protobuf 3.19 conda-forge/grpc-cpp-feedstock#124

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future reference, this is the where pin for conda was updated: conda-forge/conda-forge-pinning-feedstock#2049

I recommend we don't update minimum protobuf beyond this in future

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add conda tests to verify that installation is possible?

extras_require={"testing": ["google-api-core[grpc] >= 1.22.2",],},
python_requires=">=3.6",
classifiers=[
Expand Down
1 change: 0 additions & 1 deletion testing/constraints-3.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
#
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
protobuf==3.15.6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have updated to the minimum supported version (so that we continue to support it even when future versions are released).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #273.

google-api-core==1.22.2
14 changes: 14 additions & 0 deletions tests/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,17 @@ class Squid(proto.Message):
assert s.mass_kg == 20

assert Squid.to_json(s, preserving_proto_field_name=True) == json_str


def test_json_name():
class Squid(proto.Message):
massKg = proto.Field(proto.INT32, number=1, json_name="mass_in_kilograms")

s = Squid(massKg=20)
j = Squid.to_json(s)

assert "mass_in_kilograms" in j

s_two = Squid.from_json(j)

assert s == s_two