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.7 support dropped accidentally? #1263

Closed
1 task done
rarkins opened this issue Mar 22, 2024 · 5 comments
Closed
1 task done

Python 3.7 support dropped accidentally? #1263

rarkins opened this issue Mar 22, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@rarkins
Copy link

rarkins commented Mar 22, 2024

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

This library seems to have problems with Python 3.7 now, possibly after this PR: #1114

I know Python 3.7 is itself EOL, but this library declares Python 3.7 support but then breaks downstream dependencies on install, such as checkov earlier versions. It would be best if this change could be reverted and then added back e.g. in a new major release and with Python supports updated.

To Reproduce

  1. Install this library using pip on a system with Python 3.7 as the default

Code snippets

No response

OS

Ubuntu 20.04

Python version

Python v3.7

Library version

openai latest

@rarkins rarkins added the bug Something isn't working label Mar 22, 2024
@viceice
Copy link

viceice commented Mar 22, 2024

Error message:

23.96 Traceback (most recent call last):
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/bin/checkov", line 2, in <module>
23.96     from checkov.main import Checkov
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/lib/python3.7/site-packages/checkov/main.py", line 23, in <module>
23.96     from checkov.ansible.runner import Runner as ansible_runner
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/lib/python3.7/site-packages/checkov/ansible/runner.py", line 7, in <module>
23.96     from checkov.ansible.graph_builder.local_graph import AnsibleLocalGraph
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/lib/python3.7/site-packages/checkov/ansible/graph_builder/local_graph.py", line 10, in <module>
23.96     from checkov.common.graph.graph_builder.graph_components.blocks import Block
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/lib/python3.7/site-packages/checkov/common/graph/graph_builder/graph_components/blocks.py", line 10, in <module>
23.96     from checkov.terraform.graph_builder.graph_components.block_types import BlockType
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/lib/python3.7/site-packages/checkov/terraform/__init__.py", line 3, in <module>
23.96     from checkov.terraform.modules import *  # noqa
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/lib/python3.7/site-packages/checkov/terraform/modules/__init__.py", line 1, in <module>
23.96     from checkov.terraform.modules.module_utils import *  # noqa
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/lib/python3.7/site-packages/checkov/terraform/modules/module_utils.py", line 19, in <module>
23.96     from checkov.terraform.checks.utils.dependency_path_handler import unify_dependency_path
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/lib/python3.7/site-packages/checkov/terraform/checks/utils/dependency_path_handler.py", line 3, in <module>
23.96     from checkov.common.runners.base_runner import strtobool
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/lib/python3.7/site-packages/checkov/common/runners/base_runner.py", line 16, in <module>
23.96     from checkov.common.output.report import Report
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/lib/python3.7/site-packages/checkov/common/output/report.py", line 19, in <module>
23.96     from checkov.common.output.ai import OpenAi
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/lib/python3.7/site-packages/checkov/common/output/ai.py", line 8, in <module>
23.96     import openai
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/lib/python3.7/site-packages/openai/__init__.py", line 8, in <module>
23.96     from . import types
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/lib/python3.7/site-packages/openai/types/__init__.py", line 5, in <module>
23.96     from .image import Image as Image
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/lib/python3.7/site-packages/openai/types/image.py", line 5, in <module>
23.96     from .._models import BaseModel
23.96   File "/opt/containerbase/tools/checkov/2.3.298/3.7/lib/python3.7/site-packages/openai/_models.py", line 542, in <module>
23.97     TypeAdapter = lru_cache(_TypeAdapter)
23.97   File "/opt/containerbase/tools/python/3.7.17/lib/python3.7/functools.py", line 490, in lru_cache
23.97     raise TypeError('Expected maxsize to be an integer or None')
23.97 TypeError: Expected maxsize to be an integer or None

@rattrayalex
Copy link
Collaborator

Thank you for raising! We'll take a look.

@RobertCraigie
Copy link
Collaborator

Sorry about this, a fix will be included in the next release.

I'm curious if you can share why you're still using 3.7? I suspect we'll be contemplating dropping it soon.

@rarkins
Copy link
Author

rarkins commented Mar 25, 2024

We have some legacy Dockerfiles which now "fail to build", otherwise we will be defaulting to Python 3.8 in future

@RobertCraigie
Copy link
Collaborator

This has been fixed in v1.14.3!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants