diff --git a/.gitlab/ci/cibuildwheel_build_deps_before_build_wheel.ps1 b/.gitlab/ci/cibuildwheel_build_deps_before_build_wheel.ps1 index c763666682227376e857fc99695ebf6c1ebfdb7b..704f43000a856d98ddf28d33994e58eee9aaa4d0 100644 --- a/.gitlab/ci/cibuildwheel_build_deps_before_build_wheel.ps1 +++ b/.gitlab/ci/cibuildwheel_build_deps_before_build_wheel.ps1 @@ -1,33 +1,30 @@ -param( - [String[]]$DEPS= @() -) - -if ($deps.Length -eq 0) { - Write-Host "- No dependencies provided for current repository" - New-Item -ItemType Directory -Force -Path ".\build" | Out-Null - Remove-Item -Path ".\build\*" -Recurse -Force -} else { - Write-Host "Retrieving dependencies necessary to build current package" - foreach ($repo in $DEPS) { - Write-Host "Retrieving : $repo" - $repoPath = Get-ChildItem -Path "/host/home/" -Directory -Filter $repo -Recurse | +if ($env:AIDGE_DEPENDENCIES.Length -split " " -eq 0) { + Write-Host "- No dependencies provided for current repsitory" + New-Item -ItemType Directory -Force -Path ".\build" | Out-Null + Remove-Item -Path ".\build\*" -Recurse -Force + } else { + Write-Host "Retrieving given dependencies to build current package : $($deps -join ',')" + foreach ($dep in $env:AIDGE_DEPENDENCIES -split " ") { + + Write-Host "Retrieving : $dep" + $dep_path = Get-ChildItem -Path "/host/home/" -Directory -Filter $dep -Recurse | Where-Object { $_.FullName -notmatch 'install' -and $_.FullName -notmatch '.git' -and $_.FullName -notmatch 'miniconda' -and $_.FullName -notmatch 'conda' -and $_.FullName -notmatch '.local' -and $_.FullName -notmatch 'lib' -and - $_.FullName -notmatch "\\$repo\\$repo" } | + $_.FullName -notmatch "\\$dep\\$dep" } | Select-Object -First 1 -ExpandProperty FullName - if (-not [string]::IsNullOrEmpty($repoPath)) { - Write-Host "Retrieving : $repo" - Set-Location $repoPath + if (-not [string]::IsNullOrEmpty($dep_path)) { + Write-Host "Retrieving : $dep" + Set-Location $dep_path New-Item -Path ".\build" -ItemType Directory -Force | Out-Null Get-ChildItem -Path ".\build" -File | Remove-Item -Force pip install . -Verbose } else {Â - throw "$repo not found, aborting." + throw "$dep not found, aborting." } } } diff --git a/pyproject.toml b/pyproject.toml index 5b203c9dd0a6349eacecc5a8940edd153d201839..c7659cf76842f47961770580cfa5831d4c00e102 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,18 +19,23 @@ build-backend = "setuptools.build_meta" # CIBUILDWHEEL [tool.cibuildwheel] build-frontend = "build" -[tool.cibuildwheel.environment] + +############## AIDGE DEPENDENCIES DECLARATION # aidge_core do not rely on any aidge dependency, hence this string is empty -AIDGE_DEPENDENCIES = "" # format => "dep_1 dep_2 ... dep_n" +[tool.cibuildwheel.linux.environment] +# AIDGE_DEPENDENCIES = "" # format => "dep_1 dep_2 ... dep_n" +[tool.cibuildwheel.windows.environment] +# AIDGE_DEPENDENCIES = "" # format => "dep_1 dep_2 ... dep_n" + [tool.cibuildwheel.linux] before-build = [ - 'echo "dependencies to retrieve : ${AIDGE_DEPENDENCIES}', + 'echo "dependencies to retrieve : ${AIDGE_DEPENDENCIES}"', "bash .gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh ${AIDGE_DEPENDENCIES}" ] [tool.cibuildwheel.windows] before-build = [ - 'Write-Host "dependencies to retrieve : $env:{AIDGE_DEPENDENCIES}', - ".\\.gitlab\\ci\\cibuildwheel_build_deps_before_build_wheel.ps1 --deps $env:{AIDGE_DEPENDENCIES}" + 'Write-Host "dependencies to retrieve : $env:{AIDGE_DEPENDENCIES}"', + ".\\.gitlab\\ci\\cibuildwheel_build_deps_before_build_wheel.ps1" ] #####################################################