From 3e6644028aa57a879b2ba75d77c35fbd90d8ef9b Mon Sep 17 00:00:00 2001
From: Christophe Guillon <christophe.guillon@inria.fr>
Date: Tue, 27 Aug 2024 19:37:18 +0200
Subject: [PATCH] [Setup] Update setup in pyproject.toml

Add dynamic version include in package init.
Fix package find/data to include all packages except unit_tests.
Remove unecessary build time dependency on toml.
Add install instructions to README.md.
---
 README.md                    | 14 +++++++++++++-
 aidge_export_cpp/__init__.py |  2 ++
 pyproject.toml               | 15 +++++++++------
 version.txt                  |  1 -
 4 files changed, 24 insertions(+), 8 deletions(-)
 delete mode 100644 version.txt

diff --git a/README.md b/README.md
index dca00ac..0bb3f45 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,15 @@
 # Aidge CPP Export
 
-Use this module to export your Aidge model to a generic CPP export
\ No newline at end of file
+Use this module to export your Aidge model to a generic CPP export
+
+## Install
+
+Install with:
+
+    pip install -v .
+
+## Development mode install
+
+For editable/development mode, install with:
+
+    pip install -v --no-build-isolation -e .
diff --git a/aidge_export_cpp/__init__.py b/aidge_export_cpp/__init__.py
index c79853c..6ab2e03 100644
--- a/aidge_export_cpp/__init__.py
+++ b/aidge_export_cpp/__init__.py
@@ -9,5 +9,7 @@ import aidge_core
 
 from aidge_export_cpp.utils import ROOT
 
+from ._version import *
+
 from .export import *
 
diff --git a/pyproject.toml b/pyproject.toml
index cbfa621..870f193 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -26,13 +26,15 @@ classifiers = [
     "Topic :: Scientific/Engineering :: Artificial Intelligence",
     "Topic :: Software Development"
 ]
-dynamic = ["version"] # defined in tool.setuptools_scm
+dynamic = ["version"] # defined in tool.setuptools_scm
+
+[project.optional-dependencies]
+test = ["pytest"]
 
 [build-system]
 requires = [
     "setuptools>=64",
-    "setuptools_scm[toml]==7.1.0",
-    "toml"
+    "setuptools_scm[toml]==7.1.0"
 ]
 build-backend = "setuptools.build_meta"
 
@@ -41,9 +43,10 @@ build-backend = "setuptools.build_meta"
 [tool.setuptools]
 [tool.setuptools.packages.find]
 where = ["."]  # list of folders that contain the packages (["."] by default)
-include = ["aidge_export_cpp.*"]  # package names should match these glob patterns (["*"] by default)
-exclude = ["aidge_export_cpp.unit_tests*"]  # exclude packages matching these glob patterns (empty by default)
-namespaces = false  # to disable scanning PEP 420 namespaces (true by default)
+include = ["aidge_export_cpp"]  # package names should match these glob patterns (["*"] by default)
+namespaces = false # to disable scanning PEP 420 namespaces (true by default)
+[tool.setuptools.exclude-package-data]
+aidge_export_cpp = ["unit_tests*"] # exclude unit_tests which may be included as data
 # SETUPTOOLS_SCM
 [tool.setuptools_scm]
 write_to = "aidge_export_cpp/_version.py"
diff --git a/version.txt b/version.txt
deleted file mode 100644
index d917d3e..0000000
--- a/version.txt
+++ /dev/null
@@ -1 +0,0 @@
-0.1.2
-- 
GitLab