From 523060c0c127cd7ab23324d191a4e50dd5279bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Thu, 3 Nov 2022 22:08:07 +0100 Subject: [PATCH 1/3] Rebuild with rerender --- .ci_support/README | 7 +- .ci_support/linux_64_.yaml | 10 + .../linux_64_python3.7.____cpython.yaml | 19 -- .../linux_64_python3.8.____cpython.yaml | 19 -- .../linux_64_python3.9.____cpython.yaml | 19 -- .ci_support/osx_64_.yaml | 10 + .ci_support/osx_64_python3.7.____cpython.yaml | 16 -- .ci_support/osx_64_python3.8.____cpython.yaml | 16 -- .ci_support/osx_64_python3.9.____cpython.yaml | 16 -- .ci_support/win_64_.yaml | 6 + .ci_support/win_64_python3.7.____cpython.yaml | 12 - .ci_support/win_64_python3.8.____cpython.yaml | 12 - .ci_support/win_64_python3.9.____cpython.yaml | 12 - .circleci/config.yml | 5 +- .gitattributes | 1 + .github/workflows/automerge.yml | 3 +- .github/workflows/conda-build.yml | 205 ++++++++---------- .github/workflows/webservices.yml | 1 + .scripts/build_steps.sh | 21 +- .scripts/run_docker_build.sh | 2 +- .scripts/run_osx_build.sh | 51 +++-- LICENSE.txt | 32 ++- README.md | 36 ++- build-locally.py | 30 +-- conda-forge.yml | 5 + recipe/conda_build_config.yaml | 6 +- recipe/meta.yaml | 14 +- 27 files changed, 276 insertions(+), 310 deletions(-) create mode 100644 .ci_support/linux_64_.yaml delete mode 100644 .ci_support/linux_64_python3.7.____cpython.yaml delete mode 100644 .ci_support/linux_64_python3.8.____cpython.yaml delete mode 100644 .ci_support/linux_64_python3.9.____cpython.yaml create mode 100644 .ci_support/osx_64_.yaml delete mode 100644 .ci_support/osx_64_python3.7.____cpython.yaml delete mode 100644 .ci_support/osx_64_python3.8.____cpython.yaml delete mode 100644 .ci_support/osx_64_python3.9.____cpython.yaml create mode 100644 .ci_support/win_64_.yaml delete mode 100644 .ci_support/win_64_python3.7.____cpython.yaml delete mode 100644 .ci_support/win_64_python3.8.____cpython.yaml delete mode 100644 .ci_support/win_64_python3.9.____cpython.yaml diff --git a/.ci_support/README b/.ci_support/README index e4e2dce..a47316b 100644 --- a/.ci_support/README +++ b/.ci_support/README @@ -1 +1,6 @@ -This file is automatically generated by conda-smithy. To change any matrix elements, you should change conda-smithy's input conda_build_config.yaml and re-render the recipe, rather than editing these files directly. \ No newline at end of file +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_.yaml b/.ci_support/linux_64_.yaml new file mode 100644 index 0000000..2d9cbdb --- /dev/null +++ b/.ci_support/linux_64_.yaml @@ -0,0 +1,10 @@ +cdt_name: +- cos6 +channel_sources: +- napari/label/bundle_tools_2,conda-forge +channel_targets: +- napari bundle_tools +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +target_os: +- linux diff --git a/.ci_support/linux_64_python3.7.____cpython.yaml b/.ci_support/linux_64_python3.7.____cpython.yaml deleted file mode 100644 index 362aade..0000000 --- a/.ci_support/linux_64_python3.7.____cpython.yaml +++ /dev/null @@ -1,19 +0,0 @@ -cdt_name: -- cos6 -channel_sources: -- napari/label/bundle_tools,conda-forge -channel_targets: -- napari bundle_tools -docker_image: -- quay.io/condaforge/linux-anvil-comp7 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.7.* *_cpython -target_platform: -- linux-64 -zip_keys: -- - cdt_name - - docker_image diff --git a/.ci_support/linux_64_python3.8.____cpython.yaml b/.ci_support/linux_64_python3.8.____cpython.yaml deleted file mode 100644 index c916469..0000000 --- a/.ci_support/linux_64_python3.8.____cpython.yaml +++ /dev/null @@ -1,19 +0,0 @@ -cdt_name: -- cos6 -channel_sources: -- napari/label/bundle_tools,conda-forge -channel_targets: -- napari bundle_tools -docker_image: -- quay.io/condaforge/linux-anvil-comp7 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.8.* *_cpython -target_platform: -- linux-64 -zip_keys: -- - cdt_name - - docker_image diff --git a/.ci_support/linux_64_python3.9.____cpython.yaml b/.ci_support/linux_64_python3.9.____cpython.yaml deleted file mode 100644 index 98b8ad0..0000000 --- a/.ci_support/linux_64_python3.9.____cpython.yaml +++ /dev/null @@ -1,19 +0,0 @@ -cdt_name: -- cos6 -channel_sources: -- napari/label/bundle_tools,conda-forge -channel_targets: -- napari bundle_tools -docker_image: -- quay.io/condaforge/linux-anvil-comp7 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.9.* *_cpython -target_platform: -- linux-64 -zip_keys: -- - cdt_name - - docker_image diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml new file mode 100644 index 0000000..ab12005 --- /dev/null +++ b/.ci_support/osx_64_.yaml @@ -0,0 +1,10 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.9' +channel_sources: +- napari/label/bundle_tools_2,conda-forge +channel_targets: +- napari bundle_tools +macos_machine: +- x86_64-apple-darwin13.4.0 +target_os: +- osx diff --git a/.ci_support/osx_64_python3.7.____cpython.yaml b/.ci_support/osx_64_python3.7.____cpython.yaml deleted file mode 100644 index e634579..0000000 --- a/.ci_support/osx_64_python3.7.____cpython.yaml +++ /dev/null @@ -1,16 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '10.9' -channel_sources: -- napari/label/bundle_tools,conda-forge -channel_targets: -- napari bundle_tools -macos_machine: -- x86_64-apple-darwin13.4.0 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.7.* *_cpython -target_platform: -- osx-64 diff --git a/.ci_support/osx_64_python3.8.____cpython.yaml b/.ci_support/osx_64_python3.8.____cpython.yaml deleted file mode 100644 index d3ea818..0000000 --- a/.ci_support/osx_64_python3.8.____cpython.yaml +++ /dev/null @@ -1,16 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '10.9' -channel_sources: -- napari/label/bundle_tools,conda-forge -channel_targets: -- napari bundle_tools -macos_machine: -- x86_64-apple-darwin13.4.0 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.8.* *_cpython -target_platform: -- osx-64 diff --git a/.ci_support/osx_64_python3.9.____cpython.yaml b/.ci_support/osx_64_python3.9.____cpython.yaml deleted file mode 100644 index ba03a87..0000000 --- a/.ci_support/osx_64_python3.9.____cpython.yaml +++ /dev/null @@ -1,16 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '10.9' -channel_sources: -- napari/label/bundle_tools,conda-forge -channel_targets: -- napari bundle_tools -macos_machine: -- x86_64-apple-darwin13.4.0 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.9.* *_cpython -target_platform: -- osx-64 diff --git a/.ci_support/win_64_.yaml b/.ci_support/win_64_.yaml new file mode 100644 index 0000000..4ab389e --- /dev/null +++ b/.ci_support/win_64_.yaml @@ -0,0 +1,6 @@ +channel_sources: +- napari/label/bundle_tools_2,conda-forge +channel_targets: +- napari bundle_tools +target_os: +- win diff --git a/.ci_support/win_64_python3.7.____cpython.yaml b/.ci_support/win_64_python3.7.____cpython.yaml deleted file mode 100644 index c07d8af..0000000 --- a/.ci_support/win_64_python3.7.____cpython.yaml +++ /dev/null @@ -1,12 +0,0 @@ -channel_sources: -- napari/label/bundle_tools,conda-forge -channel_targets: -- napari bundle_tools -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.7.* *_cpython -target_platform: -- win-64 diff --git a/.ci_support/win_64_python3.8.____cpython.yaml b/.ci_support/win_64_python3.8.____cpython.yaml deleted file mode 100644 index d3556d5..0000000 --- a/.ci_support/win_64_python3.8.____cpython.yaml +++ /dev/null @@ -1,12 +0,0 @@ -channel_sources: -- napari/label/bundle_tools,conda-forge -channel_targets: -- napari bundle_tools -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.8.* *_cpython -target_platform: -- win-64 diff --git a/.ci_support/win_64_python3.9.____cpython.yaml b/.ci_support/win_64_python3.9.____cpython.yaml deleted file mode 100644 index 99948c6..0000000 --- a/.ci_support/win_64_python3.9.____cpython.yaml +++ /dev/null @@ -1,12 +0,0 @@ -channel_sources: -- napari/label/bundle_tools,conda-forge -channel_targets: -- napari bundle_tools -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.9.* *_cpython -target_platform: -- win-64 diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ad461b..8b4ef2f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,13 +1,14 @@ # 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 -*- +# -*- mode: jinja-yaml -*- version: 2 jobs: build: working_directory: ~/test - machine: true + 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. diff --git a/.gitattributes b/.gitattributes index ce52713..7f32763 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,6 +9,7 @@ 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 diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index e8e5902..54dd780 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -10,9 +10,10 @@ jobs: name: automerge steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: automerge-action id: automerge-action uses: conda-forge/automerge-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} + rerendering_github_token: ${{ secrets.RERENDERING_GITHUB_TOKEN }} diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index 61a44c0..5c6e050 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -3,11 +3,7 @@ # -*- mode: yaml -*- name: Build conda package -on: - push: - branches: - - master - pull_request: +on: [push, pull_request] jobs: build: @@ -17,121 +13,108 @@ jobs: fail-fast: false matrix: include: - - CONFIG: linux_64_python3.7.____cpython + - CONFIG: linux_64_ UPLOAD_PACKAGES: True - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-comp7 + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 os: ubuntu - - CONFIG: linux_64_python3.8.____cpython - UPLOAD_PACKAGES: True - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-comp7 - os: ubuntu - - CONFIG: linux_64_python3.9.____cpython - UPLOAD_PACKAGES: True - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-comp7 - os: ubuntu - - CONFIG: win_64_python3.7.____cpython - UPLOAD_PACKAGES: True - os: windows - - CONFIG: win_64_python3.8.____cpython - UPLOAD_PACKAGES: True - os: windows - - CONFIG: win_64_python3.9.____cpython + - CONFIG: win_64_ UPLOAD_PACKAGES: True os: windows - - CONFIG: osx_64_python3.7.____cpython - UPLOAD_PACKAGES: True - os: macos - - CONFIG: osx_64_python3.8.____cpython - UPLOAD_PACKAGES: True - os: macos - - CONFIG: osx_64_python3.9.____cpython + - CONFIG: osx_64_ UPLOAD_PACKAGES: True os: macos steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Build on Linux - if: matrix.os == 'ubuntu' - env: - CONFIG: ${{ matrix.CONFIG }} - UPLOAD_PACKAGES: ${{ matrix.UPLOAD_PACKAGES }} - DOCKER_IMAGE: ${{ matrix.DOCKER_IMAGE }} - CI: github_actions - BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} - FEEDSTOCK_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }} - STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }} - shell: bash - run: | - echo "::group::Configure binfmt_misc" - docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes - export FEEDSTOCK_NAME="$(basename $GITHUB_REPOSITORY)" - export GIT_BRANCH="$(basename $GITHUB_REF)" - if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then - export IS_PR_BUILD="True" - else - export IS_PR_BUILD="False" - fi - echo "::endgroup::" - ./.scripts/run_docker_build.sh + - name: Checkout code + uses: actions/checkout@v3 - - name: Build on macOS - if: matrix.os == 'macos' - env: - CONFIG: ${{ matrix.CONFIG }} - UPLOAD_PACKAGES: ${{ matrix.UPLOAD_PACKAGES }} - CI: github_actions - BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} - FEEDSTOCK_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }} - STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }} - shell: bash - run: | - export FEEDSTOCK_NAME="$(basename $GITHUB_REPOSITORY)" - export GIT_BRANCH="$(basename $GITHUB_REF)" - if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then - export IS_PR_BUILD="True" - else - export IS_PR_BUILD="False" - fi - ./.scripts/run_osx_build.sh + - name: Build on Linux + if: matrix.os == 'ubuntu' + env: + CONFIG: ${{ matrix.CONFIG }} + UPLOAD_PACKAGES: ${{ matrix.UPLOAD_PACKAGES }} + DOCKER_IMAGE: ${{ matrix.DOCKER_IMAGE }} + CI: github_actions + UPLOAD_ON_BRANCH: main + BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} + FEEDSTOCK_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }} + STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }} + shell: bash + run: | + echo "::group::Configure binfmt_misc" + docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes + export FEEDSTOCK_NAME="$(basename $GITHUB_REPOSITORY)" + export GIT_BRANCH="$(basename $GITHUB_REF)" + if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then + export IS_PR_BUILD="True" + else + export IS_PR_BUILD="False" + fi + echo "::endgroup::" + ./.scripts/run_docker_build.sh - - name: Install Miniconda for windows - uses: conda-incubator/setup-miniconda@v2 - with: - miniforge-version: latest - if: matrix.os == 'windows' + - name: Build on macOS + if: matrix.os == 'macos' + env: + CONFIG: ${{ matrix.CONFIG }} + UPLOAD_PACKAGES: ${{ matrix.UPLOAD_PACKAGES }} + CI: github_actions + UPLOAD_ON_BRANCH: main + BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} + FEEDSTOCK_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }} + STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }} + shell: bash + run: | + export FEEDSTOCK_NAME="$(basename $GITHUB_REPOSITORY)" + export GIT_BRANCH="$(basename $GITHUB_REF)" + if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then + export IS_PR_BUILD="True" + else + export IS_PR_BUILD="False" + fi + ./.scripts/run_osx_build.sh - - name: Build on windows - shell: cmd - run: | - call activate base - conda.exe install -c conda-forge python conda-build conda "conda-forge-ci-setup=3" pip boa - if errorlevel 1 exit 1 - setup_conda_rc .\ ".\recipe" .\.ci_support\%CONFIG%.yaml - if errorlevel 1 exit 1 + - name: Install Miniconda for windows + uses: conda-incubator/setup-miniconda@v2 + with: + miniforge-version: latest + miniforge-variant: Mambaforge + if: matrix.os == 'windows' + - name: Build on windows + shell: cmd + run: | + call activate base + mamba.exe install -c conda-forge 'python=3.9' conda-build conda pip boa conda-forge-ci-setup=3 "py-lief<0.12" + if errorlevel 1 exit 1 + setup_conda_rc .\ ".\recipe" .\.ci_support\%CONFIG%.yaml + if errorlevel 1 exit 1 + - conda.exe mambabuild "recipe" -m .ci_support\%CONFIG%.yaml - if errorlevel 1 exit 1 - 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" - ) - validate_recipe_outputs "%FEEDSTOCK_NAME%" - if errorlevel 1 exit 1 - if /i "%UPLOAD_PACKAGES%" == "true" ( - if /i "%IS_PR_BUILD%" == "false" ( - upload_package --validate --feedstock-name="%FEEDSTOCK_NAME%" .\ ".\recipe" .ci_support\%CONFIG%.yaml - ) + if EXIST LICENSE.txt ( + copy LICENSE.txt "recipe\\recipe-scripts-license.txt" + ) + conda.exe mambabuild "recipe" -m .ci_support\%CONFIG%.yaml + if errorlevel 1 exit 1 + 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" + ) + validate_recipe_outputs "%FEEDSTOCK_NAME%" + if errorlevel 1 exit 1 + if /i "%UPLOAD_PACKAGES%" == "true" ( + if /i "%IS_PR_BUILD%" == "false" ( + upload_package --validate --feedstock-name="%FEEDSTOCK_NAME%" .\ ".\recipe" .ci_support\%CONFIG%.yaml ) - env: - PYTHONUNBUFFERED: 1 - CONFIG: ${{ matrix.CONFIG }} - CI: github_actions - UPLOAD_PACKAGES: ${{ matrix.UPLOAD_PACKAGES }} - BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} - FEEDSTOCK_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }} - STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }} - if: matrix.os == 'windows' + ) + env: + PYTHONUNBUFFERED: 1 + CONFIG: ${{ matrix.CONFIG }} + CI: github_actions + UPLOAD_PACKAGES: ${{ matrix.UPLOAD_PACKAGES }} + UPLOAD_ON_BRANCH: main + BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} + FEEDSTOCK_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }} + STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }} + if: matrix.os == 'windows' \ No newline at end of file diff --git a/.github/workflows/webservices.yml b/.github/workflows/webservices.yml index 78f51e6..2e5fe71 100644 --- a/.github/workflows/webservices.yml +++ b/.github/workflows/webservices.yml @@ -10,3 +10,4 @@ jobs: uses: conda-forge/webservices-dispatch-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} + rerendering_github_token: ${{ secrets.RERENDERING_GITHUB_TOKEN }} diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index a85ae38..71a4242 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -5,6 +5,8 @@ # 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 @@ -22,13 +24,18 @@ export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml" cat >~/.condarc < /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}" @@ -53,7 +64,7 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then # Drop into an interactive shell /bin/bash else - conda $BUILD_CMD "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + conda mambabuild "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ --suppress-variables ${EXTRA_CB_OPTIONS:-} \ --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" ( startgroup "Validating outputs" ) 2> /dev/null diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index 0c6515f..9236239 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -14,7 +14,7 @@ set -xeo pipefail THISDIR="$( cd "$( dirname "$0" )" >/dev/null && pwd )" PROVIDER_DIR="$(basename $THISDIR)" -FEEDSTOCK_ROOT=$(cd "$(dirname "$0")/.."; pwd;) +FEEDSTOCK_ROOT="$( cd "$( dirname "$0" )/.." >/dev/null && pwd )" RECIPE_ROOT="${FEEDSTOCK_ROOT}/recipe" if [ -z ${FEEDSTOCK_NAME} ]; then diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index d6de123..caa788e 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# -*- mode: jinja-shell -*- + source .scripts/logging_utils.sh set -xe @@ -9,7 +11,7 @@ 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="Miniforge3-MacOSX-$(uname -m).sh" +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} @@ -18,14 +20,13 @@ bash $MINIFORGE_FILE -b -p ${MINIFORGE_HOME} ( startgroup "Configuring conda" ) 2> /dev/null -GET_BOA=boa -BUILD_CMD=mambabuild - source ${MINIFORGE_HOME}/etc/profile.d/conda.sh conda activate base -echo -e "\n\nInstalling conda-forge-ci-setup=3 and conda-build." -conda install -n base --quiet --yes "conda-forge-ci-setup=3" conda-build pip ${GET_BOA:-} +mamba install --update-specs --quiet --yes --channel conda-forge \ + conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" +mamba update --update-specs --yes --quiet --channel conda-forge \ + conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" @@ -51,21 +52,39 @@ 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 -conda $BUILD_CMD ./recipe -m ./.ci_support/${CONFIG}.yaml --suppress-variables --clobber-file ./.ci_support/clobber_${CONFIG}.yaml ${EXTRA_CB_OPTIONS:-} -( startgroup "Validating outputs" ) 2> /dev/null -validate_recipe_outputs "${FEEDSTOCK_NAME}" +if [[ -f LICENSE.txt ]]; then + cp LICENSE.txt "recipe/recipe-scripts-license.txt" +fi -( endgroup "Validating outputs" ) 2> /dev/null +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 -( startgroup "Uploading packages" ) 2> /dev/null + # Drop into an interactive shell + /bin/bash +else + conda mambabuild ./recipe -m ./.ci_support/${CONFIG}.yaml \ + --suppress-variables ${EXTRA_CB_OPTIONS:-} \ + --clobber-file ./.ci_support/clobber_${CONFIG}.yaml + ( startgroup "Validating outputs" ) 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 + 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 \ No newline at end of file + ( endgroup "Uploading packages" ) 2> /dev/null +fi \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt index ed3f451..2ec51d7 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,13 +1,27 @@ -BSD 3-clause license -Copyright (c) 2015-2021, conda-forge contributors +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: +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. + 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. -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 COPYRIGHT HOLDER 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. +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 index 0ae316a..ceff4e3 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,12 @@ Current build status ==================== - +
+ + +
All platforms: + noarch disabled +
Current release info @@ -42,18 +47,43 @@ conda config --add channels napari conda config --set channel_priority strict ``` -Once the `napari` channel has been enabled, `constructor` can be installed with: +Once the `napari` channel has been enabled, `constructor` can be installed with `conda`: ``` conda install constructor ``` -It is possible to list all of the versions of `constructor` available on your platform with: +or with `mamba`: + +``` +mamba install constructor +``` + +It is possible to list all of the versions of `constructor` available on your platform with `conda`: ``` conda search constructor --channel napari ``` +or with `mamba`: + +``` +mamba search constructor --channel napari +``` + +Alternatively, `mamba repoquery` may provide more information: + +``` +# Search all versions available on your platform: +mamba repoquery search constructor --channel napari + +# List packages depending on `constructor`: +mamba repoquery whoneeds constructor --channel napari + +# List dependencies of `constructor`: +mamba repoquery depends constructor --channel napari +``` + diff --git a/build-locally.py b/build-locally.py index 8b74348..3f4b7a7 100755 --- a/build-locally.py +++ b/build-locally.py @@ -22,10 +22,6 @@ def setup_environment(ns): os.environ["MINIFORGE_HOME"] = os.path.join( os.path.dirname(__file__), "miniforge3" ) - if "OSX_SDK_DIR" not in os.environ: - os.environ["OSX_SDK_DIR"] = os.path.join( - os.path.dirname(__file__), "SDKs" - ) def run_docker_build(ns): @@ -65,11 +61,12 @@ def verify_config(ns): raise ValueError( f"only Linux/macOS configs currently supported, got {ns.config}" ) - elif ns.config.startswith("osx") and platform.system() == "Darwin": + 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=/opt'" - "to download the SDK automatically to '/opt/MacOSX.sdk'" + "Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=SDKs' " + "to download the SDK automatically to 'SDKs/MacOSX.sdk'. " + "Setting this variable implies agreement to the licensing terms of the SDK by Apple." ) @@ -89,12 +86,19 @@ def main(args=None): verify_config(ns) setup_environment(ns) - 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) + 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__": diff --git a/conda-forge.yml b/conda-forge.yml index da2adf3..b54a4ad 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -6,3 +6,8 @@ conda_forge_output_validation: true channels: targets: - - napari +noarch_platforms: + - linux_64 + - osx_64 + - win_64 +upload_on_branch: main diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 479c0e2..445cf24 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,4 +1,8 @@ channel_targets: - napari bundle_tools channel_sources: - - napari/label/bundle_tools,conda-forge + - napari/label/bundle_tools_2,conda-forge +target_os: + - linux # [linux] + - osx # [osx] + - win # [win] \ No newline at end of file diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 7fd1342..80e3364 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,4 +1,4 @@ -{% set version = "4.0b1" %} +{% set version = "4.0b2" %} package: name: constructor @@ -6,25 +6,27 @@ package: source: - git_url: https://github.com/jaimergp/constructor.git - git_rev: menuinst+branding + git_rev: menuinst-cep build: number: 0 script: {{ PYTHON }} -m pip install . -vv entry_points: - constructor = constructor.main:main + noarch: python requirements: host: - - python + - python >=3.7 - pip run: - - conda >=4.6 - - python + - __{{ target_os }} + - conda >=4.14 + - python >=3.7 - ruamel_yaml >=0.11.14,<0.16 - conda-standalone - pillow >=3.1 # [win or osx] - - nsis >=3.01 # [win] + - nsis >=3.08 # [win] test: source_files: From de08edd3ebfc0cb1f7e77c7e34ec06963c3cc076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Fri, 4 Nov 2022 00:11:33 +0100 Subject: [PATCH 2/3] upload to bundle_tools_2 --- .ci_support/linux_64_.yaml | 2 +- .ci_support/osx_64_.yaml | 2 +- .ci_support/win_64_.yaml | 2 +- .github/workflows/conda-build.yml | 7 ++++++- recipe/conda_build_config.yaml | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml index 2d9cbdb..a38a27a 100644 --- a/.ci_support/linux_64_.yaml +++ b/.ci_support/linux_64_.yaml @@ -3,7 +3,7 @@ cdt_name: channel_sources: - napari/label/bundle_tools_2,conda-forge channel_targets: -- napari bundle_tools +- napari bundle_tools_2 docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 target_os: diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml index ab12005..fe0677c 100644 --- a/.ci_support/osx_64_.yaml +++ b/.ci_support/osx_64_.yaml @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET: channel_sources: - napari/label/bundle_tools_2,conda-forge channel_targets: -- napari bundle_tools +- napari bundle_tools_2 macos_machine: - x86_64-apple-darwin13.4.0 target_os: diff --git a/.ci_support/win_64_.yaml b/.ci_support/win_64_.yaml index 4ab389e..1e65b62 100644 --- a/.ci_support/win_64_.yaml +++ b/.ci_support/win_64_.yaml @@ -1,6 +1,6 @@ channel_sources: - napari/label/bundle_tools_2,conda-forge channel_targets: -- napari bundle_tools +- napari bundle_tools_2 target_os: - win diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index 5c6e050..a729deb 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -3,7 +3,12 @@ # -*- mode: yaml -*- name: Build conda package -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: + jobs: build: diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 445cf24..d5bce5f 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,5 +1,5 @@ channel_targets: - - napari bundle_tools + - napari bundle_tools_2 channel_sources: - napari/label/bundle_tools_2,conda-forge target_os: From f5ccc70fb9582b5831e17432ce963b420517619e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Sun, 13 Nov 2022 18:55:05 +0100 Subject: [PATCH 3/3] prepare certificate for testing --- recipe/meta.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 80e3364..f3e45d0 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -38,6 +38,11 @@ test: - pytest commands: - pytest -v tests + - set "CONSTRUCTOR_SIGNTOOL_PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\signtool.exe" # [win] + - set "CONSTRUCTOR_SIGNING_CERTIFICATE=certificate.pfx" # [win] + - set "CONSTRUCTOR_PFX_CERTIFICATE_PASSWORD=1234" # [win] + - powershell scripts\create_self_signed_certificate.ps1 # [win] + - copy /Y "%CONSTRUCTOR_SIGNING_CERTIFICATE%" examples\signing\certificate.pfx # [win] # Skip for linux-aarch64 because examples use "main" channel which has no builds for that platform. - python scripts/run_examples.py # [not aarch64] - constructor -V