Skip to content
Snippets Groups Projects
Commit 857628e5 authored by Grégoire Kubler's avatar Grégoire Kubler
Browse files

fix : various bugs for windows release

parent 02a14e5c
No related branches found
No related tags found
3 merge requests!93Release v0.3.0,!64Feat/release pip,!58Draft: Feat/release pip
Pipeline #45166 failed
#!/bin/bash #!/bin/bash
set -x set -x
set -e set -e
for repo in $AIDGE_DEPENDENCIES ; do # ${AIDGE_DEPENDENCIES} is defined in the pyproject.toml if [[ $repo == "" ]]; then # case for aidge_ core
REPO_PATH=$(find /host -type d -name $repo \
-not -path '*proc*' \
-not -path '*install*' \
-not -path '*.git*' \
-not -path '*miniconda*' \
-not -path '*.local*' \
-not -path "*lib*" \
-not -path "*/$repo/$repo" \
-print -quit)
cd $REPO_PATH
mkdir -p build # creating build if its not already there to hold the build of cpp files mkdir -p build # creating build if its not already there to hold the build of cpp files
rm -rf build/* # build from scratch rm -rf build/* # build from scratch
pip install . -v else
done for repo in $AIDGE_DEPENDENCIES ; do # case for other projects
REPO_PATH=$(find /host/home/ -type d -name $repo \
-not -path '*install*' \
-not -path '*.git*' \
-not -path '*miniconda*' \
-not -path '*conda*' \
-not -path '*.local*' \
-not -path "*lib*" \
-not -path "*/$repo/$repo" \
-print -quit)
cd $REPO_PATH
mkdir -p build # creating build if its not already there to hold the build of cpp files
rm -rf build/* # build from scratch
pip install . -v
done
fi
set +x set +x
set +e set +e
[project] [project]
name = "aidge_backend_cpu" name = "aidge_backend_cpu"
description="CPU implementations of the operators of aidge framework" description="CPU implementations of the operators of aidge framework"
dependencies = ["numpy", "aidge_core"] dependencies = ["numpy>=1.21.6", "aidge_core>=0.3.0"]
requires-python = ">= 3.7" requires-python = ">= 3.7"
dynamic = ["version"] # defined in tool.setuptools_scm dynamic = ["version"] # defined in tool.setuptools_scm
readme = "README.md" readme = "README.md"
...@@ -12,25 +12,42 @@ classifiers = [ ...@@ -12,25 +12,42 @@ classifiers = [
] ]
[build-system] [build-system]
requires = ["setuptools>=68", "setuptools-scm"] requires = [
"setuptools>=64",
"setuptools_scm[toml]==7.1.0",
"cmake",
"toml"
]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
##################################################### #####################################################
# CIBUILDWHEEL # SETUPTOOLS
[tool.setuptools]
#####################################################
# SETUPTOOLS_SCM
[tool.setuptools_scm]
write_to = "aidge_core/_version.py"
#####################################################
# CIBUILDWHEEL
[tool.cibuildwheel] [tool.cibuildwheel]
build-frontend = "build" build-frontend = "build"
before-build = ["bash .gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh ${AIDGE_DEPENDENCIES}"] ### AIDGE DEPENDENCIES DECLARATION
[tool.cibuildwheel.environment]
# aidge_core do not rely on any aidge dependency, hence this string is empty # aidge_core do not rely on any aidge dependency, hence this string is empty
[tool.cibuildwheel.linux.environment]
AIDGE_DEPENDENCIES = "aidge_core" # format => "dep_1 dep_2 ... dep_n" AIDGE_DEPENDENCIES = "aidge_core" # format => "dep_1 dep_2 ... dep_n"
[tool.cibuildwheel.windows.environment]
AIDGE_DEPENDENCIES = "aidge_core" # format => "dep_1","dep_2", ... ,"dep_n"
##################################################### [tool.cibuildwheel.linux]
# SETUPTOOLS before-build = [
[tool.setuptools] "bash .gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh ${AIDGE_DEPENDENCIES}"
# packages=["aidge_core", "export"] ]
[tool.cibuildwheel.windows]
before-build = [
"powershell -File .\\.gitlab\\ci\\cibuildwheel_build_deps_before_build_wheel.ps1"
]
[tool.setuptools_scm]
version_file = "_version.py"
##################################################### #####################################################
......
...@@ -26,19 +26,16 @@ import multiprocessing ...@@ -26,19 +26,16 @@ import multiprocessing
from math import ceil from math import ceil
import toml
from setuptools import setup, Extension from setuptools import setup, Extension
from setuptools import find_packages from setuptools import find_packages
from setuptools.command.build_ext import build_ext from setuptools.command.build_ext import build_ext
def get_project_name() -> str: def get_project_name() -> str:
return open(pathlib.Path().absolute() / "project_name.txt", "r").read() with open(pathlib.Path().absolute() / "pyproject.toml", "r") as file :
project_toml = toml.load(file)
return project_toml["project"]["name"]
def get_project_version() -> str:
aidge_root = pathlib.Path().absolute()
version = open(aidge_root / "version.txt", "r").read().strip()
return version
class CMakeExtension(Extension): class CMakeExtension(Extension):
...@@ -116,21 +113,12 @@ class CMakeBuild(build_ext): ...@@ -116,21 +113,12 @@ class CMakeBuild(build_ext):
if __name__ == "__main__": if __name__ == "__main__":
setup( setup(
name=get_project_name(),
version=get_project_version(),
python_requires=">=3.7", python_requires=">=3.7",
description=DOCLINES[0],
long_description_content_type="text/markdown",
long_description="\n".join(DOCLINES[2:]),
classifiers=[c for c in CLASSIFIERS.split("\n") if c],
packages=find_packages(where="."),
include_package_data=True, include_package_data=True,
ext_modules=[CMakeExtension(get_project_name())], ext_modules=[CMakeExtension(get_project_name())],
cmdclass={ cmdclass={
"build_ext": CMakeBuild, "build_ext": CMakeBuild,
}, },
install_requires=["aidge_core"],
zip_safe=False, zip_safe=False,
) )
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