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

feat: Add support for Python 3.13 #13198

Merged
merged 7 commits into from
Oct 24, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10', "3.11", "3.12"]
python: ['3.7', '3.8', '3.9', '3.10', "3.11", "3.12", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.12']
python: ['3.13']
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
8 changes: 6 additions & 2 deletions ci/run_single_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# This script requires the following environment variables to be set:
# `TEST_TYPE` should be one of ["lint", "lint_setup_py", "docs", "docfx", "prerelease"]
# `PY_VERSION` should be one of ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
# `PY_VERSION` should be one of ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

# This script is called by the `ci/run_conditional_tests.sh` script.
# A specific `nox` session will be run, depending on the value of
Expand Down Expand Up @@ -69,7 +69,7 @@ case ${TEST_TYPE} in
rm -rf docs/_build
;;
prerelease)
nox -s prerelease_deps-3.12
nox -s prerelease_deps-3.13
retval=$?
;;
unit)
Expand Down Expand Up @@ -98,6 +98,10 @@ case ${TEST_TYPE} in
nox -s unit-3.12
retval=$?
;;
"3.13")
nox -s unit-3.13
retval=$?
;;
*)
;;
esac
Expand Down
2 changes: 1 addition & 1 deletion packages/google-shopping-css/.flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
10 changes: 6 additions & 4 deletions packages/google-shopping-css/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In order to add a feature:
documentation.

- The feature must work fully on the following CPython versions:
3.7, 3.8, 3.9, 3.10, 3.11 and 3.12 on both UNIX and Windows.
3.7, 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13 on both UNIX and Windows.

