From e05a0eafd5a0b31c268528a048f3f3a673ee2f78 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sun, 3 Dec 2023 11:16:06 +0000 Subject: [PATCH 1/3] chore(main): release 2.4.0 --- CHANGELOG.md | 8 ++++++++ google/cloud/version.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd90738..b35f6f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://pypi.org/project/google-cloud-core/#history +## [2.4.0](https://github.com/googleapis/python-cloud-core/compare/v2.3.3...v2.4.0) (2023-12-03) + + +### Features + +* Add support for Python 3.12 ([#256](https://github.com/googleapis/python-cloud-core/issues/256)) ([988a8af](https://github.com/googleapis/python-cloud-core/commit/988a8af3fe5cf2c5f37e08c62b10dcd89e6333c1)) +* Introduce compatibility with native namespace packages ([#260](https://github.com/googleapis/python-cloud-core/issues/260)) ([fd1ef6e](https://github.com/googleapis/python-cloud-core/commit/fd1ef6e03252edca3641cc26ec227a00b4f44221)) + ## [2.3.3](https://github.com/googleapis/python-cloud-core/compare/v2.3.2...v2.3.3) (2023-06-29) diff --git a/google/cloud/version.py b/google/cloud/version.py index a95986d..fe11624 100644 --- a/google/cloud/version.py +++ b/google/cloud/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "2.3.3" +__version__ = "2.4.0" From e55a9ec9411afaf67ef0b5897f227fd7e22762ee Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 4 Dec 2023 20:22:25 +0000 Subject: [PATCH 2/3] build: treat warnings as errors --- google/cloud/_helpers/__init__.py | 2 +- noxfile.py | 4 ++-- pytest.ini | 9 +++++++++ setup.py | 8 ++++++-- tests/unit/test__helpers.py | 4 ++-- 5 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 pytest.ini diff --git a/google/cloud/_helpers/__init__.py b/google/cloud/_helpers/__init__.py index 5a7e2b0..e0be5cc 100644 --- a/google/cloud/_helpers/__init__.py +++ b/google/cloud/_helpers/__init__.py @@ -39,7 +39,7 @@ grpc = None -_NOW = datetime.datetime.utcnow # To be replaced by tests. +_NOW = datetime.datetime.now(datetime.timezone.utc) UTC = datetime.timezone.utc # Singleton instance to be used throughout. _EPOCH = datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc) diff --git a/noxfile.py b/noxfile.py index c79a18d..6a318e6 100644 --- a/noxfile.py +++ b/noxfile.py @@ -73,8 +73,8 @@ def default(session): ) # Install all test dependencies, then install local packages in-place. - session.install("pytest", "pytest-cov", "grpcio >= 1.0.2", "-c", constraints_path) - session.install("-e", ".", "-c", constraints_path) + session.install("pytest", "pytest-cov", "-c", constraints_path) + session.install("-e", ".[grpc]", "-c", constraints_path) # Run py.test against the unit tests. session.run( diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..76b110d --- /dev/null +++ b/pytest.ini @@ -0,0 +1,9 @@ +[pytest] +filterwarnings = + # treat all warnings as errors + error + # Remove once https://github.com/protocolbuffers/protobuf/issues/12186 is fixed + ignore:.*custom tp_new.*in Python 3.14:DeprecationWarning + # Remove once Release PR https://github.com/googleapis/python-api-common-protos/pull/191 is merged + ignore:.*pkg_resources.declare_namespace:DeprecationWarning + ignore:.*pkg_resources is deprecated as an API:DeprecationWarning diff --git a/setup.py b/setup.py index 62b5cb6..eced53a 100644 --- a/setup.py +++ b/setup.py @@ -32,8 +32,12 @@ "google-auth >= 1.25.0, < 3.0dev", "importlib-metadata > 1.0.0; python_version<'3.8'", ] -extras = {"grpc": "grpcio >= 1.38.0, < 2.0dev"} - +extras = { + "grpc": [ + "grpcio >= 1.38.0, < 2.0dev", + "grpcio-status >= 1.38.0, < 2.0.dev0", + ], +} # Setup boilerplate below this line. diff --git a/tests/unit/test__helpers.py b/tests/unit/test__helpers.py index 77f32da..2901602 100644 --- a/tests/unit/test__helpers.py +++ b/tests/unit/test__helpers.py @@ -138,7 +138,7 @@ def test_w_utc_datetime(self): from google.cloud._helpers import UTC from google.cloud._helpers import _microseconds_from_datetime - NOW = datetime.datetime.utcnow().replace(tzinfo=UTC) + NOW = datetime.datetime.now().replace(tzinfo=UTC) NOW_MICROS = _microseconds_from_datetime(NOW) MILLIS = NOW_MICROS // 1000 result = self._call_fut(NOW) @@ -163,7 +163,7 @@ def test_w_naive_datetime(self): from google.cloud._helpers import UTC from google.cloud._helpers import _microseconds_from_datetime - NOW = datetime.datetime.utcnow() + NOW = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None) UTC_NOW = NOW.replace(tzinfo=UTC) UTC_NOW_MICROS = _microseconds_from_datetime(UTC_NOW) MILLIS = UTC_NOW_MICROS // 1000 From 78d2180398ab806178d2a36f3200dcc652b8b218 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 4 Dec 2023 20:27:21 +0000 Subject: [PATCH 3/3] chore: release candidate 2.4.0rc1 --- CHANGELOG.md | 2 +- google/cloud/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b35f6f1..f42035f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ [1]: https://pypi.org/project/google-cloud-core/#history -## [2.4.0](https://github.com/googleapis/python-cloud-core/compare/v2.3.3...v2.4.0) (2023-12-03) +## [2.4.0rc1](https://github.com/googleapis/python-cloud-core/compare/v2.3.3...v2.4.0rc1) (2023-12-03) ### Features diff --git a/google/cloud/version.py b/google/cloud/version.py index fe11624..fa4c22e 100644 --- a/google/cloud/version.py +++ b/google/cloud/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "2.4.0" +__version__ = "2.4.0rc1"