Skip to content
Snippets Groups Projects
Commit 1f76661a authored by Christophe Guillon's avatar Christophe Guillon
Browse files

[Setup] Remove additional build dependency on toml

Minimize dependencies for the setup.py script, this
facilitates use in development mode and with legacy
install processes.
Here we remove the toml requirement at the cost of specifying the
project name directly.
parent 9692ff11
No related branches found
No related tags found
2 merge requests!212Version 0.3.0,!154[Setup] Add support for development install
......@@ -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"
......
......@@ -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,
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment