Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(main): Release candidate v1.24.0.dev0 #434

Closed
wants to merge 7 commits into from
Closed
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
17 changes: 10 additions & 7 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,27 @@ branchProtectionRules:
requiredStatusCheckContexts:
- 'style-check'
- 'docs'
- 'unit (3.6)'
- 'unit (3.6, cpp)'
- 'unit (3.7)'
- 'unit (3.6, python)'
- 'unit (3.6, upb)'
- 'unit (3.7, cpp)'
- 'unit (3.7, python)'
- 'unit (3.7, upb)'
- 'unit (3.8)'
- 'unit (3.8, cpp)'
- 'unit (3.8, python)'
- 'unit (3.8, upb)'
- 'unit (3.9)'
- 'unit (3.9, cpp)'
- 'unit (3.9, python)'
- 'unit (3.9, upb)'
- 'unit (3.10)'
- 'unit (3.10, cpp)'
- 'unit (3.10, python)'
- 'unit (3.10, upb)'
- 'unit (3.11)'
- 'unit (3.11, python)'
- 'unit (3.11, upb)'
- 'unit (3.12)'
- 'unit (3.12, python)'
- 'unit (3.12, upb)'
- 'prerelease (3.12, python)'
- 'prerelease (3.12, upb)'
- cover
- OwlBot Post Processor
- 'cla/google'
Expand Down
35 changes: 32 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,22 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
variant: ['', 'cpp', 'upb']
python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
variant: ['cpp', 'python', 'upb']
exclude:
- variant: "cpp"
python: 3.11
- variant: "cpp"
python: 3.12
- variant: "cpp"
python: 3.13
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- name: Install nox
run: |
pip install nox
Expand All @@ -68,12 +71,38 @@ jobs:
env:
COVERAGE_FILE: .coverage-${{ matrix.variant }}-${{ env.PYTHON_VERSION_TRIMMED }}
run: |
nox -s unit${{ matrix.variant }}-${{ env.PYTHON_VERSION_TRIMMED }}
nox -s "unit-${{ env.PYTHON_VERSION_TRIMMED }}(implementation='${{ matrix.variant }}')"
- name: Upload coverage results
uses: actions/upload-artifact@v4
with:
name: coverage-artifact-${{ matrix.variant }}-${{ env.PYTHON_VERSION_TRIMMED }}
path: .coverage-${{ matrix.variant }}-${{ env.PYTHON_VERSION_TRIMMED }}
prerelease:
runs-on: ubuntu-20.04
strategy:
matrix:
python: ['3.12']
variant: ['python', 'upb']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- name: Install nox
run: |
pip install nox
- name: Run unit tests
env:
COVERAGE_FILE: .coverage-prerelease-${{ matrix.variant }}
run: |
nox -s "prerelease_deps(implementation='${{ matrix.variant }}')"
- name: Upload coverage results
uses: actions/upload-artifact@v4
with:
name: coverage-artifact-prerelease-${{ matrix.variant }}
path: .coverage-prerelease-${{ matrix.variant }}
cover:
runs-on: ubuntu-latest
needs:
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## [1.24.0.dev0](https://github.com/googleapis/proto-plus-python/compare/v1.22.3...v1.24.0dev0) (2024-02-14)


### Features

* Add `always_print_fields_with_no_presence` fields to `to_json` and `to_dict` ([#433])(https://github.com/googleapis/proto-plus-python/pull/433)


### Bug Fixes

* Fix compatibility with `protobuf==5.26.0rc2` ([#433])(https://github.com/googleapis/proto-plus-python/pull/433)


### Documentation

* Deprecate field `including_default_value_fields` in `to_json` and `to_dict` ([#433])(https://github.com/googleapis/proto-plus-python/pull/433)


## [1.23.0](https://github.com/googleapis/proto-plus-python/compare/v1.22.3...v1.23.0) (2023-12-01)


Expand Down
75 changes: 59 additions & 16 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
# limitations under the License.

from __future__ import absolute_import
import os
import pathlib

import nox
import pathlib


CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
Expand All @@ -30,33 +29,35 @@
"3.10",
"3.11",
"3.12",
"3.13",
]

# Error if a python version is missing
nox.options.error_on_missing_interpreters = True


@nox.session(python=PYTHON_VERSIONS)
def unit(session, proto="python"):
@nox.parametrize("implementation", ["cpp", "upb", "python"])
def unit(session, implementation):
"""Run the unit test suite."""

constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)

session.env["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = proto
session.env["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = implementation
session.install("coverage", "pytest", "pytest-cov", "pytz")
session.install("-e", ".[testing]", "-c", constraints_path)
if proto == "cpp": # 4.20 does not have cpp.
if implementation == "cpp": # 4.20 does not have cpp.
session.install("protobuf==3.19.0")

# TODO(https://github.com/googleapis/proto-plus-python/issues/403): re-enable `-W=error`
# The warnings-as-errors flag `-W=error` was removed in
# https://github.com/googleapis/proto-plus-python/pull/400.
# It should be re-added once issue
# https://github.com/protocolbuffers/protobuf/issues/12186 is fixed.
# https://github.com/protocolbuffers/protobuf/issues/15077 is fixed.
session.run(
"py.test",
"pytest",
"--quiet",
*(
session.posargs # Coverage info when running individual tests is annoying.
Expand All @@ -71,17 +72,59 @@ 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", "3.10"])
def unitcpp(session):
return unit(session, proto="cpp")
# Only test upb and python implementation backends.
# As of protobuf 4.x, the "ccp" implementation is not available in the PyPI pacakge as per
# https://github.com/protocolbuffers/protobuf/tree/main/python#implementation-backends
@nox.session(python=PYTHON_VERSIONS[-2])
@nox.parametrize("implementation", ["python", "upb"])
def prerelease_deps(session, implementation):
"""Run the unit test suite against pre-release versions of dependencies."""

session.env["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = implementation

@nox.session(python=PYTHON_VERSIONS)
def unitupb(session):
return unit(session, proto="upb")
# Install test environment dependencies
session.install("coverage", "pytest", "pytest-cov", "pytz")

# Install the package without dependencies
session.install("-e", ".", "--no-deps")

prerel_deps = [
"google-api-core",
# dependency of google-api-core
"googleapis-common-protos",
]

for dep in prerel_deps:
session.install("--pre", "--no-deps", "--upgrade", dep)

session.install("--pre", "--upgrade", "protobuf")
# Print out prerelease package versions
session.run(
"python", "-c", "import google.protobuf; print(google.protobuf.__version__)"
)
session.run(
"python", "-c", "import google.api_core; print(google.api_core.__version__)"
)

# TODO(https://github.com/googleapis/proto-plus-python/issues/403): re-enable `-W=error`
# The warnings-as-errors flag `-W=error` was removed in
# https://github.com/googleapis/proto-plus-python/pull/400.
# It should be re-added once issue
# https://github.com/protocolbuffers/protobuf/issues/15077 is fixed.
session.run(
"pytest",
"--quiet",
*(
session.posargs # Coverage info when running individual tests is annoying.
or [
"--cov=proto",
"--cov-config=.coveragerc",
"--cov-report=term",
"--cov-report=html",
"tests",
]
),
)


@nox.session(python="3.9")
Expand Down
Loading