From c459d597fb68f9713a91a4481ca75e6bb98a54d4 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Sat, 11 May 2024 19:37:17 +0200 Subject: [PATCH] experimental sdist support --- .gitignore | 1 + Core/ClientSMLSWIG/Python/pyproject.toml | 2 +- SConstruct | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e153dd690c..806efceb4d 100644 --- a/.gitignore +++ b/.gitignore @@ -508,6 +508,7 @@ wheelhouse/ # pip/enscons build output soar_sml/ +/pyproject.toml ### Soar ### out/ diff --git a/Core/ClientSMLSWIG/Python/pyproject.toml b/Core/ClientSMLSWIG/Python/pyproject.toml index 8097085fb3..27c5d215fa 100644 --- a/Core/ClientSMLSWIG/Python/pyproject.toml +++ b/Core/ClientSMLSWIG/Python/pyproject.toml @@ -70,7 +70,7 @@ requires = [ # and other python build/install frontends (such as pip itself). # # We use a forked version of enscons to add python 3.12 support. - "enscons @ git+https://github.com/ShadowJonathan/enscons-soar@9692b01", + "enscons @ git+https://github.com/ShadowJonathan/enscons-soar@45d951d", # Required sub-dependencies of enscons. "toml>=0.1", diff --git a/SConstruct b/SConstruct index fdbd87d342..c1e76052bd 100644 --- a/SConstruct +++ b/SConstruct @@ -429,6 +429,25 @@ if enscons_active: env.WhlFile(source=whl) + # env.FindSourceFiles(whl) + + sdist_sources = env.Glob("Core/*/SConscript") + env.Glob("build_support/*.py") + [ + "SConstruct", + "Core/SConscript", + "Core/ClientSMLSWIG/Python/SConscript", + "Core/ClientSMLSWIG/Python/README.md", + "Core/SVS", + ] + env.Glob("Core/ClientSMLSWIG/Python/*.i") + env.Glob("Core/ClientSMLSWIG/*.i") + + for i in range(0, 5): + for ext in {"h", "c", "cpp", "hpp", "cxx"}: + sdist_sources.extend( + env.Glob("Core/" + ("*/" * i) + "*." + ext) + ) + + env.SDist(source=sdist_sources, + pyproject=True, + ) + # We make sure that an editable (`pip install -e`) installation always properly installs # the files in the correct places. env.Depends("editable", py_sources)