diff --git a/.ci_support/osx_64_python3.10.yaml b/.ci_support/osx_64_python3.10.yaml index 84f0856..1988ca5 100644 --- a/.ci_support/osx_64_python3.10.yaml +++ b/.ci_support/osx_64_python3.10.yaml @@ -7,7 +7,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '15' +- '16' macos_machine: - x86_64-apple-darwin13.4.0 pin_run_as_build: diff --git a/.ci_support/osx_64_python3.11.yaml b/.ci_support/osx_64_python3.11.yaml index cbdd07a..0925552 100644 --- a/.ci_support/osx_64_python3.11.yaml +++ b/.ci_support/osx_64_python3.11.yaml @@ -7,7 +7,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '15' +- '16' macos_machine: - x86_64-apple-darwin13.4.0 pin_run_as_build: diff --git a/.ci_support/osx_64_python3.9.yaml b/.ci_support/osx_64_python3.9.yaml index ac01851..9760af0 100644 --- a/.ci_support/osx_64_python3.9.yaml +++ b/.ci_support/osx_64_python3.9.yaml @@ -7,7 +7,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '15' +- '16' macos_machine: - x86_64-apple-darwin13.4.0 pin_run_as_build: diff --git a/.ci_support/osx_arm64_python3.10.yaml b/.ci_support/osx_arm64_python3.10.yaml index c03545c..853e2f4 100644 --- a/.ci_support/osx_arm64_python3.10.yaml +++ b/.ci_support/osx_arm64_python3.10.yaml @@ -7,7 +7,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '15' +- '16' macos_machine: - arm64-apple-darwin20.0.0 pin_run_as_build: diff --git a/.ci_support/osx_arm64_python3.11.yaml b/.ci_support/osx_arm64_python3.11.yaml index 039b52b..39ed99b 100644 --- a/.ci_support/osx_arm64_python3.11.yaml +++ b/.ci_support/osx_arm64_python3.11.yaml @@ -7,7 +7,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '15' +- '16' macos_machine: - arm64-apple-darwin20.0.0 pin_run_as_build: diff --git a/.ci_support/osx_arm64_python3.9.yaml b/.ci_support/osx_arm64_python3.9.yaml index 13cdd3e..847784f 100644 --- a/.ci_support/osx_arm64_python3.9.yaml +++ b/.ci_support/osx_arm64_python3.9.yaml @@ -7,7 +7,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '15' +- '16' macos_machine: - arm64-apple-darwin20.0.0 pin_run_as_build: diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index 554f356..08012d3 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -3,56 +3,77 @@ # -*- mode: yaml -*- name: Build conda package -on: [push, pull_request] +on: + push: + + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true jobs: build: name: ${{ matrix.CONFIG }} - runs-on: ${{ matrix.os }}-latest + runs-on: ${{ matrix.runs_on }} + timeout-minutes: 360 strategy: fail-fast: false matrix: include: - CONFIG: linux_64_python3.10 UPLOAD_PACKAGES: True - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - CONFIG: linux_64_python3.11 UPLOAD_PACKAGES: True - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - CONFIG: linux_64_python3.9 UPLOAD_PACKAGES: True - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - CONFIG: win_64_python3.10 UPLOAD_PACKAGES: True os: windows + runs_on: ['windows-latest'] - CONFIG: win_64_python3.11 UPLOAD_PACKAGES: True os: windows + runs_on: ['windows-latest'] - CONFIG: win_64_python3.9 UPLOAD_PACKAGES: True os: windows + runs_on: ['windows-latest'] - CONFIG: osx_64_python3.10 UPLOAD_PACKAGES: True os: macos + runs_on: ['macos-latest'] - CONFIG: osx_64_python3.11 UPLOAD_PACKAGES: True os: macos + runs_on: ['macos-latest'] - CONFIG: osx_64_python3.9 UPLOAD_PACKAGES: True os: macos + runs_on: ['macos-latest'] - CONFIG: osx_arm64_python3.10 UPLOAD_PACKAGES: True os: macos + runs_on: ['macos-latest'] - CONFIG: osx_arm64_python3.11 UPLOAD_PACKAGES: True os: macos + runs_on: ['macos-latest'] - CONFIG: osx_arm64_python3.9 UPLOAD_PACKAGES: True os: macos + runs_on: ['macos-latest'] steps: + - name: Checkout code uses: actions/checkout@v3 @@ -63,11 +84,15 @@ jobs: UPLOAD_PACKAGES: ${{ matrix.UPLOAD_PACKAGES }} DOCKER_IMAGE: ${{ matrix.DOCKER_IMAGE }} CI: github_actions - BINSTAR_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }} + CONDA_FORGE_DOCKER_RUN_ARGS: "${{ matrix.CONDA_FORGE_DOCKER_RUN_ARGS }}" + BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} shell: bash run: | echo "::group::Configure binfmt_misc" docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes + export flow_run_id="github_$GITHUB_RUN_ID" + export remote_url="https://github.com/$GITHUB_REPOSITORY" + export sha="$GITHUB_SHA" export FEEDSTOCK_NAME="$(basename $GITHUB_REPOSITORY)" export GIT_BRANCH="$(basename $GITHUB_REF)" if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then @@ -84,9 +109,12 @@ jobs: CONFIG: ${{ matrix.CONFIG }} UPLOAD_PACKAGES: ${{ matrix.UPLOAD_PACKAGES }} CI: github_actions - BINSTAR_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }} + BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} shell: bash run: | + export flow_run_id="github_$GITHUB_RUN_ID" + export remote_url="https://github.com/$GITHUB_REPOSITORY" + export sha="$GITHUB_SHA" export FEEDSTOCK_NAME="$(basename $GITHUB_REPOSITORY)" export GIT_BRANCH="$(basename $GITHUB_REF)" if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then @@ -102,37 +130,18 @@ jobs: 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 - if errorlevel 1 exit 1 - setup_conda_rc .\ ".\recipe" .\.ci_support\%CONFIG%.yaml - if errorlevel 1 exit 1 - - - 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" - ) - if /i "%UPLOAD_PACKAGES%" == "true" ( - if /i "%IS_PR_BUILD%" == "false" ( - upload_package .\ ".\recipe" .ci_support\%CONFIG%.yaml - ) - ) + set "flow_run_id=github_%GITHUB_RUN_ID%" + set "remote_url=https://github.com/%GITHUB_REPOSITORY%" + set "sha=%GITHUB_SHA%" + call ".scripts\run_win_build.bat" env: PYTHONUNBUFFERED: 1 CONFIG: ${{ matrix.CONFIG }} CI: github_actions UPLOAD_PACKAGES: ${{ matrix.UPLOAD_PACKAGES }} - BINSTAR_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }} + BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} if: matrix.os == 'windows' \ No newline at end of file diff --git a/.gitignore b/.gitignore index c89ecb7..d49227b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.pyc build_artifacts +miniforge3/ \ No newline at end of file diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index 1f03510..0d41f31 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -28,14 +28,15 @@ conda-build: pkgs_dirs: - ${FEEDSTOCK_ROOT}/build_artifacts/pkg_cache - /opt/conda/pkgs +solver: libmamba CONDARC +export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 - -mamba install --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 -mamba update --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 +mamba install --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ + pip mamba conda-build boa conda-forge-ci-setup=4 +mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ + pip mamba conda-build boa conda-forge-ci-setup=4 # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" @@ -56,6 +57,12 @@ if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then cp "${FEEDSTOCK_ROOT}/LICENSE.txt" "${RECIPE_ROOT}/recipe-scripts-license.txt" fi +if [[ "${sha:-}" == "" ]]; then + pushd ${FEEDSTOCK_ROOT} + sha=$(git rev-parse HEAD) + popd +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}" @@ -69,7 +76,8 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then else conda mambabuild "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ --suppress-variables ${EXTRA_CB_OPTIONS:-} \ - --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" + --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" \ + --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}" ( startgroup "Uploading packages" ) 2> /dev/null diff --git a/.scripts/logging_utils.sh b/.scripts/logging_utils.sh index 57bc95c..aff009f 100644 --- a/.scripts/logging_utils.sh +++ b/.scripts/logging_utils.sh @@ -12,7 +12,7 @@ function startgroup { echo "##[group]$1";; travis ) echo "$1" - echo -en 'travis_fold:start:'"${1// /}"'\\r';; + echo -en 'travis_fold:start:'"${1// /}"'\r';; github_actions ) echo "::group::$1";; * ) @@ -28,7 +28,7 @@ function endgroup { azure ) echo "##[endgroup]";; travis ) - echo -en 'travis_fold:end:'"${1// /}"'\\r';; + echo -en 'travis_fold:end:'"${1// /}"'\r';; github_actions ) echo "::endgroup::";; esac diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index c4079b7..db9a6e2 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -91,6 +91,9 @@ docker run ${DOCKER_RUN_ARGS} \ -e CPU_COUNT \ -e BUILD_WITH_CONDA_DEBUG \ -e BUILD_OUTPUT_ID \ + -e flow_run_id \ + -e remote_url \ + -e sha \ -e BINSTAR_TOKEN \ "${DOCKER_IMAGE}" \ bash \ diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index bad42e4..3431a67 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -22,11 +22,13 @@ bash $MINIFORGE_FILE -b -p ${MINIFORGE_HOME} 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 \ - conda-build pip boa conda-forge-ci-setup=3 -mamba update --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 +mamba install --update-specs --quiet --yes --channel conda-forge --strict-channel-priority \ + pip mamba conda-build boa conda-forge-ci-setup=4 +mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ + pip mamba conda-build boa conda-forge-ci-setup=4 @@ -45,6 +47,10 @@ 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 @@ -55,11 +61,6 @@ source run_conda_forge_build_setup echo -e "\n\nMaking the build clobber file" make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml -if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]]; then - EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" -fi - - if [[ -f LICENSE.txt ]]; then cp LICENSE.txt "recipe/recipe-scripts-license.txt" fi @@ -75,9 +76,15 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then # Drop into an interactive shell /bin/bash else + + if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]]; then + EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" + fi + conda mambabuild ./recipe -m ./.ci_support/${CONFIG}.yaml \ --suppress-variables ${EXTRA_CB_OPTIONS:-} \ - --clobber-file ./.ci_support/clobber_${CONFIG}.yaml + --clobber-file ./.ci_support/clobber_${CONFIG}.yaml \ + --extra-meta flow_run_id="$flow_run_id" remote_url="$remote_url" sha="$sha" ( startgroup "Uploading packages" ) 2> /dev/null diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat new file mode 100755 index 0000000..e5d5a9b --- /dev/null +++ b/.scripts/run_win_build.bat @@ -0,0 +1,121 @@ +:: 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 boa conda-forge-ci-setup=4 -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 [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] ( + if [%CROSSCOMPILING_EMULATOR%] == [] ( + set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test" + ) +) + +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.exe mambabuild "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% +if !errorlevel! neq 0 exit /b !errorlevel! + +:: 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 + +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 .\ ".\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/conda-forge.yml b/conda-forge.yml index 0d573fe..44f6c83 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -1,17 +1,6 @@ github: user_or_org: funkelab -channels: - # sources selects the channels to pull packages from, in order. - sources: - - gurobi - - conda-forge - - defaults - # targets is a list of 2-lists, where the first element is the - # channel to push to and the second element is the label on that channel - targets: - - [funkelab, main] - # https://conda-forge.org/docs/maintainer/conda_forge_yml.html#provider provider: linux_64: github_actions diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index f57249d..1506f00 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -2,6 +2,14 @@ python: - 3.9 - 3.10 - 3.11 +python_impl: + - cpython + - cpython + - cpython +numpy: + - 1.22 + - 1.22 + - 1.22 channel_targets: - funkelab main channel_sources: diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 4840054..beea981 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -10,7 +10,7 @@ source: sha256: 6bed753418a60d81894169a9b7b4124e1d2f619d3bb20573fc87de1495d6932c build: - number: 0 + number: 1 script: "{{ PYTHON }} -m pip install . --no-deps -vv" requirements: @@ -18,17 +18,17 @@ requirements: - {{ compiler("cxx") }} - cross-python_{{ target_platform }} # [build_platform != target_platform] - python # [build_platform != target_platform] - - cython # [build_platform != target_platform] + - cython<3.0 # [build_platform != target_platform] host: - python {{python}} - pip - - cython - - scip - - gurobi + - cython<3.0 + - scip=8.1.0 + - gurobi=10.0 run: - python {{python}} - - scip - - gurobi + - scip=8.1.0 + - gurobi=10.0 test: imports: