diff --git a/pyproject.toml b/pyproject.toml index e78558f3..dd442649 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools<64", + "setuptools>=45", "setuptools_scm>=6.4", "wheel>=0.37", "ninja>=1.10; sys_platform != 'win32'", diff --git a/setup.py b/setup.py index 39170fc7..4713e7e2 100644 --- a/setup.py +++ b/setup.py @@ -8,10 +8,9 @@ class CMakeExtension(Extension): - def __init__(self, name, sourcedir='', namespace=''): + def __init__(self, name, sourcedir=''): Extension.__init__(self, name, sources=[]) self.sourcedir = os.path.abspath(sourcedir) - self.namespace = namespace class CMakeBuild(build_ext): @@ -19,7 +18,7 @@ def build_extension(self, ext): from setuptools_scm import get_version version = get_version(root='.', relative_to=__file__) - extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.namespace + ext.name))) + extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name))) # required for auto-detection of auxiliary "native" libs if not extdir.endswith(os.path.sep): extdir += os.path.sep @@ -78,9 +77,15 @@ def build_extension(self, ext): if not os.path.exists(self.build_temp): os.makedirs(self.build_temp) else: - os.remove(self.build_temp + "/CMakeCache.txt") + try: + os.remove(os.path.join(self.build_temp, "CMakeCache.txt")) + except OSError: + pass subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp) - subprocess.check_call(['cmake', '--build', '.', '--target', ext.name] + build_args, cwd=self.build_temp) + subprocess.check_call( + ["cmake", "--build", ".", "--target", ext.name.split(".")[-1]] + build_args, + cwd=self.build_temp, + ) README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), @@ -98,7 +103,7 @@ def build_extension(self, ext): python_requires='>=3.7', license="MIT", # url="", - ext_modules=[CMakeExtension('pysyrec', namespace='mqt.syrec.')], + ext_modules=[CMakeExtension('mqt.syrec.pysyrec')], cmdclass={"build_ext": CMakeBuild}, zip_safe=False, packages=find_namespace_packages(include=['mqt.*']),