From 9645e3dd2d173f7dcb69f9b7eb5fb73717d75a9f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Kubler?= <gregoire.kubler@proton.me>
Date: Tue, 7 May 2024 11:52:21 +0200
Subject: [PATCH] feat : find_package is now hanlded by pyproject.toml

---
 pyproject.toml | 6 +++++-
 setup.py       | 4 ----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index 272c55cab..48a9415d0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -23,7 +23,11 @@ build-backend = "setuptools.build_meta"
 #####################################################
 # SETUPTOOLS
 [tool.setuptools]
-#####################################################
+[tool.setuptools.packages.find]
+where = ["."]  # list of folders that contain the packages (["."] by default)
+include = ["aidge_core*"]  # package names should match these glob patterns (["*"] by default)
+exclude = ["aidge_core.unit_tests*"]  # exclude packages matching these glob patterns (empty by default)
+namespaces = false  # to disable scanning PEP 420 namespaces (true by default)
 # SETUPTOOLS_SCM
 [tool.setuptools_scm]
 write_to = "aidge_core/_version.py"
diff --git a/setup.py b/setup.py
index 5b2c15709..370f72a6e 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,6 @@ from math import ceil
 import toml
 
 from setuptools import setup, Extension
-from setuptools import find_packages
 from setuptools.command.build_ext import build_ext
 
 def get_project_name() -> str:
@@ -21,7 +20,6 @@ def get_project_name() -> str:
         return project_toml["project"]["name"]
 
 
-
 class CMakeExtension(Extension):
     def __init__(self, name):
         super().__init__(name, sources=[])
@@ -98,9 +96,7 @@ class CMakeBuild(build_ext):
 
 
 if __name__ == "__main__":
-
     setup(
-        packages=find_packages(where="."),
         include_package_data=True,
         ext_modules=[CMakeExtension(get_project_name())],
         cmdclass={
-- 
GitLab