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
set -x
set -e
for repo in $AIDGE_DEPENDENCIES ; do # ${AIDGE_DEPENDENCIES} is defined in the pyproject.toml
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
if [[ $repo == "" ]]; then # case for aidge_ core
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
else
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 +e
[project]
name = "aidge_backend_cpu"
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"
dynamic = ["version"] # defined in tool.setuptools_scm
readme = "README.md"
......@@ -12,25 +12,42 @@ classifiers = [
]
[build-system]
requires = ["setuptools>=68", "setuptools-scm"]
requires = [
"setuptools>=64",
"setuptools_scm[toml]==7.1.0",
"cmake",
"toml"
]
build-backend = "setuptools.build_meta"
#####################################################
# CIBUILDWHEEL
# SETUPTOOLS
[tool.setuptools]
#####################################################
# SETUPTOOLS_SCM
[tool.setuptools_scm]
write_to = "aidge_core/_version.py"
#####################################################
# CIBUILDWHEEL
[tool.cibuildwheel]
build-frontend = "build"
before-build = ["bash .gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh ${AIDGE_DEPENDENCIES}"]
[tool.cibuildwheel.environment]
### AIDGE DEPENDENCIES DECLARATION
# 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"
[tool.cibuildwheel.windows.environment]
AIDGE_DEPENDENCIES = "aidge_core" # format => "dep_1","dep_2", ... ,"dep_n"
#####################################################
# SETUPTOOLS
[tool.setuptools]
# packages=["aidge_core", "export"]
[tool.cibuildwheel.linux]
before-build = [
"bash .gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh ${AIDGE_DEPENDENCIES}"
]
[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
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:
return open(pathlib.Path().absolute() / "project_name.txt", "r").read()
def get_project_version() -> str:
aidge_root = pathlib.Path().absolute()
version = open(aidge_root / "version.txt", "r").read().strip()
return version
with open(pathlib.Path().absolute() / "pyproject.toml", "r") as file :
project_toml = toml.load(file)
return project_toml["project"]["name"]
class CMakeExtension(Extension):
......@@ -116,21 +113,12 @@ class CMakeBuild(build_ext):
if __name__ == "__main__":
setup(
name=get_project_name(),
version=get_project_version(),
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,
ext_modules=[CMakeExtension(get_project_name())],
cmdclass={
"build_ext": CMakeBuild,
},
install_requires=["aidge_core"],
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