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

cmaker.py: deprecated use of imp, unclosed file #429

Closed
2 tasks done
Nic30 opened this issue Jun 1, 2019 · 3 comments
Closed
2 tasks done

cmaker.py: deprecated use of imp, unclosed file #429

Nic30 opened this issue Jun 1, 2019 · 3 comments
Labels
Type: Enhancement Improvement to functionality

Comments

@Nic30
Copy link

Nic30 commented Jun 1, 2019

Hello,
I tried to run scikit-build with python3-dbg for Cython based C extension, there multiple problems.
(Extension is complicated so I am not reffering it, and the problem is not related to user code.)

Two of them, described below, should be easy to solve.

  • imp module is deprecated in favour of importlib
/usr/lib/python3/dist-packages/setuptools/depends.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
  • ResourceWarning: unclosed file
/usr/local/lib/python3.7/dist-packages/skbuild/cmaker.py:425: ResourceWarning: unclosed file <_io.TextIOWrapper name='_skbuild/linux-x86_64-3.7/cmake-build/cmake_install.cmake' mode='r' encoding='utf-8'>
  for line in io.open(os.path.join(root, filename), encoding="utf-8"):

https://github.com/scikit-build/scikit-build/blob/master/skbuild/cmaker.py#L425

@jcfr jcfr added the Type: Enhancement Improvement to functionality label Jun 1, 2019
@jcfr
Copy link
Contributor

jcfr commented Jun 1, 2019

Thanks for the report.

@jcfr
Copy link
Contributor

jcfr commented Jun 1, 2019

The other issue related to the deprecated use of imp is associated with the setuptools package. See https://github.com/pypa/setuptools/blob/master/setuptools/depends.py

and it has already been reported as pypa/setuptools#479

@jcfr jcfr changed the title cmaker.py: unclosed file cmaker.py: deprecated use of imp, unclosed file Jun 1, 2019
@Nic30
Copy link
Author

Nic30 commented Jun 1, 2019

Thank you for super fast fix.

@Nic30 Nic30 closed this as completed Jun 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improvement to functionality
Projects
None yet
Development

No branches or pull requests

2 participants