scikit-build / cmake-python-distributions

This project provides the infrastructure to build CMake Python wheels.
https://cmake-python-distributions.readthedocs.io
Apache License 2.0
111 stars 34 forks source link

Porting old script to new version #504

Open Kralg opened 2 months ago

Kralg commented 2 months ago

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?

LecrisUT commented 2 months ago

You can use something like:

from importlib.metadata import version
if version('cmake') < ...
  ...
henryiii commented 2 months ago

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 commented 2 months ago

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

It looks like it's been untouched for years.