Skip to content

Commit a72bd53

Browse files
authored
Update mypy-protobuf requirement from <4,>=3.0.0 to >=3.0.0,<5 (#489)
Updates the requirements on [mypy-protobuf](https://github.com/nipunn1313/mypy-protobuf) to permit the latest version. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/nipunn1313/mypy-protobuf/blob/main/CHANGELOG.md">mypy-protobuf's changelog</a>.</em></p> <blockquote> <h2>4.0.0</h2> <ul> <li>BREAKING: Drop support for <code>py_generic_services</code> as it was removed from the protobuf compiler starting in version 6.30 <ul> <li><a href="https://protobuf.dev/news/2024-10-02/#rpc-service-interfaces">https://protobuf.dev/news/2024-10-02/#rpc-service-interfaces</a></li> </ul> </li> <li>Drop testing support for protobuf &lt;6.32 because they don't support editions <ul> <li>With some more work this could be added back in a testing refactor</li> <li>Protobuf &lt;6.32 still had the edition enums and field options, so it <em>should</em> still work. But is untested</li> </ul> </li> <li>Add support for editions (up to 2024)</li> <li>Add <code>generate_concrete_servicer_stubs</code> option to generate concrete instead of abstract servicer stubs</li> <li>Add <code>sync_only</code>/<code>async_only</code> options to generate only sync or async version of GRPC stubs</li> <li>Switch to types-grpcio instead of no longer maintained grpc-stubs</li> <li>Add <code>_HasFieldArgType</code> and <code>_ClearFieldArgType</code> aliases to allow for typing field manipulation functions</li> <li>Add <code>_WhichOneofArgType_&lt;oneof_name&gt;</code> and <code>_WhichOneofReturnType_&lt;oneof_name&gt;</code> type aliases</li> <li>Use <code>__new__</code> overloads for async stubs instead of <code>TypeVar</code> based <code>__init__</code> overloads. <ul> <li><a href="https://redirect.github.com/nipunn1313/mypy-protobuf/issues/707">nipunn1313/mypy-protobuf#707</a></li> </ul> </li> <li>Support file level field presence feature setting</li> </ul> <h2>3.7.0</h2> <ul> <li>Mark top-level mangled identifiers as <code>TypeAlias</code>.</li> <li>Change the top-level mangling prefix from <code>global___</code> to <code>Global___</code> to respect <a href="https://github.com/PyCQA/flake8-pyi/blob/main/ERRORCODES.md#list-of-warnings">Y042</a> naming convention.</li> <li>Support client stub async typing overloads</li> <li>Support <a href="https://peps.python.org/pep-0702/">PEP702</a> deprecations <ul> <li>Message deprecations are supported</li> <li>Field deprecations are not. This may be possible with init overloads</li> <li>Service deprecations are supported for Sync stubs <ul> <li>Not for async stubs</li> </ul> </li> <li>Enum message deprecation is supported <ul> <li>Enum field deprecation is not</li> </ul> </li> </ul> </li> <li>Drop Python 3.8 testing. Newer protobuf versions are incompatible. Generated code may still work</li> </ul> <h2>3.6.0</h2> <ul> <li>Remove 3.7 compatibility for typing_extensions.final/Literal</li> <li>Bump protobuf to 4.25.3</li> </ul> <h2>3.5.0</h2> <ul> <li>Add gRPC aio stub and servicer generation (<a href="https://redirect.github.com/nipunn1313/mypy-protobuf/issues/489">#489</a>)</li> <li>Bump tested dependencies to pyright==1.1.319, mypy==1.4.1, protobuf==4.23.4, grpcio-tools==1.56.2</li> <li>Drop support for py 3.7. Add support for py 3.11.</li> <li>Don't add unnecessary flake8 noqa F821 comments. (Become compatible with flake8-pyi&gt;=23.5.0.)</li> </ul> <h2>3.4.0</h2> <ul> <li>Mark messages as <a href="https://github.com/typing"><code>@​typing</code></a>.final</li> <li>Switch to use the reserved mypy-protobuf extension option numbers <a href="https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md">https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md</a></li> <li>Bump protobuf dependency to 4.21.8</li> <li>Skip unnecessary flake8 noqa F821 on module scope fwd reference classes</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/nipunn1313/mypy-protobuf/commit/7d68665906b16a0fa4e880af8bf940dc7492211a"><code>7d68665</code></a> prep 3.8.0 release (<a href="https://redirect.github.com/nipunn1313/mypy-protobuf/issues/715">#715</a>)</li> <li><a href="https://github.com/nipunn1313/mypy-protobuf/commit/7b20d4eeebb3a8161d2c0591fe66847a5909ba55"><code>7b20d4e</code></a> Support file level field presence feature setting (<a href="https://redirect.github.com/nipunn1313/mypy-protobuf/issues/717">#717</a>)</li> <li><a href="https://github.com/nipunn1313/mypy-protobuf/commit/f35584a0834f0e9d59efc44b2320eeabd6c43982"><code>f35584a</code></a> Add flags to generate only sync or only async stubs (<a href="https://redirect.github.com/nipunn1313/mypy-protobuf/issues/694">#694</a>)</li> <li><a href="https://github.com/nipunn1313/mypy-protobuf/commit/38362fb1c84c9203d49c6972a91b42ae3e7a2bd8"><code>38362fb</code></a> Overload <strong>new</strong> (<a href="https://redirect.github.com/nipunn1313/mypy-protobuf/issues/710">#710</a>)</li> <li><a href="https://github.com/nipunn1313/mypy-protobuf/commit/c89ee56b83af4e0068a96ebbeec67edf47abf80b"><code>c89ee56</code></a> Move to types-grpcio (<a href="https://redirect.github.com/nipunn1313/mypy-protobuf/issues/703">#703</a>)</li> <li><a href="https://github.com/nipunn1313/mypy-protobuf/commit/505e3a0ec601841c21e2b64d7ff458a5326325eb"><code>505e3a0</code></a> Aidan/clear has field type aliases (<a href="https://redirect.github.com/nipunn1313/mypy-protobuf/issues/696">#696</a>)</li> <li><a href="https://github.com/nipunn1313/mypy-protobuf/commit/6fa9547042d0396d9549172a5e476a40fb283c00"><code>6fa9547</code></a> Bump mypy from 1.14.1 to 1.19.0 (<a href="https://redirect.github.com/nipunn1313/mypy-protobuf/issues/700">#700</a>)</li> <li><a href="https://github.com/nipunn1313/mypy-protobuf/commit/5c7686d7635bb54e22264bf2b950ca6967fcaa81"><code>5c7686d</code></a> Bump pytest-asyncio from 0.24.0 to 0.25.3 (<a href="https://redirect.github.com/nipunn1313/mypy-protobuf/issues/674">#674</a>)</li> <li><a href="https://github.com/nipunn1313/mypy-protobuf/commit/caade91c9eea98c56a0cfad0b3c2bf1f0c3768a0"><code>caade91</code></a> Bump actions/checkout from 4 to 6 (<a href="https://redirect.github.com/nipunn1313/mypy-protobuf/issues/702">#702</a>)</li> <li><a href="https://github.com/nipunn1313/mypy-protobuf/commit/d86fe02674ab785d90925e54094f90db32793167"><code>d86fe02</code></a> Bump actions/setup-python from 5 to 6 (<a href="https://redirect.github.com/nipunn1313/mypy-protobuf/issues/701">#701</a>)</li> <li>Additional commits viewable in <a href="https://github.com/nipunn1313/mypy-protobuf/compare/v3.0.0...v4.0.0">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
2 parents 8a4e067 + 10341d6 commit a72bd53

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ requires = [
1111
# sure the code is generated using the minimum supported versions, as older
1212
# versions can't work with code that was generated with newer versions.
1313
# https://protobuf.dev/support/cross-version-runtime-guarantee/#backwards
14-
"protobuf == 5.29.3",
15-
"grpcio-tools == 1.70.0",
16-
"grpcio == 1.70.0",
14+
"protobuf == 6.33.4",
15+
"grpcio-tools == 1.76.0",
16+
"grpcio == 1.76.0",
1717
{%- endif %}
1818
]
1919
build-backend = "setuptools.build_meta"
@@ -64,11 +64,11 @@ dependencies = [
6464
# We can't widen beyond the current value unless we bump the minimum
6565
# requirements too because of protobuf cross-version runtime guarantees:
6666
# https://protobuf.dev/support/cross-version-runtime-guarantee/#major
67-
"protobuf >= 6.32.0, < 8", # Do not widen beyond 8!
67+
"protobuf >= 6.33.4, < 8", # Do not widen beyond 8!
6868
# We couldn't find any document with a spec about the cross-version runtime
6969
# guarantee for grpcio, so unless we find one in the future, we'll assume
7070
# major version jumps are not compatible
71-
"grpcio >= 1.74.0, < 2", # Do not widen beyond 2!
71+
"grpcio >= 1.76.0, < 2", # Do not widen beyond 2!
7272
]
7373
{%- else %}
7474
dependencies = [

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ compile_proto = "frequenz.repo.config.setuptools.grpc_tools:CompileProto"
5656
actor = []
5757
api = [
5858
"grpcio-tools >= 1.47.0, < 2",
59-
"mypy-protobuf >= 3.0.0, < 4",
59+
"mypy-protobuf >= 3.0.0, < 6",
6060
"setuptools >= 67.6.0, < 81",
6161
]
6262
app = []

tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ requires = [
1010
# sure the code is generated using the minimum supported versions, as older
1111
# versions can't work with code that was generated with newer versions.
1212
# https://protobuf.dev/support/cross-version-runtime-guarantee/#backwards
13-
"protobuf == 5.29.3",
14-
"grpcio-tools == 1.70.0",
15-
"grpcio == 1.70.0",
13+
"protobuf == 6.33.4",
14+
"grpcio-tools == 1.76.0",
15+
"grpcio == 1.76.0",
1616
]
1717
build-backend = "setuptools.build_meta"
1818

@@ -39,11 +39,11 @@ dependencies = [
3939
# We can't widen beyond the current value unless we bump the minimum
4040
# requirements too because of protobuf cross-version runtime guarantees:
4141
# https://protobuf.dev/support/cross-version-runtime-guarantee/#major
42-
"protobuf >= 6.32.0, < 8", # Do not widen beyond 8!
42+
"protobuf >= 6.33.4, < 8", # Do not widen beyond 8!
4343
# We couldn't find any document with a spec about the cross-version runtime
4444
# guarantee for grpcio, so unless we find one in the future, we'll assume
4545
# major version jumps are not compatible
46-
"grpcio >= 1.74.0, < 2", # Do not widen beyond 2!
46+
"grpcio >= 1.76.0, < 2", # Do not widen beyond 2!
4747
]
4848
dynamic = ["version"]
4949

0 commit comments

Comments
 (0)