GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add support for python 3.12 by parthea · Pull Request #400 · googleapis/proto-plus-python

This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Conversation

@parthea

@parthea parthea commented Oct 19, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Fixes #401
Fixes #402

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
parthea added 4 commits October 19, 2023 11:38
@parthea
feat: add support for python 3.12
78596e0
@parthea
update exclude
cfbe2b2
@parthea
update noxfile
8401473
@parthea
add contraints file
f15707b
@parthea

parthea commented Oct 19, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author
nox > py.test -W=error --quiet --cov=proto --cov-config=.coveragerc --cov-report=term --cov-report=html tests
ImportError while loading conftest '/home/runner/work/proto-plus-python/proto-plus-python/tests/conftest.py'.
tests/conftest.py:[18](https://github.com/googleapis/proto-plus-python/actions/runs/6577031279/job/17867761605?pr=400#step:6:19): in <module>
    from google.protobuf import descriptor_pool
.nox/unitupb-3-12/lib/python3.12/site-packages/google/protobuf/descriptor_pool.py:63: in <module>
    from google.protobuf import descriptor
.nox/unitupb-3-12/lib/python3.12/site-packages/google/protobuf/descriptor.py:40: in <module>
    from google.protobuf.internal import api_implementation
.nox/unitupb-3-12/lib/python3.12/site-packages/google/protobuf/internal/api_implementation.py:74: in <module>
    if _CanImport('google._upb._message'):
.nox/unitupb-3-12/lib/python3.12/site-packages/google/protobuf/internal/api_implementation.py:64: in _CanImport
    mod = importlib.import_module(mod_name)
E   SystemError: <class 'DeprecationWarning'> returned a result with an exception set

See related thread protocolbuffers/protobuf#12186. @ohmayr and I are looking into it.

EDIT: The reason that there is a SystemError is because we're treating warnings as errors when we run tests

proto-plus-python/noxfile.py

Line 53 in a9700cb

"-W=error",

If we remove -W=error all tests pass.

The warnings that appear are as follows:

<frozen importlib._bootstrap>:488
  <frozen importlib._bootstrap>:488: DeprecationWarning: Type google._upb._message.MessageMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14.

<frozen importlib._bootstrap>:488
  <frozen importlib._bootstrap>:488: DeprecationWarning: Type google._upb._message.ScalarMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14.

.nox/unit-3-12/lib/python3.12/site-packages/google/protobuf/internal/well_known_types.py:93
  /usr/local/google/home/partheniou/git/proto-plus-python/.nox/unit-3-12/lib/python3.12/site-packages/google/protobuf/internal/well_known_types.py:93: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    _EPOCH_DATETIME_NAIVE = datetime.datetime.utcfromtimestamp(0)

proto/datetime_helpers.py:24
  /usr/local/google/home/partheniou/git/proto-plus-python/proto/datetime_helpers.py:24: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    _UTC_EPOCH = datetime.datetime.utcfromtimestamp(0).replace(tzinfo=datetime.timezone.utc)

Filed #401 for the warning related to proto-plus. The other 3 warnings are in the protobuf code. I'll disable warnings as errors and file a bug to re-enable the -W=error flag once the warnings are fixed upstream.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@parthea
Disable warnings as errors
a45307e
@parthea
parthea marked this pull request as ready for review October 19, 2023 16:58
@parthea
parthea requested review from a team October 19, 2023 16:58
vchudnov-g
vchudnov-g approved these changes Oct 19, 2023
View reviewed changes
parthea added 2 commits October 19, 2023 17:08
@parthea
use datetime.datetime.fromtimestamp instead of datetime.datetime.utcf…
9f1161c
…romtimestamp(0) which is deprecated
@parthea
use datetime.timezone.utc
72c40a8
@ohmayr
ohmayr self-requested a review October 19, 2023 17:15
ohmayr
ohmayr approved these changes Oct 19, 2023
View reviewed changes
vchudnov-g
vchudnov-g approved these changes Oct 19, 2023
View reviewed changes
@parthea parthea mentioned this pull request Jan 12, 2026
Re-enable warnings as errors in unit nox session googleapis/google-cloud-python#15118
Closed
@parthea
add comment
4e673b8
vchudnov-g
vchudnov-g approved these changes Oct 19, 2023
View reviewed changes
Comment thread noxfile.py
if proto == "cpp": # 4.20 does not have cpp.
session.install("protobuf==3.19.0")

# The warnings as errors flag `-W=error` was removed in

@vchudnov-g vchudnov-g Oct 19, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth filing an issue for this, and linking it here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@parthea parthea Oct 19, 2023

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in https://github.com/googleapis/proto-plus-python/issues/403

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vchudnov-g vchudnov-g Oct 19, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. #403 is the issue tracking this. So fixing #403 MEANS re-enabling the warning.

Suggested change
# The warnings as errors flag `-W=error` was removed in
# TODO(https://github.com/googleapis/proto-plus-python/issues/403): re-enable -W=error
# The warnings-as\-errors flag `-W=error` was removed in
# https://github.com/googleapis/proto-plus-python/pull/400.
# It should be re-added once issue https://github.com/protocolbuffers/protobuf/issues/12186 is fixed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ohmayr
ohmayr approved these changes Oct 19, 2023
View reviewed changes
@parthea
parthea merged commit 1b3a96f into main Oct 19, 2023
@parthea
parthea deleted the python-312 branch October 19, 2023 17:30
@release-please release-please Bot mentioned this pull request Oct 19, 2023
chore(main): release 1.23.0 #391
Merged
vchudnov-g
vchudnov-g approved these changes Oct 19, 2023
View reviewed changes
Comment thread noxfile.py
if proto == "cpp": # 4.20 does not have cpp.
session.install("protobuf==3.19.0")

# The warnings as errors flag `-W=error` was removed in

@vchudnov-g vchudnov-g Oct 19, 2023

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. #403 is the issue tracking this. So fixing #403 MEANS re-enabling the warning.

Suggested change
# The warnings as errors flag `-W=error` was removed in
# TODO(https://github.com/googleapis/proto-plus-python/issues/403): re-enable -W=error
# The warnings-as\-errors flag `-W=error` was removed in
# https://github.com/googleapis/proto-plus-python/pull/400.
# It should be re-added once issue https://github.com/protocolbuffers/protobuf/issues/12186 is fixed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@parthea parthea mentioned this pull request Dec 4, 2023
chore(main): Release candidate v1.23.0rc2 #416
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers
@vchudnov-g vchudnov-g vchudnov-g approved these changes
@ohmayr ohmayr ohmayr approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add support for python 3.12 Remove usage of datetime.datetime.utcfromtimestamp() which is deprecated in python 3.12

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@parthea @vchudnov-g @ohmayr
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.