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

Python 3.12 support #813

Closed
AleksaC opened this issue Nov 1, 2023 · 8 comments
Closed

Python 3.12 support #813

AleksaC opened this issue Nov 1, 2023 · 8 comments
Assignees
Labels
enhancement New feature or request triage New issue; requires attention

Comments

@AleksaC
Copy link

AleksaC commented Nov 1, 2023

Describe the problem you are trying to solve:

I'm unable to install library version 22.1.0 since it requires python version <3.12. Python 3.12 had a stable release and from what I can see there is no reason it shouldn't be supported.

Describe the solution you'd like:

Describe alternatives you've considered:
I could constrain python version in poetry to be <3.12 but I think some team members already use 3.12. I could also install the previous version (22.0.0) of the package until 3.12 is supported.

Additional context:

@AleksaC AleksaC added enhancement New feature or request triage New issue; requires attention labels Nov 1, 2023
@BenRKarl
Copy link
Contributor

BenRKarl commented Nov 1, 2023

@AleksaC thanks for this - the goal is to support 3.12 by the end of next quarter, if not sooner. I'll respond here once that's done.

@BenRKarl BenRKarl self-assigned this Nov 1, 2023
@adamchainz
Copy link
Contributor

I’ve had a look to see if support is easy to add. I tried to run the test suite with Python 3.12, but that requires an upgrade of pyfakefs, which was pinned < 3.7 in 3f01c1b.

Upgrading pyfakefs and running the tests with only yPython 3.8 causes test failures like:

======================================================================
ERROR: test_get_type (client_test.GoogleAdsClientTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/.../google-ads-python/tests/client_test.py", line 786, in test_get_type
    client.get_type(name, version=ver)
  File "/.../google-ads-python/google/ads/googleads/client.py", line 453, in get_type
    message_class = getattr(type_classes, name)
  File "/.../google-ads-python/google/ads/googleads/v15/__init__.py", line 1938, in __getattr__
    module = importlib.import_module(f"{_lazy_type_to_package_map[name]}")
  File "/.../python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/.../google-ads-python/google/ads/googleads/v15/services/types/account_budget_proposal_service.py", line 140, in <module>
    class MutateAccountBudgetProposalResult(proto.Message):
  File "/.../google-ads-python/.nox/tests-3-8/lib/python3.8/site-packages/proto/message.py", line 275, in __new__
    file_info.generate_file_pb(new_class=cls, fallback_salt=full_name)
  File "/.../google-ads-python/.nox/tests-3-8/lib/python3.8/site-packages/proto/_file_info.py", line 104, in generate_file_pb
    pool.Add(self.descriptor)
TypeError: Couldn't build proto file into descriptor pool: duplicate file name google/ads/googleads/v15/services/types/account_budget_proposal_service.proto

I didn’t manage to debug why files are being seen as duplicate. The error message comes from within a C-level function in protobuf.

@pfouque
Copy link

pfouque commented Nov 23, 2023

the goal is to support 3.12 by the end of next quarter,

Does it mean March 2024? :(

@potiuk
Copy link

potiuk commented Jan 12, 2024

Hmm this is one that blocks Airflow's support of Python 3.12 for one - i.e. we might want to relase without the whole Google provider support but it would not be good for GCP in general I think. Especially if providers for other clouds will have support for 3.12 from the get-go.

It would be great to know the expected timeline, so that we could at least decide whether we want to approach some plan B or C in the meantime. Any news about it @BenRKarl ?

@BenRKarl
Copy link
Contributor

Here's an open PR that adds support for 3.12: #830

The changes have all already been reviewed and tested internally, so I'm hoping to merge this and publish it next week.

@potiuk
Copy link

potiuk commented Jan 12, 2024

Woooohooooo... Looking forward to it :)

@BenRKarl
Copy link
Contributor

This is resolved in version 23.0.0, you should have no issues with 3.12 now.

@potiuk
Copy link

potiuk commented Jan 23, 2024

Thank you ! Will proceed with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage New issue; requires attention
Projects
None yet
Development

No branches or pull requests

5 participants