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

fix: Add deprecation warning for python 3.7 #1743

Closed
wants to merge 1 commit into from

Conversation

parthea
Copy link
Contributor

@parthea parthea commented Aug 16, 2023

Towards googleapis/google-cloud-python#11437

Using Python 3.7

(py3716) partheniou@partheniou-vm-3:~/git/gapic-generator-python/tests/integration/goldens/credentials$ export PYTHONWARNINGS="default"
(py3716) partheniou@partheniou-vm-3:~/git/gapic-generator-python/tests/integration/goldens/credentials$ python3.7
Python 3.7.16 (default, Mar 14 2023, 12:34:43) 
[GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import google.iam.credentials_v1
/usr/local/google/home/partheniou/git/gapic-generator-python/tests/integration/goldens/credentials/google/iam/credentials_v1/__init__.py:54: Python37DeprecationWarning: After January 1, 2024, new releases of this client library will drop support for python 3.7. More details about Python 3.7 support for Client Libraries can be found at https://cloud.google.com/python/docs/python37-sunset/
  warnings.warn(message, Python37DeprecationWarning)
>>> import google.iam.credentials
/usr/local/google/home/partheniou/git/gapic-generator-python/tests/integration/goldens/credentials/google/iam/credentials/__init__.py:54: Python37DeprecationWarning: After January 1, 2024, new releases of this client library will drop support for python 3.7. More details about Python 3.7 support for Client Libraries can be found at https://cloud.google.com/python/docs/python37-sunset/
  warnings.warn(message, Python37DeprecationWarning)
>>> import google.iam.credentials_v1
>>> import google.iam.credentials
>>> 

Using Python 3.9

(py39) partheniou@partheniou-vm-3:~/git/gapic-generator-python/tests/integration/goldens/credentials$ export PYTHONWARNINGS="default"
(py39) partheniou@partheniou-vm-3:~/git/gapic-generator-python/tests/integration/goldens/credentials$ python3.9
Python 3.9.16 (main, Mar  2 2023, 17:52:22) 
[GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import google.iam.credentials_v1
/usr/local/google/home/partheniou/.pyenv/versions/py39/lib/python3.9/site-packages/google/rpc/__init__.py:18: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
...
>>> import google.iam.credentials
>>> import google.iam.credentials_v1

The warnings that appear with python 3.9 are captured in googleapis/python-api-common-protos#140 (comment) and googleapis/google-cloud-python#11184

@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Aug 16, 2023
Comment on lines +70 to +71
# Configure the Python37DeprecationWarning warning so that it is only emitted once.
warnings.simplefilter('once', Python37DeprecationWarning)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
# Configure the Python37DeprecationWarning warning so that it is only emitted once.
warnings.simplefilter('once', Python37DeprecationWarning)

This code should be removed. See googleapis/google-auth-library-python#1427

Comment on lines +58 to +59
# print only the first occurrence of Python37DeprecationWarning, regardless of location
warnings.simplefilter('once', Python37DeprecationWarning)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
# print only the first occurrence of Python37DeprecationWarning, regardless of location
warnings.simplefilter('once', Python37DeprecationWarning)

This code should be removed. See googleapis/google-auth-library-python#1427

@parthea parthea closed this Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant