Skip to content
Draft
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
35 changes: 30 additions & 5 deletions .github/workflows/gapic-generator-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ env:
SHOWCASE_VERSION: 0.35.0
PROTOC_VERSION: 3.20.2
LATEST_STABLE_PYTHON: 3.14
ALL_PYTHON: "['3.10', '3.11', '3.12', '3.13', '3.14']"
PRERELEASE_PYTHON: 3.15
ALL_PYTHON: "['3.10', '3.11', '3.12', '3.13', '3.14', '3.15']"
TRIMMED_PYTHON: "['3.10', '3.14', '3.15']"
# Workaround: Allows libcst to compile on Python 3.15+ while PyO3 catches up
# Can be removed once libcst releases a version with native Python 3.15 wheels
# Follow https://github.com/Instagram/LibCST/issues/1445 for updates.
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"

jobs:
check_changes:
Expand Down Expand Up @@ -47,6 +53,8 @@ jobs:
outputs:
all_python: ${{ env.ALL_PYTHON }}
latest_stable_python: ${{ env.LATEST_STABLE_PYTHON }}
prerelease_python: ${{ env.PRERELEASE_PYTHON }}
trimmed_python: $${{ env.TRIMMED_PYTHON }}
steps:
- run: echo "Initializing config for gapic-generator"

Expand All @@ -65,6 +73,12 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: "${{ matrix.python }}"
allow-prereleases: true
# Caches compiled wheels locally to prevent building heavy libraries
# such as grpcio, which we build from scratch on every run for Python 3.15+.
# Follow https://github.com/grpc/grpc/issues/41010 for updates.
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install System Deps & Protoc
run: |
sudo apt-get update && sudo apt-get install -y curl pandoc unzip
Expand Down Expand Up @@ -132,10 +146,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
- name: Set up Python ${{ needs.python_config.outputs.prerelease_python }}
uses: actions/setup-python@v6
with:
python-version: ${{ needs.python_config.outputs.latest_stable_python }}
python-version: ${{ needs.python_config.outputs.prerelease_python }}
allow-prereleases: true
# Caches compiled wheels locally to prevent building heavy libraries
# such as grpcio, which we build from scratch on every run for Python 3.15+.
# Follow https://github.com/grpc/grpc/issues/41010 for updates.
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install System Deps
run: sudo apt-get update && sudo apt-get install -y pandoc
- name: Run Goldens (Prerelease)
Expand All @@ -150,15 +170,20 @@ jobs:
needs: python_config
strategy:
matrix:
python: ["3.10", "3.14"]
python: ${{ fromJSON(needs.python_config.outputs.trimmed_python) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
# This fixes the Pandoc error
allow-prereleases: true
# Caches compiled wheels locally to prevent building heavy libraries
# such as grpcio, which we build from scratch on every run for Python 3.15+.
# Follow https://github.com/grpc/grpc/issues/41010 for updates.
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install System Deps & Protoc
run: |
sudo apt-get update && sudo apt-get install -y curl pandoc unzip
Expand Down
8 changes: 3 additions & 5 deletions packages/gapic-generator/gapic/templates/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ ALL_PYTHON = [
"3.12",
"3.13",
"3.14",
"3.15",
]

DEFAULT_PYTHON_VERSION = "3.14"

# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
# Switch this to Python 3.15 alpha1
# https://peps.python.org/pep-0790/
PREVIEW_PYTHON_VERSION = "3.14"
PREVIEW_PYTHON_VERSION = "3.15"
Comment thread
parthea marked this conversation as resolved.

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()

Expand Down Expand Up @@ -567,7 +565,7 @@ def prerelease_deps(session, protobuf_implementation):
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
@nox.session(python=PREVIEW_PYTHON_VERSION)
@nox.parametrize(
"protobuf_implementation",
["python", "upb"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% from '_pypi_packages.j2' import pypi_packages %}
# We use the constraints file for the latest Python version
# (currently this file) to check that the latest
# major versions of dependencies are supported in setup.py.
# List all library dependencies and extras in this file.
# Require the latest major version be installed for each dependency.
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# Then this file should have google-cloud-foo>=1
google-api-core>=2
google-auth>=2
grpcio>=1
proto-plus>=1
protobuf>=7
{% for package_tuple, package_info in pypi_packages.items() %}
{# Quick check to make sure `package_info.package_name` is not the package being generated so we don't circularly include this package in its own constraints file. #}
{% if api.naming.warehouse_package_name != package_info.package_name %}
{% if api.requires_package(package_tuple) %}
{{ package_info.package_name }}>={{ (package_info.upper_bound.split(".")[0] | int) - 1 }}
{% endif %}
{% endif %}
{% endfor %}
3 changes: 2 additions & 1 deletion packages/gapic-generator/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@
"3.12",
"3.13",
"3.14",
"3.15",
)

NEWEST_PYTHON = ALL_PYTHON[-1]
NEWEST_PYTHON = ALL_PYTHON[-2]


@nox.session(python=ALL_PYTHON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@
"3.12",
"3.13",
"3.14",
"3.15",
]

DEFAULT_PYTHON_VERSION = "3.14"

# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
# Switch this to Python 3.15 alpha1
# https://peps.python.org/pep-0790/
PREVIEW_PYTHON_VERSION = "3.14"
PREVIEW_PYTHON_VERSION = "3.15"

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()

Expand Down Expand Up @@ -559,7 +557,7 @@ def prerelease_deps(session, protobuf_implementation):
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
@nox.session(python=PREVIEW_PYTHON_VERSION)
@nox.parametrize(
"protobuf_implementation",
["python", "upb"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# We use the constraints file for the latest Python version
# (currently this file) to check that the latest
# major versions of dependencies are supported in setup.py.
# List all library dependencies and extras in this file.
# Require the latest major version be installed for each dependency.
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# Then this file should have google-cloud-foo>=1
google-api-core>=2
google-auth>=2
grpcio>=1
proto-plus>=1
protobuf>=7
google-cloud-access-context-manager>=0
google-cloud-os-config>=1
grpc-google-iam-v1>=0
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@
"3.12",
"3.13",
"3.14",
"3.15",
]

DEFAULT_PYTHON_VERSION = "3.14"

# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
# Switch this to Python 3.15 alpha1
# https://peps.python.org/pep-0790/
PREVIEW_PYTHON_VERSION = "3.14"
PREVIEW_PYTHON_VERSION = "3.15"

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()

Expand Down Expand Up @@ -559,7 +557,7 @@ def prerelease_deps(session, protobuf_implementation):
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
@nox.session(python=PREVIEW_PYTHON_VERSION)
@nox.parametrize(
"protobuf_implementation",
["python", "upb"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# We use the constraints file for the latest Python version
# (currently this file) to check that the latest
# major versions of dependencies are supported in setup.py.
# List all library dependencies and extras in this file.
# Require the latest major version be installed for each dependency.
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# Then this file should have google-cloud-foo>=1
google-api-core>=2
google-auth>=2
grpcio>=1
proto-plus>=1
protobuf>=7
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@
"3.12",
"3.13",
"3.14",
"3.15",
]

DEFAULT_PYTHON_VERSION = "3.14"

# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
# Switch this to Python 3.15 alpha1
# https://peps.python.org/pep-0790/
PREVIEW_PYTHON_VERSION = "3.14"
PREVIEW_PYTHON_VERSION = "3.15"

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()

Expand Down Expand Up @@ -559,7 +557,7 @@ def prerelease_deps(session, protobuf_implementation):
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
@nox.session(python=PREVIEW_PYTHON_VERSION)
@nox.parametrize(
"protobuf_implementation",
["python", "upb"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# We use the constraints file for the latest Python version
# (currently this file) to check that the latest
# major versions of dependencies are supported in setup.py.
# List all library dependencies and extras in this file.
# Require the latest major version be installed for each dependency.
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# Then this file should have google-cloud-foo>=1
google-api-core>=2
google-auth>=2
grpcio>=1
proto-plus>=1
protobuf>=7
grpc-google-iam-v1>=0
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@
"3.12",
"3.13",
"3.14",
"3.15",
]

DEFAULT_PYTHON_VERSION = "3.14"

# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
# Switch this to Python 3.15 alpha1
# https://peps.python.org/pep-0790/
PREVIEW_PYTHON_VERSION = "3.14"
PREVIEW_PYTHON_VERSION = "3.15"

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()

Expand Down Expand Up @@ -559,7 +557,7 @@ def prerelease_deps(session, protobuf_implementation):
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
@nox.session(python=PREVIEW_PYTHON_VERSION)
@nox.parametrize(
"protobuf_implementation",
["python", "upb"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# We use the constraints file for the latest Python version
# (currently this file) to check that the latest
# major versions of dependencies are supported in setup.py.
# List all library dependencies and extras in this file.
# Require the latest major version be installed for each dependency.
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# Then this file should have google-cloud-foo>=1
google-api-core>=2
google-auth>=2
grpcio>=1
proto-plus>=1
protobuf>=7
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@
"3.12",
"3.13",
"3.14",
"3.15",
]

DEFAULT_PYTHON_VERSION = "3.14"

# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
# Switch this to Python 3.15 alpha1
# https://peps.python.org/pep-0790/
PREVIEW_PYTHON_VERSION = "3.14"
PREVIEW_PYTHON_VERSION = "3.15"

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()

Expand Down Expand Up @@ -559,7 +557,7 @@ def prerelease_deps(session, protobuf_implementation):
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
@nox.session(python=PREVIEW_PYTHON_VERSION)
@nox.parametrize(
"protobuf_implementation",
["python", "upb"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# We use the constraints file for the latest Python version
# (currently this file) to check that the latest
# major versions of dependencies are supported in setup.py.
# List all library dependencies and extras in this file.
# Require the latest major version be installed for each dependency.
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# Then this file should have google-cloud-foo>=1
google-api-core>=2
google-auth>=2
grpcio>=1
proto-plus>=1
protobuf>=7
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@
"3.12",
"3.13",
"3.14",
"3.15",
]

DEFAULT_PYTHON_VERSION = "3.14"

# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
# Switch this to Python 3.15 alpha1
# https://peps.python.org/pep-0790/
PREVIEW_PYTHON_VERSION = "3.14"
PREVIEW_PYTHON_VERSION = "3.15"

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()

Expand Down Expand Up @@ -559,7 +557,7 @@ def prerelease_deps(session, protobuf_implementation):
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
@nox.session(python=PREVIEW_PYTHON_VERSION)
@nox.parametrize(
"protobuf_implementation",
["python", "upb"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# We use the constraints file for the latest Python version
# (currently this file) to check that the latest
# major versions of dependencies are supported in setup.py.
# List all library dependencies and extras in this file.
# Require the latest major version be installed for each dependency.
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# Then this file should have google-cloud-foo>=1
google-api-core>=2
google-auth>=2
grpcio>=1
proto-plus>=1
protobuf>=7
Loading
Loading