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

fix : .ps1 script arg retrieval is now done by environment variables

parent f8e16dfc
No related branches found
No related tags found
2 merge requests!212Version 0.3.0,!116feat/release_pip
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."
}
}
}
......@@ -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"
]
#####################################################
......
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