-
Notifications
You must be signed in to change notification settings - Fork 615
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
Add deprecation warning for Python 2.7 #1521
Conversation
CI MESSAGE: [1012142]: BUILD STARTED |
dali/python/nvidia/dali/backend.py
Outdated
warnings.simplefilter("default", append=True) | ||
warnings.warn("Python 2.7 will reach the end of its life on January 1st," + | ||
"2020. Please upgrade your Python as Python 2.7 won't be " + | ||
"maintained after that date. The December release will be" + |
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.
Just a thought: maybe something like The 0.17 release will ...
will age better?
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
CI MESSAGE: [1012142]: BUILD FAILED |
CI MESSAGE: [1012182]: BUILD STARTED |
CI MESSAGE: [1012182]: BUILD FAILED |
dali/python/nvidia/dali/backend.py
Outdated
TensorListGPU.asCPU = asCPU | ||
# py27 deprecation | ||
if sys.version_info[0] < 3: | ||
warnings.simplefilter("default", append=True) |
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.
how about a more custom message. Saying that DALI won't be supported for python 2.7 after release X
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.
I followed the messaging from pip. I want to emphasis the fact that Python 2.7 won't be maintained any longer first and then, as a result, DALI will do the same.
Can you suggest the desired wording?
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.
For example, Librosa says: FutureWarning: You are using librosa with Python 2. Please note that librosa 0.7 will be the last version to support Python 2, after which it will require Python 3 or later.
CI MESSAGE: [1012182]: BUILD PASSED |
dali/python/nvidia/dali/backend.py
Outdated
warnings.warn("Python 2.7 will reach the end of its life on January 1st," + | ||
"2020. Please upgrade your Python as Python 2.7 won't be " + | ||
"maintained after that date. The 0.17 release will be" + | ||
" the last supporting Python 2.7.", Warning, stacklevel=2) |
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.
You should notify the user that this message is from DALI, e.g.:
"This version of DALI is the last official release for Python 2.7, which reaches end of life on January 1st 2020. "+
"To stay up to date with DALI (and many other libraries), please upgrade to Python 3.5 or later."
dali/python/nvidia/dali/backend.py
Outdated
with warnings.catch_warnings(): | ||
warnings.resetwarnings() | ||
warnings.simplefilter("default") | ||
warnings.warn("The 0.17 DALI is the last official release for Python 2.7, which" |
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.
warnings.warn("The 0.17 DALI is the last official release for Python 2.7, which" | |
warnings.warn("DALI 0.17 is the last official release for Python 2.7, which" |
dali/python/nvidia/dali/backend.py
Outdated
TensorListGPU.asCPU = asCPU | ||
# py27 deprecation | ||
if sys.version_info[0] < 3: | ||
# show only this warining |
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.
# show only this warining | |
# show only this warning |
- EOF for Python 2.7 will happen on January 1st, 2020. This change adds an appropriate warning - removes asCPU method support that has been deprecated a long time ago Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
CI MESSAGE: [1013985]: BUILD STARTED |
CI MESSAGE: [1013985]: BUILD PASSED |
adds an appropriate warning
Signed-off-by: Janusz Lisiecki jlisiecki@nvidia.com
Why we need this PR?
What happened in this PR?
JIRA TASK: [NA]