diff --git a/CHANGELOG.md b/CHANGELOG.md index dd90738..f42035f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ [1]: https://pypi.org/project/google-cloud-core/#history +## [2.4.0rc1](https://github.com/googleapis/python-cloud-core/compare/v2.3.3...v2.4.0rc1) (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/_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/google/cloud/version.py b/google/cloud/version.py index a95986d..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.3.3" +__version__ = "2.4.0rc1" 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