cmake-python-distributions icon indicating copy to clipboard operation
cmake-python-distributions copied to clipboard

Porting old script to new version

Open Kralg opened this issue 1 year ago • 3 comments

Hello, I am trying to run this script: https://github.com/phodina/ProjectConverter/blob/master/converter.py But I am getting an error at cmakefile = cmake.CMake(project.getProject(), args.path) cmakefile.populateCMake() AttributeError: module 'cmake' has no attribute 'CMake'

Can you please write how to figure out how to fix this?

Kralg avatar Jun 11 '24 09:06 Kralg

You can use something like:

from importlib.metadata import version
if version('cmake') < ...
  ...

LecrisUT avatar Jun 21 '24 09:06 LecrisUT

We never provided a CMake class. This was trying to get a cmake.py file in your local project, which Python 2 would have done, while Python 3 requires you use a relative import, like from .cmake import CMake. Doesn't have anything to do with this package.

henryiii avatar Jun 26 '24 05:06 henryiii

This file, specifically: https://github.com/phodina/ProjectConverter/blob/master/cmake.py

It looks like it's been untouched for years.

henryiii avatar Jun 27 '24 05:06 henryiii