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

dist_utils is depricated #4668

Open
jedwards4b opened this issue Aug 23, 2024 · 2 comments
Open

dist_utils is depricated #4668

jedwards4b opened this issue Aug 23, 2024 · 2 comments

Comments

@jedwards4b
Copy link
Contributor

In utils.py and perhaps in other places we have:

# pylint: disable=deprecated-module                                                                                                                                        
from distutils import file_util                     

marking the routine as deprecated means it won't fail the pylint test - but it is completly removed in the latest python 3.12. We need to replace all occurances of distutils in cime.

Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Nov 22, 2024
@mnlevy1981
Copy link
Contributor

It looks like the file_util imports have been removed, but several modules have

from distutils.spawn import find_executable

shutils.which provides the same functionality:

>>> from distutils.spawn import find_executable
>>> from shutil import which
>>> find_executable('xmllint')
<stdin>:1: DeprecationWarning: Use shutil.which instead of find_executable
'/Users/mlevy/miniconda3/envs/cupid-dev/bin/xmllint'
>>> which('xmllint')
'/Users/mlevy/miniconda3/envs/cupid-dev/bin/xmllint'

(both return None when file is not found)

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

No branches or pull requests

2 participants