diff --git a/pyproject.toml b/pyproject.toml index 7d875bb35985b9ee9fcf272b1c394b249638e3ea..b820759982252b69790cde89c500e3b11f9a52da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,8 +23,7 @@ test = [ requires = [ "setuptools>=64", "setuptools_scm[toml]==7.1.0", - "cmake>=3.15.3.post1", - "toml" + "cmake>=3.15.3.post1" ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 4cd3c18c10b8ddfc90ff29103d184f5ae4eb55c9..96ccac47a809787846102d06f006884ef78c849c 100644 --- a/setup.py +++ b/setup.py @@ -6,17 +6,11 @@ import multiprocessing from math import ceil -import toml - from setuptools import setup, Extension from setuptools.command.build_ext import build_ext -def get_project_name() -> str: - with open(pathlib.Path().absolute() / "pyproject.toml", "r") as file: - project_toml = toml.load(file) - return project_toml["project"]["name"] - +PROJECT_NAME = "aidge_core" class CMakeExtension(Extension): def __init__(self, name): @@ -75,7 +69,7 @@ class CMakeBuild(build_ext): self.spawn(["cmake", "--install", ".", "--config", compile_type]) os.chdir(str(cwd)) - aidge_package = build_lib / (get_project_name()) + aidge_package = build_lib / PROJECT_NAME # Get "aidge core" package # ext_lib = build_temp @@ -92,7 +86,7 @@ class CMakeBuild(build_ext): if __name__ == "__main__": setup( - ext_modules=[CMakeExtension(get_project_name())], + ext_modules=[CMakeExtension(PROJECT_NAME)], cmdclass={ "build_ext": CMakeBuild, },