Skip to content

Instantly share code, notes, and snippets.

@faph
Last active November 6, 2015 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faph/53e5b76a35f08e9ca974 to your computer and use it in GitHub Desktop.
Save faph/53e5b76a35f08e9ca974 to your computer and use it in GitHub Desktop.
use recipe as function argument
Param(
$recipe,
[switch] $upload = $false
)
$user = 'faph'
$channel = 'dev'
$pyversions = '3.3', '3.4', '3.5'
$build_platform = 'win-64'
$other_platforms = 'osx-64', 'linux-64'
$build_folder = "$env:LOCALAPPDATA\Continuum\Miniconda3\conda-bld"
$built_pkgs = @()
foreach ($pyversion in $pyversions) {
conda build $recipe --python=$pyversion
if ($lastexitcode -ne 0) {
Throw "Conda build failed with exit code $lastexitcode"
}
$pkg = conda build $recipe --python=$pyversion --output
$built_pkgs += $pkg
$pkg_name = (Get-Item $pkg).Name
foreach ($platform in $other_platforms) {
conda convert --platform $platform --output-dir $build_folder $pkg
if ($lastexitcode -ne 0) {
Throw "Conda convert failed with exit code $lastexitcode"
}
$built_pkgs += "$build_folder\$platform\$pkg_name"
}
}
if ($upload) {
anaconda upload --user $user --channel $channel --force $built_pkgs
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment