diff --git a/.ci_support/linux_64_python3.10.yaml b/.ci_support/linux_64_python3.10.yaml index aaee4b8..18fdeb5 100644 --- a/.ci_support/linux_64_python3.10.yaml +++ b/.ci_support/linux_64_python3.10.yaml @@ -1,5 +1,5 @@ cdt_name: -- cos6 +- cos7 channel_sources: - gurobi,conda-forge,defaults channel_targets: @@ -7,7 +7,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '12' +- '13' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_64_python3.11.yaml b/.ci_support/linux_64_python3.11.yaml index 753f1cb..438381a 100644 --- a/.ci_support/linux_64_python3.11.yaml +++ b/.ci_support/linux_64_python3.11.yaml @@ -1,5 +1,5 @@ cdt_name: -- cos6 +- cos7 channel_sources: - gurobi,conda-forge,defaults channel_targets: @@ -7,7 +7,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '12' +- '13' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_64_python3.9.yaml b/.ci_support/linux_64_python3.9.yaml index 3733d35..31c845f 100644 --- a/.ci_support/linux_64_python3.9.yaml +++ b/.ci_support/linux_64_python3.9.yaml @@ -1,5 +1,5 @@ cdt_name: -- cos6 +- cos7 channel_sources: - gurobi,conda-forge,defaults channel_targets: @@ -7,7 +7,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '12' +- '13' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/osx_64_python3.10.yaml b/.ci_support/osx_64_python3.10.yaml index a53c062..4617fee 100644 --- a/.ci_support/osx_64_python3.10.yaml +++ b/.ci_support/osx_64_python3.10.yaml @@ -9,7 +9,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '16' +- '17' 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 13c1f24..54dac37 100644 --- a/.ci_support/osx_64_python3.11.yaml +++ b/.ci_support/osx_64_python3.11.yaml @@ -9,7 +9,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '16' +- '17' macos_machine: - x86_64-apple-darwin13.4.0 pin_run_as_build: diff --git a/.ci_support/osx_64_python3.12.yaml b/.ci_support/osx_64_python3.12.yaml new file mode 100644 index 0000000..0adc326 --- /dev/null +++ b/.ci_support/osx_64_python3.12.yaml @@ -0,0 +1,22 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.13' +MACOSX_SDK_VERSION: +- '10.13' +channel_sources: +- gurobi,conda-forge,defaults +channel_targets: +- funkelab main +cxx_compiler: +- clangxx +cxx_compiler_version: +- '17' +macos_machine: +- x86_64-apple-darwin13.4.0 +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- '3.12' +target_platform: +- osx-64 diff --git a/.ci_support/osx_64_python3.9.yaml b/.ci_support/osx_64_python3.9.yaml index 1fea55f..4124681 100644 --- a/.ci_support/osx_64_python3.9.yaml +++ b/.ci_support/osx_64_python3.9.yaml @@ -9,7 +9,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '16' +- '17' 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 8898b3d..6e90125 100644 --- a/.ci_support/osx_arm64_python3.10.yaml +++ b/.ci_support/osx_arm64_python3.10.yaml @@ -9,7 +9,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '16' +- '17' 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 46d273b..589f8e1 100644 --- a/.ci_support/osx_arm64_python3.11.yaml +++ b/.ci_support/osx_arm64_python3.11.yaml @@ -9,7 +9,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '16' +- '17' macos_machine: - arm64-apple-darwin20.0.0 pin_run_as_build: diff --git a/.ci_support/osx_arm64_python3.12.yaml b/.ci_support/osx_arm64_python3.12.yaml new file mode 100644 index 0000000..fe67c76 --- /dev/null +++ b/.ci_support/osx_arm64_python3.12.yaml @@ -0,0 +1,22 @@ +MACOSX_DEPLOYMENT_TARGET: +- '11.0' +MACOSX_SDK_VERSION: +- '11.0' +channel_sources: +- gurobi,conda-forge,defaults +channel_targets: +- funkelab main +cxx_compiler: +- clangxx +cxx_compiler_version: +- '17' +macos_machine: +- arm64-apple-darwin20.0.0 +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- '3.12' +target_platform: +- osx-arm64 diff --git a/.ci_support/osx_arm64_python3.9.yaml b/.ci_support/osx_arm64_python3.9.yaml index d54d0b5..8e7944d 100644 --- a/.ci_support/osx_arm64_python3.9.yaml +++ b/.ci_support/osx_arm64_python3.9.yaml @@ -9,7 +9,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '16' +- '17' macos_machine: - arm64-apple-darwin20.0.0 pin_run_as_build: diff --git a/.ci_support/win_64_python3.12.yaml b/.ci_support/win_64_python3.12.yaml new file mode 100644 index 0000000..a8a659d --- /dev/null +++ b/.ci_support/win_64_python3.12.yaml @@ -0,0 +1,14 @@ +channel_sources: +- gurobi,conda-forge,defaults +channel_targets: +- funkelab main +cxx_compiler: +- vs2019 +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- '3.12' +target_platform: +- win-64 diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index 9817d56..52cdb65 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -44,6 +44,10 @@ jobs: UPLOAD_PACKAGES: True os: macos runs_on: ['macos-13'] + - CONFIG: osx_64_python3.12 + UPLOAD_PACKAGES: True + os: macos + runs_on: ['macos-13'] - CONFIG: osx_64_python3.9 UPLOAD_PACKAGES: True os: macos @@ -56,6 +60,10 @@ jobs: UPLOAD_PACKAGES: True os: macos runs_on: ['macos-13'] + - CONFIG: osx_arm64_python3.12 + UPLOAD_PACKAGES: True + os: macos + runs_on: ['macos-13'] - CONFIG: osx_arm64_python3.9 UPLOAD_PACKAGES: True os: macos @@ -68,6 +76,10 @@ jobs: UPLOAD_PACKAGES: True os: windows runs_on: ['windows-latest'] + - CONFIG: win_64_python3.12 + UPLOAD_PACKAGES: True + os: windows + runs_on: ['windows-latest'] - CONFIG: win_64_python3.9 UPLOAD_PACKAGES: True os: windows @@ -124,13 +136,6 @@ jobs: fi ./.scripts/run_osx_build.sh - - name: Install Miniconda for windows - uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 - with: - miniforge-version: latest - miniforge-variant: Mambaforge - if: matrix.os == 'windows' - - name: Build on windows shell: cmd run: | @@ -139,6 +144,7 @@ jobs: set "sha=%GITHUB_SHA%" call ".scripts\run_win_build.bat" env: + MINIFORGE_HOME: D:\Miniforge PYTHONUNBUFFERED: 1 CONFIG: ${{ matrix.CONFIG }} CI: github_actions diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index c8f58fb..352d052 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -31,18 +31,20 @@ pkgs_dirs: solver: libmamba CONDARC +mv /opt/conda/conda-meta/history /opt/conda/conda-meta/history.$(date +%Y-%m-%d-%H-%M-%S) +echo > /opt/conda/conda-meta/history +micromamba install --root-prefix ~/.conda --prefix /opt/conda \ + --yes --override-channels --channel conda-forge --strict-channel-priority \ + pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1" export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 -mamba install --update-specs --yes --quiet --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" - # 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}" @@ -72,11 +74,10 @@ else --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" + # inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 + command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts --recipe-dir "${RECIPE_ROOT}" -m "${CONFIG_FILE}" || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" ( endgroup "Inspecting artifacts" ) 2> /dev/null diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index d12507d..1ef7c5e 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -7,28 +7,39 @@ source .scripts/logging_utils.sh set -xe MINIFORGE_HOME=${MINIFORGE_HOME:-${HOME}/miniforge3} +MINIFORGE_HOME=${MINIFORGE_HOME%/} # remove trailing slash -( 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 "Provisioning base env with micromamba" ) 2> /dev/null +MICROMAMBA_VERSION="1.5.10-0" +if [[ "$(uname -m)" == "arm64" ]]; then + osx_arch="osx-arm64" +else + osx_arch="osx-64" +fi +MICROMAMBA_URL="https://github.com/mamba-org/micromamba-releases/releases/download/${MICROMAMBA_VERSION}/micromamba-${osx_arch}" +MAMBA_ROOT_PREFIX="${MINIFORGE_HOME}-micromamba-$(date +%s)" +echo "Downloading micromamba ${MICROMAMBA_VERSION}" +micromamba_exe="$(mktemp -d)/micromamba" +curl -L -o "${micromamba_exe}" "${MICROMAMBA_URL}" +chmod +x "${micromamba_exe}" +echo "Creating environment" +"${micromamba_exe}" create --yes --root-prefix "${MAMBA_ROOT_PREFIX}" --prefix "${MINIFORGE_HOME}" \ + --channel conda-forge \ + pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1" +echo "Moving pkgs cache from ${MAMBA_ROOT_PREFIX} to ${MINIFORGE_HOME}" +mv "${MAMBA_ROOT_PREFIX}/pkgs" "${MINIFORGE_HOME}" +echo "Cleaning up micromamba" +rm -rf "${MAMBA_ROOT_PREFIX}" "${micromamba_exe}" || true +( endgroup "Provisioning base env with micromamba" ) 2> /dev/null ( startgroup "Configuring conda" ) 2> /dev/null -source ${MINIFORGE_HOME}/etc/profile.d/conda.sh +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" + @@ -88,8 +99,8 @@ else ( 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" + # inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 + command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts --recipe-dir ./recipe -m ./.ci_support/${CONFIG}.yaml || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" ( endgroup "Inspecting artifacts" ) 2> /dev/null diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat index 24df5d6..c5d46bc 100755 --- a/.scripts/run_win_build.bat +++ b/.scripts/run_win_build.bat @@ -3,30 +3,52 @@ :: 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 +:: MINIFORGE_HOME: where to install the base conda environment :: UPLOAD_PACKAGES: true or false :: UPLOAD_ON_BRANCH: true or false setlocal enableextensions enabledelayedexpansion +if "%MINIFORGE_HOME%"=="" set "MINIFORGE_HOME=%USERPROFILE%\Miniforge3" +:: Remove trailing backslash, if present +if "%MINIFORGE_HOME:~-1%"=="\" set "MINIFORGE_HOME=%MINIFORGE_HOME:~0,-1%" +call :start_group "Provisioning base env with micromamba" +set "MAMBA_ROOT_PREFIX=%MINIFORGE_HOME%-micromamba-%RANDOM%" +set "MICROMAMBA_VERSION=1.5.10-0" +set "MICROMAMBA_URL=https://github.com/mamba-org/micromamba-releases/releases/download/%MICROMAMBA_VERSION%/micromamba-win-64" +set "MICROMAMBA_TMPDIR=%TMP%\micromamba-%RANDOM%" +set "MICROMAMBA_EXE=%MICROMAMBA_TMPDIR%\micromamba.exe" + +echo Downloading micromamba %MICROMAMBA_VERSION% +if not exist "%MICROMAMBA_TMPDIR%" mkdir "%MICROMAMBA_TMPDIR%" +certutil -urlcache -split -f "%MICROMAMBA_URL%" "%MICROMAMBA_EXE%" +if !errorlevel! neq 0 exit /b !errorlevel! + +echo Creating environment +call "%MICROMAMBA_EXE%" create --yes --root-prefix "%MAMBA_ROOT_PREFIX%" --prefix "%MINIFORGE_HOME%" ^ + --channel conda-forge ^ + pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1" +if !errorlevel! neq 0 exit /b !errorlevel! +echo Moving pkgs cache from %MAMBA_ROOT_PREFIX% to %MINIFORGE_HOME% +move /Y "%MAMBA_ROOT_PREFIX%\pkgs" "%MINIFORGE_HOME%" +if !errorlevel! neq 0 exit /b !errorlevel! +echo Removing %MAMBA_ROOT_PREFIX% +del /S /Q "%MAMBA_ROOT_PREFIX%" +del /S /Q "%MICROMAMBA_TMPDIR%" +call :end_group + call :start_group "Configuring conda" :: Activate the base conda environment -call activate base +call "%MINIFORGE_HOME%\Scripts\activate.bat" :: 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 @@ -48,7 +70,7 @@ if NOT [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] ( ) 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%" + set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --extra-meta flow_run_id=%flow_run_id% remote_url=%remote_url% sha=%sha%" ) call :end_group @@ -59,8 +81,8 @@ conda-build.exe "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTR 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" +:: inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 +WHERE inspect_artifacts >nul 2>nul && inspect_artifacts --recipe-dir ".\recipe" -m .ci_support\%CONFIG%.yaml || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" call :end_group :: Prepare some environment variables for the upload step diff --git a/build-locally.py b/build-locally.py index e0d408d..6788aea 100755 --- a/build-locally.py +++ b/build-locally.py @@ -1,13 +1,16 @@ -#!/usr/bin/env python3 +#!/bin/sh +"""exec" "python3" "$0" "$@" #""" # fmt: off # fmt: on # # This file has been generated by conda-smithy in order to build the recipe # locally. # -import os +# The line above this comment is a bash / sh / zsh guard +# to stop people from running it with the wrong interpreter import glob +import os +import platform import subprocess from argparse import ArgumentParser -import platform def setup_environment(ns): diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 1506f00..75228f7 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -2,14 +2,17 @@ python: - 3.9 - 3.10 - 3.11 + - 3.12 # [not linux] python_impl: - cpython - cpython - cpython + - cpython # [not linux] numpy: - 1.22 - 1.22 - 1.22 + - 1.22 # [not linux] channel_targets: - funkelab main channel_sources: diff --git a/recipe/meta.yaml b/recipe/meta.yaml index fae6527..d466ca0 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,5 +1,5 @@ {% set name = "ilpy" %} -{% set version = "0.4.0" %} +{% set version = "0.4.1" %} package: name: {{ name|lower }} @@ -7,10 +7,10 @@ package: source: url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name.replace('-', '_') }}-{{ version }}.tar.gz - sha256: 5cee3c0e5fe6e48cbb4686a8d8362b5e5fa407ab242c480b3981beb7b3429f0c + sha256: e56988abe021398ac856ebdc669981028241eb5ecd6427eae315dbf96e2904f7 build: - number: 1 + number: 0 script: "{{ PYTHON }} -m pip install . --no-deps -vv" requirements: @@ -19,16 +19,19 @@ requirements: - cross-python_{{ target_platform }} # [build_platform != target_platform] - python # [build_platform != target_platform] - cython =3.0.9 # [build_platform != target_platform] + - setuptools ==71 host: - python {{python}} - pip - cython =3.0.9 - scip =9.1.0 - - gurobi >=10.0,<12.0 + - gurobi >=10.0,<11 # [linux] + - gurobi >=10.0,<=11.0.2 # [not linux] run: - python {{python}} - scip =9.1.0 - - gurobi >=10.0,<12.0 + - gurobi >=10.0,<11 # [linux] + - gurobi >=10.0,<=11.0.2 # [not linux] test: imports: