Skip to content

Commit 7271398

Browse files
committed
Merge remote-tracking branch 'remote.googleapis/proto-plus-python/main' into migration.proto-plus-python.migration.2025-11-24_21-55-24.migrate
2 parents 0737369 + 0549036 commit 7271398

File tree

107 files changed

+10332
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+10332
-0
lines changed

packages/proto-plus/.coveragerc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[run]
2+
branch = True
3+
4+
[report]
5+
show_missing = True
6+
omit =
7+
proto/marshal/compat.py
8+
exclude_lines =
9+
# Re-enable the standard pragma
10+
pragma: NO COVER
11+
# Ignore debug-only repr
12+
def __repr__

packages/proto-plus/.flake8

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[flake8]
2+
ignore =
3+
# Closing bracket mismatches opening bracket's line.
4+
# This works poorly with type annotations in method declarations.
5+
E123, E124
6+
# Line over-indented for visual indent.
7+
# This works poorly with type annotations in method declarations.
8+
E128, E131
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Code owners file.
2+
# This file controls who is tagged for review for any given pull request.
3+
4+
# For syntax help see:
5+
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
6+
7+
* @googleapis/python-core-client-libraries
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- main
5+
name: lint
6+
jobs:
7+
lint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- name: Setup Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: "3.10"
16+
- name: Install nox
17+
run: |
18+
python -m pip install --upgrade setuptools pip wheel
19+
python -m pip install nox
20+
- name: Run lint_setup_py
21+
run: |
22+
nox -s lint_setup_py
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: Tests
2+
3+
# Controls when the action will run.
4+
on:
5+
pull_request:
6+
push:
7+
branches: [ $default-branch ]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: tests-${{ github.head_ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
style-check:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Set up Python 3.8
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: 3.8
25+
- name: Install black
26+
run: pip install black==22.3.0
27+
- name: Check diff
28+
run: black --diff --check .
29+
docs:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Set up Python 3.10
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: "3.10"
37+
- name: Install nox.
38+
run: python -m pip install nox
39+
- name: Build the documentation.
40+
run: nox -s docs
41+
unit:
42+
runs-on: ubuntu-22.04
43+
strategy:
44+
matrix:
45+
# See https://github.com/actions/setup-python?tab=readme-ov-file#basic-usage
46+
# for the format of the entries in 'python'.
47+
# See https://downloads.python.org/pypy/ for the current supported versions of PyPy.
48+
python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', 'pypy3.10']
49+
variant: ['cpp', 'python', 'upb']
50+
# TODO(https://github.com/googleapis/proto-plus-python/issues/389):
51+
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
52+
# The 'cpp' implementation requires Protobuf == 3.x however version 3.x
53+
# does not support Python 3.11 and newer. The 'cpp' implementation
54+
# must be excluded from the test matrix for these runtimes.
55+
exclude:
56+
- variant: "cpp"
57+
python: 3.11
58+
- variant: "cpp"
59+
python: 3.12
60+
- variant: "cpp"
61+
python: 3.13
62+
- variant: "cpp"
63+
python: 3.14
64+
# In PyPy 3.10, we see the following warning
65+
# UserWarning: Selected implementation upb is not available. Falling back to the python implementation.
66+
- variant: "upb"
67+
python: 'pypy3.10'
68+
# In PyPy 3.10, we see the following warning
69+
# UserWarning: PyPy does not work yet with cpp protocol buffers. Falling back to the python implementation.
70+
- variant: "cpp"
71+
python: 'pypy3.10'
72+
steps:
73+
- uses: actions/checkout@v4
74+
- name: Set up Python ${{ matrix.python }}
75+
uses: actions/setup-python@v5
76+
with:
77+
python-version: ${{ matrix.python }}
78+
allow-prereleases: true
79+
- name: Install nox
80+
run: |
81+
pip install nox
82+
- name: Run unit tests
83+
env:
84+
COVERAGE_FILE: .coverage-${{ matrix.variant }}-${{ matrix.python }}
85+
run: |
86+
nox -s "unit-${{ matrix.python }}(implementation='${{ matrix.variant }}')"
87+
- name: Upload coverage results
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: coverage-artifact-${{ matrix.variant }}-${{ matrix.python }}
91+
path: .coverage-${{ matrix.variant }}-${{ matrix.python }}
92+
include-hidden-files: true
93+
prerelease:
94+
runs-on: ubuntu-22.04
95+
strategy:
96+
matrix:
97+
python: ['3.14']
98+
variant: ['python', 'upb']
99+
steps:
100+
- uses: actions/checkout@v4
101+
- name: Set up Python ${{ matrix.python }}
102+
uses: actions/setup-python@v5
103+
with:
104+
python-version: ${{ matrix.python }}
105+
allow-prereleases: true
106+
- name: Install nox
107+
run: |
108+
pip install nox
109+
- name: Run unit tests
110+
env:
111+
COVERAGE_FILE: .coverage-prerelease-${{ matrix.variant }}
112+
run: |
113+
nox -s "prerelease_deps(implementation='${{ matrix.variant }}')"
114+
- name: Upload coverage results
115+
uses: actions/upload-artifact@v4
116+
with:
117+
name: coverage-artifact-prerelease-${{ matrix.variant }}
118+
path: .coverage-prerelease-${{ matrix.variant }}
119+
cover:
120+
runs-on: ubuntu-latest
121+
needs:
122+
- unit
123+
steps:
124+
- name: Checkout
125+
uses: actions/checkout@v4
126+
- name: Setup Python
127+
uses: actions/setup-python@v5
128+
with:
129+
python-version: "3.10"
130+
- name: Install coverage
131+
run: |
132+
python -m pip install --upgrade setuptools pip wheel
133+
python -m pip install coverage
134+
- name: Download coverage results
135+
uses: actions/download-artifact@v4
136+
with:
137+
path: .coverage-results/
138+
- name: Report coverage results
139+
run: |
140+
find .coverage-results -type f -name '*.zip' -exec unzip {} \;
141+
coverage combine .coverage-results/**/.coverage*
142+
coverage report --show-missing --fail-under=100

packages/proto-plus/.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
*.py[cod]
2+
*.sw[op]
3+
4+
# C extensions
5+
*.so
6+
7+
# Packages
8+
*.egg
9+
*.egg-info
10+
dist
11+
build
12+
eggs
13+
parts
14+
bin
15+
var
16+
sdist
17+
develop-eggs
18+
.installed.cfg
19+
lib
20+
lib64
21+
__pycache__
22+
23+
# Installer logs
24+
pip-log.txt
25+
26+
# Unit test / coverage reports
27+
.coverage
28+
.nox
29+
.tox
30+
.cache
31+
.pytest_cache
32+
htmlcov
33+
34+
# Translations
35+
*.mo
36+
37+
# Mac
38+
.DS_Store
39+
40+
# Mr Developer
41+
.mr.developer.cfg
42+
.project
43+
.pydevproject
44+
45+
# JetBrains
46+
.idea
47+
48+
# Built documentation
49+
docs/_build
50+
docs/_build_doc2dash
51+
52+
# Virtual environment
53+
env/
54+
coverage.xml
55+
56+
# System test environment variables.
57+
system_tests/local_test_setup
58+
59+
# Make sure a generated file isn't accidentally committed.
60+
pylintrc
61+
pylintrc.test
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:8e2c32496077054105bd06c54a59d6a6694287bc053588e24debe6da6920ad91
2+
libraries:
3+
- id: proto-plus
4+
version: 1.26.1
5+
apis: []
6+
source_roots:
7+
- .
8+
preserve_regex: []
9+
remove_regex: []
10+
tag_format: v{version}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
build:
3+
image: latest
4+
python:
5+
pip_install: true
6+
version: 3.9
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "proto-plus",
3+
"name_pretty": "Proto Plus",
4+
"client_documentation": "https://googleapis.dev/python/proto-plus/latest",
5+
"release_level": "stable",
6+
"language": "python",
7+
"library_type": "CORE",
8+
"repo": "googleapis/proto-plus-python",
9+
"distribution_name": "proto-plus",
10+
"default_version": "",
11+
"codeowner_team": ""
12+
}

0 commit comments

Comments
 (0)