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

Add deprecation warning for Python 2.7 #1521

Merged
merged 1 commit into from
Dec 2, 2019
Merged

Add deprecation warning for Python 2.7 #1521

merged 1 commit into from
Dec 2, 2019

Conversation

JanuszL
Copy link
Contributor

@JanuszL JanuszL commented Nov 29, 2019

  • 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

Why we need this PR?

  • add deprecation warning for Python 2.7

What happened in this PR?

  • 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
  • no dedicated test it available

JIRA TASK: [NA]

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1012142]: BUILD STARTED

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" +
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1012142]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1012182]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1012182]: BUILD FAILED

TensorListGPU.asCPU = asCPU
# py27 deprecation
if sys.version_info[0] < 3:
warnings.simplefilter("default", append=True)
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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.

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1012182]: BUILD PASSED

Comment on lines 35 to 38
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)
Copy link
Contributor

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

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"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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"

TensorListGPU.asCPU = asCPU
# py27 deprecation
if sys.version_info[0] < 3:
# show only this warining
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# 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>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1013985]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1013985]: BUILD PASSED

@JanuszL JanuszL merged commit e817649 into NVIDIA:master Dec 2, 2019
@JanuszL JanuszL deleted the deprecation_27 branch December 2, 2019 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants