Skip to content

Python 3.12 support #813

Closed
Closed

Description

@AleksaC

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:

Activity

  1. added
    enhancement
    triage
    on Nov 1, 2023
  2. BenRKarl commented on Nov 1, 2023

    @BenRKarl
    Contributor

    @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.

  3. self-assigned this
    on Nov 1, 2023
  4. adamchainz commented on Nov 22, 2023

    @adamchainz
    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.

  5. pfouque commented on Nov 23, 2023

    @pfouque

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

    Does it mean March 2024? :(

  6. potiuk commented on Jan 12, 2024

    @potiuk

    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 ?

  7. BenRKarl commented on Jan 12, 2024

    @BenRKarl
    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.

  8. potiuk commented on Jan 12, 2024

    @potiuk

    Woooohooooo... Looking forward to it :)

  9. BenRKarl commented on Jan 23, 2024

    @BenRKarl
    Contributor

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

  10. potiuk commented on Jan 23, 2024

    @potiuk

    Thank you ! Will proceed with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementtriage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions