From e4d6097a6d73b91cb3b619d15f510f5681ce4dc2 Mon Sep 17 00:00:00 2001 From: conda-forge-admin Date: Mon, 8 Jul 2024 07:55:48 +0000 Subject: [PATCH] Re-render the feedstock after CI registration. --- .azure-pipelines/azure-pipelines-linux.yml | 60 +++++ .azure-pipelines/azure-pipelines-osx.yml | 37 +++ .azure-pipelines/azure-pipelines-win.yml | 52 +++++ .ci_support/README | 6 + .../linux_64_python3.10.____cpython.yaml | 33 +++ .../linux_64_python3.11.____cpython.yaml | 33 +++ .../linux_64_python3.12.____cpython.yaml | 33 +++ .../linux_64_python3.8.____cpython.yaml | 33 +++ .../linux_64_python3.9.____cpython.yaml | 33 +++ .ci_support/osx_64_.yaml | 26 +++ .ci_support/win_64_.yaml | 16 ++ .circleci/config.yml | 25 ++ .gitattributes | 27 +++ .github/CODEOWNERS | 1 + .github/workflows/automerge.yml | 17 ++ .github/workflows/webservices.yml | 13 ++ .gitignore | 24 ++ .scripts/build_steps.sh | 96 ++++++++ .scripts/logging_utils.sh | 35 +++ .scripts/run_docker_build.sh | 114 ++++++++++ .scripts/run_osx_build.sh | 104 +++++++++ .scripts/run_win_build.bat | 125 ++++++++++ LICENSE.txt | 27 +++ README.md | 213 ++++++++++++++++++ azure-pipelines.yml | 8 + build-locally.py | 106 +++++++++ conda-forge.yml | 7 +- 27 files changed, 1303 insertions(+), 1 deletion(-) create mode 100755 .azure-pipelines/azure-pipelines-linux.yml create mode 100755 .azure-pipelines/azure-pipelines-osx.yml create mode 100755 .azure-pipelines/azure-pipelines-win.yml create mode 100644 .ci_support/README create mode 100644 .ci_support/linux_64_python3.10.____cpython.yaml create mode 100644 .ci_support/linux_64_python3.11.____cpython.yaml create mode 100644 .ci_support/linux_64_python3.12.____cpython.yaml create mode 100644 .ci_support/linux_64_python3.8.____cpython.yaml create mode 100644 .ci_support/linux_64_python3.9.____cpython.yaml create mode 100644 .ci_support/osx_64_.yaml create mode 100644 .ci_support/win_64_.yaml create mode 100644 .circleci/config.yml create mode 100644 .gitattributes create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/automerge.yml create mode 100644 .github/workflows/webservices.yml create mode 100644 .gitignore create mode 100755 .scripts/build_steps.sh create mode 100644 .scripts/logging_utils.sh create mode 100755 .scripts/run_docker_build.sh create mode 100755 .scripts/run_osx_build.sh create mode 100755 .scripts/run_win_build.bat create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 azure-pipelines.yml create mode 100755 build-locally.py diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml new file mode 100755 index 0000000..8c2d499 --- /dev/null +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -0,0 +1,60 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +# -*- mode: yaml -*- + +jobs: +- job: linux + pool: + vmImage: ubuntu-latest + strategy: + matrix: + linux_64_python3.10.____cpython: + CONFIG: linux_64_python3.10.____cpython + UPLOAD_PACKAGES: 'True' + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + linux_64_python3.11.____cpython: + CONFIG: linux_64_python3.11.____cpython + UPLOAD_PACKAGES: 'True' + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + linux_64_python3.12.____cpython: + CONFIG: linux_64_python3.12.____cpython + UPLOAD_PACKAGES: 'True' + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + linux_64_python3.8.____cpython: + CONFIG: linux_64_python3.8.____cpython + UPLOAD_PACKAGES: 'True' + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + linux_64_python3.9.____cpython: + CONFIG: linux_64_python3.9.____cpython + UPLOAD_PACKAGES: 'True' + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + timeoutInMinutes: 360 + variables: {} + + steps: + # configure qemu binfmt-misc running. This allows us to run docker containers + # embedded qemu-static + - script: | + docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes + ls /proc/sys/fs/binfmt_misc/ + condition: not(startsWith(variables['CONFIG'], 'linux_64')) + displayName: Configure binfmt_misc + + - script: | + export CI=azure + export flow_run_id=azure_$(Build.BuildNumber).$(System.JobAttempt) + export remote_url=$(Build.Repository.Uri) + export sha=$(Build.SourceVersion) + export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME + export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) + if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then + export IS_PR_BUILD="True" + else + export IS_PR_BUILD="False" + fi + .scripts/run_docker_build.sh + displayName: Run docker build + env: + BINSTAR_TOKEN: $(BINSTAR_TOKEN) + FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) + STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml new file mode 100755 index 0000000..a8ca2b4 --- /dev/null +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -0,0 +1,37 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +# -*- mode: yaml -*- + +jobs: +- job: osx + pool: + vmImage: macOS-12 + strategy: + matrix: + osx_64_: + CONFIG: osx_64_ + UPLOAD_PACKAGES: 'True' + timeoutInMinutes: 360 + variables: {} + + steps: + # TODO: Fast finish on azure pipelines? + - script: | + export CI=azure + export flow_run_id=azure_$(Build.BuildNumber).$(System.JobAttempt) + export remote_url=$(Build.Repository.Uri) + export sha=$(Build.SourceVersion) + export OSX_FORCE_SDK_DOWNLOAD="1" + export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME + export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) + if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then + export IS_PR_BUILD="True" + else + export IS_PR_BUILD="False" + fi + ./.scripts/run_osx_build.sh + displayName: Run OSX build + env: + BINSTAR_TOKEN: $(BINSTAR_TOKEN) + FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) + STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml new file mode 100755 index 0000000..d609fcd --- /dev/null +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -0,0 +1,52 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +# -*- mode: yaml -*- + +jobs: +- job: win + pool: + vmImage: windows-2022 + strategy: + matrix: + win_64_: + CONFIG: win_64_ + UPLOAD_PACKAGES: 'True' + timeoutInMinutes: 360 + variables: + CONDA_BLD_PATH: D:\\bld\\ + UPLOAD_TEMP: D:\\tmp + + steps: + + - task: PythonScript@0 + displayName: 'Download Miniforge' + inputs: + scriptSource: inline + script: | + import urllib.request + url = 'https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Windows-x86_64.exe' + path = r"$(Build.ArtifactStagingDirectory)/Miniforge.exe" + urllib.request.urlretrieve(url, path) + + - script: | + start /wait "" %BUILD_ARTIFACTSTAGINGDIRECTORY%\Miniforge.exe /InstallationType=JustMe /RegisterPython=0 /S /D=C:\Miniforge + displayName: Install Miniforge + + - powershell: Write-Host "##vso[task.prependpath]C:\Miniforge\Scripts" + displayName: Add conda to PATH + + - script: | + call ".scripts\run_win_build.bat" + displayName: Run Windows build + env: + PYTHONUNBUFFERED: 1 + CONFIG: $(CONFIG) + CI: azure + flow_run_id: azure_$(Build.BuildNumber).$(System.JobAttempt) + remote_url: $(Build.Repository.Uri) + sha: $(Build.SourceVersion) + UPLOAD_PACKAGES: $(UPLOAD_PACKAGES) + UPLOAD_TEMP: $(UPLOAD_TEMP) + BINSTAR_TOKEN: $(BINSTAR_TOKEN) + FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) + STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.ci_support/README b/.ci_support/README new file mode 100644 index 0000000..a47316b --- /dev/null +++ b/.ci_support/README @@ -0,0 +1,6 @@ +This file is automatically generated by conda-smithy. If any +particular build configuration is expected, but it is not found, +please make sure all dependencies are satisfiable. To add/modify any +matrix elements, you should create/change conda-smithy's input +recipe/conda_build_config.yaml and re-render the recipe, rather than +editing these files directly. diff --git a/.ci_support/linux_64_python3.10.____cpython.yaml b/.ci_support/linux_64_python3.10.____cpython.yaml new file mode 100644 index 0000000..77d9b72 --- /dev/null +++ b/.ci_support/linux_64_python3.10.____cpython.yaml @@ -0,0 +1,33 @@ +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +fmt: +- '10' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.10.* *_cpython +re2: +- 2023.09.01 +spdlog: +- '1.12' +target_platform: +- linux-64 +zip_keys: +- - c_stdlib_version + - cdt_name diff --git a/.ci_support/linux_64_python3.11.____cpython.yaml b/.ci_support/linux_64_python3.11.____cpython.yaml new file mode 100644 index 0000000..2166e6f --- /dev/null +++ b/.ci_support/linux_64_python3.11.____cpython.yaml @@ -0,0 +1,33 @@ +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +fmt: +- '10' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.11.* *_cpython +re2: +- 2023.09.01 +spdlog: +- '1.12' +target_platform: +- linux-64 +zip_keys: +- - c_stdlib_version + - cdt_name diff --git a/.ci_support/linux_64_python3.12.____cpython.yaml b/.ci_support/linux_64_python3.12.____cpython.yaml new file mode 100644 index 0000000..1acb96c --- /dev/null +++ b/.ci_support/linux_64_python3.12.____cpython.yaml @@ -0,0 +1,33 @@ +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +fmt: +- '10' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.12.* *_cpython +re2: +- 2023.09.01 +spdlog: +- '1.12' +target_platform: +- linux-64 +zip_keys: +- - c_stdlib_version + - cdt_name diff --git a/.ci_support/linux_64_python3.8.____cpython.yaml b/.ci_support/linux_64_python3.8.____cpython.yaml new file mode 100644 index 0000000..f93084b --- /dev/null +++ b/.ci_support/linux_64_python3.8.____cpython.yaml @@ -0,0 +1,33 @@ +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +fmt: +- '10' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.8.* *_cpython +re2: +- 2023.09.01 +spdlog: +- '1.12' +target_platform: +- linux-64 +zip_keys: +- - c_stdlib_version + - cdt_name diff --git a/.ci_support/linux_64_python3.9.____cpython.yaml b/.ci_support/linux_64_python3.9.____cpython.yaml new file mode 100644 index 0000000..1f99630 --- /dev/null +++ b/.ci_support/linux_64_python3.9.____cpython.yaml @@ -0,0 +1,33 @@ +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- cos7 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +fmt: +- '10' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_cpython +re2: +- 2023.09.01 +spdlog: +- '1.12' +target_platform: +- linux-64 +zip_keys: +- - c_stdlib_version + - cdt_name diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml new file mode 100644 index 0000000..e81447a --- /dev/null +++ b/.ci_support/osx_64_.yaml @@ -0,0 +1,26 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.15' +MACOSX_SDK_VERSION: +- '10.15' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.15' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cxx_compiler: +- clangxx +cxx_compiler_version: +- '16' +fmt: +- '10' +macos_machine: +- x86_64-apple-darwin13.4.0 +re2: +- 2023.09.01 +spdlog: +- '1.12' +target_platform: +- osx-64 diff --git a/.ci_support/win_64_.yaml b/.ci_support/win_64_.yaml new file mode 100644 index 0000000..4b92cdb --- /dev/null +++ b/.ci_support/win_64_.yaml @@ -0,0 +1,16 @@ +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cxx_compiler: +- vs2019 +fmt: +- '10' +re2: +- 2023.09.01 +spdlog: +- '1.12' +target_platform: +- win-64 diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..8b4ef2f --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,25 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +# -*- mode: jinja-yaml -*- + +version: 2 + +jobs: + build: + working_directory: ~/test + machine: + image: ubuntu-2004:current + steps: + - run: + # The Circle-CI build should not be active, but if this is not true for some reason, do a fast finish. + command: exit 0 + +workflows: + version: 2 + build_and_test: + jobs: + - build: + filters: + branches: + ignore: + - /.*/ diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..18f114a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,27 @@ +* text=auto + +*.patch binary +*.diff binary +meta.yaml text eol=lf +build.sh text eol=lf +bld.bat text eol=crlf + +# github helper pieces to make some files not show up in diffs automatically +.azure-pipelines/* linguist-generated=true +.circleci/* linguist-generated=true +.ci_support/README linguist-generated=true +.drone/* linguist-generated=true +.drone.yml linguist-generated=true +.github/* linguist-generated=true +.travis/* linguist-generated=true +.appveyor.yml linguist-generated=true +.gitattributes linguist-generated=true +.gitignore linguist-generated=true +.travis.yml linguist-generated=true +.scripts/* linguist-generated=true +.woodpecker.yml linguist-generated=true +/LICENSE.txt linguist-generated=true +/README.md linguist-generated=true +azure-pipelines.yml linguist-generated=true +build-locally.py linguist-generated=true +shippable.yml linguist-generated=true diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..7a110f0 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @jeongseok-meta \ No newline at end of file diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..0535f6a --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,17 @@ +on: + status: {} + check_suite: + types: + - completed + +jobs: + automerge-action: + runs-on: ubuntu-latest + name: automerge + steps: + - name: automerge-action + id: automerge-action + uses: conda-forge/automerge-action@main + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + rerendering_github_token: ${{ secrets.RERENDERING_GITHUB_TOKEN }} diff --git a/.github/workflows/webservices.yml b/.github/workflows/webservices.yml new file mode 100644 index 0000000..d6f06b5 --- /dev/null +++ b/.github/workflows/webservices.yml @@ -0,0 +1,13 @@ +on: repository_dispatch + +jobs: + webservices: + runs-on: ubuntu-latest + name: webservices + steps: + - name: webservices + id: webservices + uses: conda-forge/webservices-dispatch-action@main + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + rerendering_github_token: ${{ secrets.RERENDERING_GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..179afe5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# User content belongs under recipe/. +# Feedstock configuration goes in `conda-forge.yml` +# Everything else is managed by the conda-smithy rerender process. +# Please do not modify + +# Ignore all files and folders in root +* +!/conda-forge.yml + +# Don't ignore any files/folders if the parent folder is 'un-ignored' +# This also avoids warnings when adding an already-checked file with an ignored parent. +!/**/ +# Don't ignore any files/folders recursively in the following folders +!/recipe/** +!/.ci_support/** + +# Since we ignore files/folders recursively, any folders inside +# build_artifacts gets ignored which trips some build systems. +# To avoid that we 'un-ignore' all files/folders recursively +# and only ignore the root build_artifacts folder. +!/build_artifacts/** +/build_artifacts + +*.pyc diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh new file mode 100755 index 0000000..97dc8d9 --- /dev/null +++ b/.scripts/build_steps.sh @@ -0,0 +1,96 @@ +#!/usr/bin/env bash + +# PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here +# will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent +# changes to this script, consider a proposal to conda-smithy so that other feedstocks can also +# benefit from the improvement. + +# -*- mode: jinja-shell -*- + +set -xeuo pipefail +export FEEDSTOCK_ROOT="${FEEDSTOCK_ROOT:-/home/conda/feedstock_root}" +source ${FEEDSTOCK_ROOT}/.scripts/logging_utils.sh + + +( endgroup "Start Docker" ) 2> /dev/null + +( startgroup "Configuring conda" ) 2> /dev/null + +export PYTHONUNBUFFERED=1 +export RECIPE_ROOT="${RECIPE_ROOT:-/home/conda/recipe_root}" +export CI_SUPPORT="${FEEDSTOCK_ROOT}/.ci_support" +export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml" + +cat >~/.condarc <=24.1" +mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" + +# set up the condarc +setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" + +source run_conda_forge_build_setup + +# make the build number clobber +make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" + + + +( endgroup "Configuring conda" ) 2> /dev/null + +if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then + cp "${FEEDSTOCK_ROOT}/LICENSE.txt" "${RECIPE_ROOT}/recipe-scripts-license.txt" +fi + +if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then + if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then + EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" + fi + conda debug "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + ${EXTRA_CB_OPTIONS:-} \ + --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" + + # Drop into an interactive shell + /bin/bash +else + conda-build "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + --suppress-variables ${EXTRA_CB_OPTIONS:-} \ + --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" \ + --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}" + + ( startgroup "Inspecting artifacts" ) 2> /dev/null + + # inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 + command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" + + ( endgroup "Inspecting artifacts" ) 2> /dev/null + ( startgroup "Validating outputs" ) 2> /dev/null + + validate_recipe_outputs "${FEEDSTOCK_NAME}" + + ( endgroup "Validating outputs" ) 2> /dev/null + + ( startgroup "Uploading packages" ) 2> /dev/null + + if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then + upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" + fi + + ( endgroup "Uploading packages" ) 2> /dev/null +fi + +( startgroup "Final checks" ) 2> /dev/null + +touch "${FEEDSTOCK_ROOT}/build_artifacts/conda-forge-build-done-${CONFIG}" \ No newline at end of file diff --git a/.scripts/logging_utils.sh b/.scripts/logging_utils.sh new file mode 100644 index 0000000..aff009f --- /dev/null +++ b/.scripts/logging_utils.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Provide a unified interface for the different logging +# utilities CI providers offer. If unavailable, provide +# a compatible fallback (e.g. bare `echo xxxxxx`). + +function startgroup { + # Start a foldable group of log lines + # Pass a single argument, quoted + case ${CI:-} in + azure ) + echo "##[group]$1";; + travis ) + echo "$1" + echo -en 'travis_fold:start:'"${1// /}"'\r';; + github_actions ) + echo "::group::$1";; + * ) + echo "$1";; + esac +} 2> /dev/null + +function endgroup { + # End a foldable group of log lines + # Pass a single argument, quoted + + case ${CI:-} in + azure ) + echo "##[endgroup]";; + travis ) + echo -en 'travis_fold:end:'"${1// /}"'\r';; + github_actions ) + echo "::endgroup::";; + esac +} 2> /dev/null diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh new file mode 100755 index 0000000..00f377a --- /dev/null +++ b/.scripts/run_docker_build.sh @@ -0,0 +1,114 @@ +#!/usr/bin/env bash + +# PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here +# will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent +# changes to this script, consider a proposal to conda-smithy so that other feedstocks can also +# benefit from the improvement. + +source .scripts/logging_utils.sh + +( startgroup "Configure Docker" ) 2> /dev/null + +set -xeo pipefail + +THISDIR="$( cd "$( dirname "$0" )" >/dev/null && pwd )" +PROVIDER_DIR="$(basename $THISDIR)" + +FEEDSTOCK_ROOT="$( cd "$( dirname "$0" )/.." >/dev/null && pwd )" +RECIPE_ROOT="${FEEDSTOCK_ROOT}/recipe" + +if [ -z ${FEEDSTOCK_NAME} ]; then + export FEEDSTOCK_NAME=$(basename ${FEEDSTOCK_ROOT}) +fi + +if [[ "${sha:-}" == "" ]]; then + pushd "${FEEDSTOCK_ROOT}" + sha=$(git rev-parse HEAD) + popd +fi + +docker info + +# In order for the conda-build process in the container to write to the mounted +# volumes, we need to run with the same id as the host machine, which is +# normally the owner of the mounted volumes, or at least has write permission +export HOST_USER_ID=$(id -u) +# Check if docker-machine is being used (normally on OSX) and get the uid from +# the VM +if hash docker-machine 2> /dev/null && docker-machine active > /dev/null; then + export HOST_USER_ID=$(docker-machine ssh $(docker-machine active) id -u) +fi + +ARTIFACTS="$FEEDSTOCK_ROOT/build_artifacts" + +if [ -z "$CONFIG" ]; then + set +x + FILES=`ls .ci_support/linux_*` + CONFIGS="" + for file in $FILES; do + CONFIGS="${CONFIGS}'${file:12:-5}' or "; + done + echo "Need to set CONFIG env variable. Value can be one of ${CONFIGS:0:-4}" + exit 1 +fi + +if [ -z "${DOCKER_IMAGE}" ]; then + SHYAML_INSTALLED="$(shyaml -h || echo NO)" + if [ "${SHYAML_INSTALLED}" == "NO" ]; then + echo "WARNING: DOCKER_IMAGE variable not set and shyaml not installed. Trying to parse with coreutils" + DOCKER_IMAGE=$(cat .ci_support/${CONFIG}.yaml | grep '^docker_image:$' -A 1 | tail -n 1 | cut -b 3-) + if [ "${DOCKER_IMAGE}" = "" ]; then + echo "No docker_image entry found in ${CONFIG}. Falling back to quay.io/condaforge/linux-anvil-comp7" + DOCKER_IMAGE="quay.io/condaforge/linux-anvil-comp7" + fi + else + DOCKER_IMAGE="$(cat "${FEEDSTOCK_ROOT}/.ci_support/${CONFIG}.yaml" | shyaml get-value docker_image.0 quay.io/condaforge/linux-anvil-comp7 )" + fi +fi + +mkdir -p "$ARTIFACTS" +DONE_CANARY="$ARTIFACTS/conda-forge-build-done-${CONFIG}" +rm -f "$DONE_CANARY" + +# Allow people to specify extra default arguments to `docker run` (e.g. `--rm`) +DOCKER_RUN_ARGS="${CONDA_FORGE_DOCKER_RUN_ARGS}" +if [ -z "${CI}" ]; then + DOCKER_RUN_ARGS="-it ${DOCKER_RUN_ARGS}" +fi + +( endgroup "Configure Docker" ) 2> /dev/null + +( startgroup "Start Docker" ) 2> /dev/null + +export UPLOAD_PACKAGES="${UPLOAD_PACKAGES:-True}" +export IS_PR_BUILD="${IS_PR_BUILD:-False}" +docker pull "${DOCKER_IMAGE}" +docker run ${DOCKER_RUN_ARGS} \ + -v "${RECIPE_ROOT}":/home/conda/recipe_root:rw,z,delegated \ + -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root:rw,z,delegated \ + -e CONFIG \ + -e HOST_USER_ID \ + -e UPLOAD_PACKAGES \ + -e IS_PR_BUILD \ + -e GIT_BRANCH \ + -e UPLOAD_ON_BRANCH \ + -e CI \ + -e FEEDSTOCK_NAME \ + -e CPU_COUNT \ + -e BUILD_WITH_CONDA_DEBUG \ + -e BUILD_OUTPUT_ID \ + -e flow_run_id \ + -e remote_url \ + -e sha \ + -e BINSTAR_TOKEN \ + -e FEEDSTOCK_TOKEN \ + -e STAGING_BINSTAR_TOKEN \ + "${DOCKER_IMAGE}" \ + bash \ + "/home/conda/feedstock_root/${PROVIDER_DIR}/build_steps.sh" + +# verify that the end of the script was reached +test -f "$DONE_CANARY" + +# This closes the last group opened in `build_steps.sh` +( endgroup "Final checks" ) 2> /dev/null \ No newline at end of file diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh new file mode 100755 index 0000000..0c9e992 --- /dev/null +++ b/.scripts/run_osx_build.sh @@ -0,0 +1,104 @@ +#!/usr/bin/env bash + +# -*- mode: jinja-shell -*- + +source .scripts/logging_utils.sh + +set -xe + +MINIFORGE_HOME=${MINIFORGE_HOME:-${HOME}/miniforge3} + +( startgroup "Installing a fresh version of Miniforge" ) 2> /dev/null + +MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/latest/download" +MINIFORGE_FILE="Mambaforge-MacOSX-$(uname -m).sh" +curl -L -O "${MINIFORGE_URL}/${MINIFORGE_FILE}" +rm -rf ${MINIFORGE_HOME} +bash $MINIFORGE_FILE -b -p ${MINIFORGE_HOME} + +( endgroup "Installing a fresh version of Miniforge" ) 2> /dev/null + +( startgroup "Configuring conda" ) 2> /dev/null + +source ${MINIFORGE_HOME}/etc/profile.d/conda.sh +conda activate base +export CONDA_SOLVER="libmamba" +export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 + +mamba install --update-specs --quiet --yes --channel conda-forge --strict-channel-priority \ + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" +mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" + + + +echo -e "\n\nSetting up the condarc and mangling the compiler." +setup_conda_rc ./ ./recipe ./.ci_support/${CONFIG}.yaml + +if [[ "${CI:-}" != "" ]]; then + mangle_compiler ./ ./recipe .ci_support/${CONFIG}.yaml +fi + +if [[ "${CI:-}" != "" ]]; then + echo -e "\n\nMangling homebrew in the CI to avoid conflicts." + /usr/bin/sudo mangle_homebrew + /usr/bin/sudo -k +else + echo -e "\n\nNot mangling homebrew as we are not running in CI" +fi + +if [[ "${sha:-}" == "" ]]; then + sha=$(git rev-parse HEAD) +fi + +echo -e "\n\nRunning the build setup script." +source run_conda_forge_build_setup + + + +( endgroup "Configuring conda" ) 2> /dev/null + +echo -e "\n\nMaking the build clobber file" +make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml + +if [[ -f LICENSE.txt ]]; then + cp LICENSE.txt "recipe/recipe-scripts-license.txt" +fi + +if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then + if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then + EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" + fi + conda debug ./recipe -m ./.ci_support/${CONFIG}.yaml \ + ${EXTRA_CB_OPTIONS:-} \ + --clobber-file ./.ci_support/clobber_${CONFIG}.yaml + + # Drop into an interactive shell + /bin/bash +else + + conda-build ./recipe -m ./.ci_support/${CONFIG}.yaml \ + --suppress-variables ${EXTRA_CB_OPTIONS:-} \ + --clobber-file ./.ci_support/clobber_${CONFIG}.yaml \ + --extra-meta flow_run_id="$flow_run_id" remote_url="$remote_url" sha="$sha" + + ( startgroup "Inspecting artifacts" ) 2> /dev/null + + # inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 + command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" + + ( endgroup "Inspecting artifacts" ) 2> /dev/null + ( startgroup "Validating outputs" ) 2> /dev/null + + validate_recipe_outputs "${FEEDSTOCK_NAME}" + + ( endgroup "Validating outputs" ) 2> /dev/null + + ( startgroup "Uploading packages" ) 2> /dev/null + + if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then + upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" ./ ./recipe ./.ci_support/${CONFIG}.yaml + fi + + ( endgroup "Uploading packages" ) 2> /dev/null +fi \ No newline at end of file diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat new file mode 100755 index 0000000..24ef201 --- /dev/null +++ b/.scripts/run_win_build.bat @@ -0,0 +1,125 @@ +:: PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here +:: will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent +:: changes to this script, consider a proposal to conda-smithy so that other feedstocks can also +:: benefit from the improvement. + +:: Note: we assume a Miniforge installation is available + +:: INPUTS (required environment variables) +:: CONFIG: name of the .ci_support/*.yaml file for this job +:: CI: azure, github_actions, or unset +:: UPLOAD_PACKAGES: true or false +:: UPLOAD_ON_BRANCH: true or false + +setlocal enableextensions enabledelayedexpansion + +call :start_group "Configuring conda" + +:: Activate the base conda environment +call activate base +:: Configure the solver +set "CONDA_SOLVER=libmamba" +if !errorlevel! neq 0 exit /b !errorlevel! +set "CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1" + +:: Provision the necessary dependencies to build the recipe later +echo Installing dependencies +mamba.exe install "python=3.10" pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" -c conda-forge --strict-channel-priority --yes +if !errorlevel! neq 0 exit /b !errorlevel! + +:: Set basic configuration +echo Setting up configuration +setup_conda_rc .\ ".\recipe" .\.ci_support\%CONFIG%.yaml +if !errorlevel! neq 0 exit /b !errorlevel! +echo Running build setup +CALL run_conda_forge_build_setup + + +if !errorlevel! neq 0 exit /b !errorlevel! + +if EXIST LICENSE.txt ( + echo Copying feedstock license + copy LICENSE.txt "recipe\\recipe-scripts-license.txt" +) + +if NOT [%flow_run_id%] == [] ( + set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --extra-meta flow_run_id=%flow_run_id% remote_url=%remote_url% sha=%sha%" +) + +call :end_group + +:: Build the recipe +echo Building recipe +conda-build.exe "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% +if !errorlevel! neq 0 exit /b !errorlevel! + +call :start_group "Inspecting artifacts" +:: inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 +WHERE inspect_artifacts >nul 2>nul && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" +call :end_group + +:: Prepare some environment variables for the upload step +if /i "%CI%" == "github_actions" ( + set "FEEDSTOCK_NAME=%GITHUB_REPOSITORY:*/=%" + set "GIT_BRANCH=%GITHUB_REF:refs/heads/=%" + if /i "%GITHUB_EVENT_NAME%" == "pull_request" ( + set "IS_PR_BUILD=True" + ) else ( + set "IS_PR_BUILD=False" + ) + set "TEMP=%RUNNER_TEMP%" +) +if /i "%CI%" == "azure" ( + set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" + set "GIT_BRANCH=%BUILD_SOURCEBRANCHNAME%" + if /i "%BUILD_REASON%" == "PullRequest" ( + set "IS_PR_BUILD=True" + ) else ( + set "IS_PR_BUILD=False" + ) + set "TEMP=%UPLOAD_TEMP%" +) + +:: Validate +call :start_group "Validating outputs" +validate_recipe_outputs "%FEEDSTOCK_NAME%" +if !errorlevel! neq 0 exit /b !errorlevel! +call :end_group + +if /i "%UPLOAD_PACKAGES%" == "true" ( + if /i "%IS_PR_BUILD%" == "false" ( + call :start_group "Uploading packages" + if not exist "%TEMP%\" md "%TEMP%" + set "TMP=%TEMP%" + upload_package --validate --feedstock-name="%FEEDSTOCK_NAME%" .\ ".\recipe" .ci_support\%CONFIG%.yaml + if !errorlevel! neq 0 exit /b !errorlevel! + call :end_group + ) +) + +exit + +:: Logging subroutines + +:start_group +if /i "%CI%" == "github_actions" ( + echo ::group::%~1 + exit /b +) +if /i "%CI%" == "azure" ( + echo ##[group]%~1 + exit /b +) +echo %~1 +exit /b + +:end_group +if /i "%CI%" == "github_actions" ( + echo ::endgroup:: + exit /b +) +if /i "%CI%" == "azure" ( + echo ##[endgroup] + exit /b +) +exit /b \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..2ec51d7 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,27 @@ +BSD-3-Clause license +Copyright (c) 2015-2022, conda-forge contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c84c07f --- /dev/null +++ b/README.md @@ -0,0 +1,213 @@ +About momentum-feedstock +======================== + +Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/momentum-feedstock/blob/main/LICENSE.txt) + +Home: https://facebookincubator.github.io/momentum/ + +Package license: MIT + +Summary: A library for human kinematic motion and numerical optimization solvers to apply human motion + +Development: https://github.com/facebookincubator/momentum + +A library for human kinematic motion and numerical optimization solvers to apply human motion + + +Current build status +==================== + + + + + + + + +
Azure +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VariantStatus
linux_64_python3.10.____cpython + + variant + +
linux_64_python3.11.____cpython + + variant + +
linux_64_python3.12.____cpython + + variant + +
linux_64_python3.8.____cpython + + variant + +
linux_64_python3.9.____cpython + + variant + +
osx_64 + + variant + +
win_64 + + variant + +
+
+
+ +Current release info +==================== + +| Name | Downloads | Version | Platforms | +| --- | --- | --- | --- | +| [![Conda Recipe](https://img.shields.io/badge/recipe-momentum-green.svg)](https://anaconda.org/conda-forge/momentum) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/momentum.svg)](https://anaconda.org/conda-forge/momentum) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/momentum.svg)](https://anaconda.org/conda-forge/momentum) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/momentum.svg)](https://anaconda.org/conda-forge/momentum) | + +Installing momentum +=================== + +Installing `momentum` from the `conda-forge` channel can be achieved by adding `conda-forge` to your channels with: + +``` +conda config --add channels conda-forge +conda config --set channel_priority strict +``` + +Once the `conda-forge` channel has been enabled, `momentum` can be installed with `conda`: + +``` +conda install momentum +``` + +or with `mamba`: + +``` +mamba install momentum +``` + +It is possible to list all of the versions of `momentum` available on your platform with `conda`: + +``` +conda search momentum --channel conda-forge +``` + +or with `mamba`: + +``` +mamba search momentum --channel conda-forge +``` + +Alternatively, `mamba repoquery` may provide more information: + +``` +# Search all versions available on your platform: +mamba repoquery search momentum --channel conda-forge + +# List packages depending on `momentum`: +mamba repoquery whoneeds momentum --channel conda-forge + +# List dependencies of `momentum`: +mamba repoquery depends momentum --channel conda-forge +``` + + +About conda-forge +================= + +[![Powered by +NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org) + +conda-forge is a community-led conda channel of installable packages. +In order to provide high-quality builds, the process has been automated into the +conda-forge GitHub organization. The conda-forge organization contains one repository +for each of the installable packages. Such a repository is known as a *feedstock*. + +A feedstock is made up of a conda recipe (the instructions on what and how to build +the package) and the necessary configurations for automatic building using freely +available continuous integration services. Thanks to the awesome service provided by +[Azure](https://azure.microsoft.com/en-us/services/devops/), [GitHub](https://github.com/), +[CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/), +[Drone](https://cloud.drone.io/welcome), and [TravisCI](https://travis-ci.com/) +it is possible to build and upload installable packages to the +[conda-forge](https://anaconda.org/conda-forge) [anaconda.org](https://anaconda.org/) +channel for Linux, Windows and OSX respectively. + +To manage the continuous integration and simplify feedstock maintenance +[conda-smithy](https://github.com/conda-forge/conda-smithy) has been developed. +Using the ``conda-forge.yml`` within this repository, it is possible to re-render all of +this feedstock's supporting files (e.g. the CI configuration files) with ``conda smithy rerender``. + +For more information please check the [conda-forge documentation](https://conda-forge.org/docs/). + +Terminology +=========== + +**feedstock** - the conda recipe (raw material), supporting scripts and CI configuration. + +**conda-smithy** - the tool which helps orchestrate the feedstock. + Its primary use is in the construction of the CI ``.yml`` files + and simplify the management of *many* feedstocks. + +**conda-forge** - the place where the feedstock and smithy live and work to + produce the finished article (built conda distributions) + + +Updating momentum-feedstock +=========================== + +If you would like to improve the momentum recipe or build a new +package version, please fork this repository and submit a PR. Upon submission, +your changes will be run on the appropriate platforms to give the reviewer an +opportunity to confirm that the changes result in a successful build. Once +merged, the recipe will be re-built and uploaded automatically to the +`conda-forge` channel, whereupon the built conda packages will be available for +everybody to install and use from the `conda-forge` channel. +Note that all branches in the conda-forge/momentum-feedstock are +immediately built and any created packages are uploaded, so PRs should be based +on branches in forks and branches in the main repository should only be used to +build distinct package versions. + +In order to produce a uniquely identifiable distribution: + * If the version of a package **is not** being increased, please add or increase + the [``build/number``](https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-number-and-string). + * If the version of a package **is** being increased, please remember to return + the [``build/number``](https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-number-and-string) + back to 0. + +Feedstock Maintainers +===================== + +* [@jeongseok-meta](https://github.com/jeongseok-meta/) + diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..e5306da --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,8 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +# -*- mode: yaml -*- + +jobs: + - template: ./.azure-pipelines/azure-pipelines-linux.yml + - template: ./.azure-pipelines/azure-pipelines-osx.yml + - template: ./.azure-pipelines/azure-pipelines-win.yml \ No newline at end of file diff --git a/build-locally.py b/build-locally.py new file mode 100755 index 0000000..e0d408d --- /dev/null +++ b/build-locally.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +# +# This file has been generated by conda-smithy in order to build the recipe +# locally. +# +import os +import glob +import subprocess +from argparse import ArgumentParser +import platform + + +def setup_environment(ns): + os.environ["CONFIG"] = ns.config + os.environ["UPLOAD_PACKAGES"] = "False" + os.environ["IS_PR_BUILD"] = "True" + if ns.debug: + os.environ["BUILD_WITH_CONDA_DEBUG"] = "1" + if ns.output_id: + os.environ["BUILD_OUTPUT_ID"] = ns.output_id + if "MINIFORGE_HOME" not in os.environ: + os.environ["MINIFORGE_HOME"] = os.path.join( + os.path.dirname(__file__), "miniforge3" + ) + + +def run_docker_build(ns): + script = ".scripts/run_docker_build.sh" + subprocess.check_call([script]) + + +def run_osx_build(ns): + script = ".scripts/run_osx_build.sh" + subprocess.check_call([script]) + + +def verify_config(ns): + valid_configs = { + os.path.basename(f)[:-5] for f in glob.glob(".ci_support/*.yaml") + } + print(f"valid configs are {valid_configs}") + if ns.config in valid_configs: + print("Using " + ns.config + " configuration") + return + elif len(valid_configs) == 1: + ns.config = valid_configs.pop() + print("Found " + ns.config + " configuration") + elif ns.config is None: + print("config not selected, please choose from the following:\n") + selections = list(enumerate(sorted(valid_configs), 1)) + for i, c in selections: + print(f"{i}. {c}") + s = input("\n> ") + idx = int(s) - 1 + ns.config = selections[idx][1] + print(f"selected {ns.config}") + else: + raise ValueError("config " + ns.config + " is not valid") + # Remove the following, as implemented + if ns.config.startswith("win"): + raise ValueError( + f"only Linux/macOS configs currently supported, got {ns.config}" + ) + elif ns.config.startswith("osx"): + if "OSX_SDK_DIR" not in os.environ: + raise RuntimeError( + "Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=$PWD/SDKs' " + "to download the SDK automatically to '$PWD/SDKs/MacOSX.sdk'. " + "Note: OSX_SDK_DIR must be set to an absolute path. " + "Setting this variable implies agreement to the licensing terms of the SDK by Apple." + ) + + +def main(args=None): + p = ArgumentParser("build-locally") + p.add_argument("config", default=None, nargs="?") + p.add_argument( + "--debug", + action="store_true", + help="Setup debug environment using `conda debug`", + ) + p.add_argument( + "--output-id", help="If running debug, specify the output to setup." + ) + + ns = p.parse_args(args=args) + verify_config(ns) + setup_environment(ns) + + try: + if ns.config.startswith("linux") or ( + ns.config.startswith("osx") and platform.system() == "Linux" + ): + run_docker_build(ns) + elif ns.config.startswith("osx"): + run_osx_build(ns) + finally: + recipe_license_file = os.path.join( + "recipe", "recipe-scripts-license.txt" + ) + if os.path.exists(recipe_license_file): + os.remove(recipe_license_file) + + +if __name__ == "__main__": + main() diff --git a/conda-forge.yml b/conda-forge.yml index 9e26dfe..e30df6f 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -1 +1,6 @@ -{} \ No newline at end of file +github: + branch_name: main + tooling_branch_name: main +conda_build: + error_overlinking: true +conda_forge_output_validation: true