- The feature must not add unnecessary dependencies (where
"unnecessary" is of course subjective, but new dependencies should
Expand Down Expand Up @@ -72,7 +72,7 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.

- To run a single unit test::

$ nox -s unit-3.12 -- -k <name of test>
$ nox -s unit-3.13 -- -k <name of test>


.. note::
Expand Down Expand Up @@ -143,12 +143,12 @@ Running System Tests
$ nox -s system

# Run a single system test
$ nox -s system-3.12 -- -k <name of test>
$ nox -s system-3.13 -- -k <name of test>


.. note::

System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11 and 3.12.
System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13.
For expediency, we do not run them in older versions of Python 3.

This alone will not run the tests. You'll need to change some local
Expand Down Expand Up @@ -227,13 +227,15 @@ We support:
- `Python 3.10`_
- `Python 3.11`_
- `Python 3.12`_
- `Python 3.13`_

.. _Python 3.7: https://docs.python.org/3.7/
.. _Python 3.8: https://docs.python.org/3.8/
.. _Python 3.9: https://docs.python.org/3.9/
.. _Python 3.10: https://docs.python.org/3.10/
.. _Python 3.11: https://docs.python.org/3.11/
.. _Python 3.12: https://docs.python.org/3.12/
.. _Python 3.13: https://docs.python.org/3.13/


Supported versions can be found in our ``noxfile.py`` `config`_.
Expand Down
2 changes: 1 addition & 1 deletion packages/google-shopping-css/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion packages/google-shopping-css/docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@
Attributes,
Certification,
CssProductStatus,
HeadlineOfferInstallment,
HeadlineOfferSubscriptionCost,
ProductDetail,
ProductDimension,
ProductWeight,
SubscriptionPeriod,
)
from google.shopping.css_v1.types.css_product_inputs import (
CssProductInput,
Expand Down Expand Up @@ -100,9 +103,12 @@
"Attributes",
"Certification",
"CssProductStatus",
"HeadlineOfferInstallment",
"HeadlineOfferSubscriptionCost",
"ProductDetail",
"ProductDimension",
"ProductWeight",
"SubscriptionPeriod",
"CssProductInput",
"DeleteCssProductInputRequest",
"InsertCssProductInputRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@
Attributes,
Certification,
CssProductStatus,
HeadlineOfferInstallment,
HeadlineOfferSubscriptionCost,
ProductDetail,
ProductDimension,
ProductWeight,
SubscriptionPeriod,
)
from .types.css_product_inputs import (
CssProductInput,
Expand Down Expand Up @@ -87,6 +90,8 @@
"DeleteCssProductInputRequest",
"GetAccountRequest",
"GetCssProductRequest",
"HeadlineOfferInstallment",
"HeadlineOfferSubscriptionCost",
"InsertCssProductInputRequest",
"ListAccountLabelsRequest",
"ListAccountLabelsResponse",
Expand All @@ -97,6 +102,7 @@
"ProductDetail",
"ProductDimension",
"ProductWeight",
"SubscriptionPeriod",
"UpdateAccountLabelRequest",
"UpdateAccountLabelsRequest",
)
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=BASE_DEFAULT_CLIENT_INFO.gapic_version,
grpc_version=None,
rest_version=requests_version,
rest_version=f"requests@{requests_version}",
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=BASE_DEFAULT_CLIENT_INFO.gapic_version,
grpc_version=None,
rest_version=requests_version,
rest_version=f"requests@{requests_version}",
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=BASE_DEFAULT_CLIENT_INFO.gapic_version,
grpc_version=None,
rest_version=requests_version,
rest_version=f"requests@{requests_version}",
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=BASE_DEFAULT_CLIENT_INFO.gapic_version,
grpc_version=None,
rest_version=requests_version,
rest_version=f"requests@{requests_version}",
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@
Attributes,
Certification,
CssProductStatus,
HeadlineOfferInstallment,
HeadlineOfferSubscriptionCost,
ProductDetail,
ProductDimension,
ProductWeight,
SubscriptionPeriod,
)
from .css_product_inputs import (
CssProductInput,
Expand Down Expand Up @@ -63,9 +66,12 @@
"Attributes",
"Certification",
"CssProductStatus",
"HeadlineOfferInstallment",
"HeadlineOfferSubscriptionCost",
"ProductDetail",
"ProductDimension",
"ProductWeight",
"SubscriptionPeriod",
"CssProductInput",
"DeleteCssProductInputRequest",
"InsertCssProductInputRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,38 @@
__protobuf__ = proto.module(
package="google.shopping.css.v1",
manifest={
"SubscriptionPeriod",
"Attributes",
"Certification",
"ProductDetail",
"ProductDimension",
"ProductWeight",
"CssProductStatus",
"HeadlineOfferSubscriptionCost",
"HeadlineOfferInstallment",
},
)


class SubscriptionPeriod(proto.Enum):
r"""The subscription period of the product.

Values:
SUBSCRIPTION_PERIOD_UNSPECIFIED (0):
Indicates that the subscription period is
unspecified.
MONTH (1):
Indicates that the subscription period is
month.
YEAR (2):
Indicates that the subscription period is
year.
"""
SUBSCRIPTION_PERIOD_UNSPECIFIED = 0
MONTH = 1
YEAR = 2


class Attributes(proto.Message):
r"""Attributes for CSS Product.

Expand Down Expand Up @@ -255,6 +277,13 @@ class Attributes(proto.Message):
in a Shopping campaign.

This field is a member of `oneof`_ ``_custom_label_4``.
headline_offer_installment (google.shopping.css_v1.types.HeadlineOfferInstallment):
Number and amount of installments to pay for
an item.
headline_offer_subscription_cost (google.shopping.css_v1.types.HeadlineOfferSubscriptionCost):
Number of periods (months or years) and
amount of payment per period for an item with an
associated subscription contract.
"""

cpp_link: str = proto.Field(
Expand Down Expand Up @@ -491,6 +520,16 @@ class Attributes(proto.Message):
number=50,
optional=True,
)
headline_offer_installment: "HeadlineOfferInstallment" = proto.Field(
proto.MESSAGE,
number=51,
message="HeadlineOfferInstallment",
)
headline_offer_subscription_cost: "HeadlineOfferSubscriptionCost" = proto.Field(
proto.MESSAGE,
number=52,
message="HeadlineOfferSubscriptionCost",
)


class Certification(proto.Message):
Expand Down Expand Up @@ -758,4 +797,67 @@ class ItemLevelIssue(proto.Message):
)


class HeadlineOfferSubscriptionCost(proto.Message):
r"""The SubscriptionCost of the product.

Attributes:
period (google.shopping.css_v1.types.SubscriptionPeriod):
The type of subscription period. Supported values are:

- "``month``"
- "``year``".
period_length (int):
The number of subscription periods the buyer
has to pay.
amount (google.shopping.type.types.Price):
The amount the buyer has to pay per
subscription period.
"""

period: "SubscriptionPeriod" = proto.Field(
proto.ENUM,
number=1,
enum="SubscriptionPeriod",
)
period_length: int = proto.Field(
proto.INT64,
number=2,
)
amount: types.Price = proto.Field(
proto.MESSAGE,
number=3,
message=types.Price,
)


class HeadlineOfferInstallment(proto.Message):
r"""A message that represents installment.

Attributes:
months (int):
The number of installments the buyer has to
pay.
amount (google.shopping.type.types.Price):
The amount the buyer has to pay per month.
downpayment (google.shopping.type.types.Price):
The up-front down payment amount the buyer
has to pay.
"""

months: int = proto.Field(
proto.INT64,
number=1,
)
amount: types.Price = proto.Field(
proto.MESSAGE,
number=2,
message=types.Price,
)
downpayment: types.Price = proto.Field(
proto.MESSAGE,
number=3,
message=types.Price,
)


__all__ = tuple(sorted(__protobuf__.manifest))
Loading
Loading