diff --git a/.ci_support/linux_64_python3.10.____cpython.yaml b/.ci_support/linux_64_python3.10.____cpython.yaml index ed5e40b8..01d47641 100644 --- a/.ci_support/linux_64_python3.10.____cpython.yaml +++ b/.ci_support/linux_64_python3.10.____cpython.yaml @@ -2,6 +2,10 @@ c_compiler: - gcc c_compiler_version: - '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_name: - cos6 channel_sources: diff --git a/.ci_support/linux_64_python3.11.____cpython.yaml b/.ci_support/linux_64_python3.11.____cpython.yaml index 7fde4954..fdf619b7 100644 --- a/.ci_support/linux_64_python3.11.____cpython.yaml +++ b/.ci_support/linux_64_python3.11.____cpython.yaml @@ -2,6 +2,10 @@ c_compiler: - gcc c_compiler_version: - '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_name: - cos6 channel_sources: diff --git a/.ci_support/linux_64_python3.12.____cpython.yaml b/.ci_support/linux_64_python3.12.____cpython.yaml index 5abdaa3c..3df0945a 100644 --- a/.ci_support/linux_64_python3.12.____cpython.yaml +++ b/.ci_support/linux_64_python3.12.____cpython.yaml @@ -2,6 +2,10 @@ c_compiler: - gcc c_compiler_version: - '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_name: - cos6 channel_sources: diff --git a/.ci_support/linux_64_python3.13.____cpython.yaml b/.ci_support/linux_64_python3.13.____cpython.yaml index 5bd0377e..e8af8d07 100644 --- a/.ci_support/linux_64_python3.13.____cpython.yaml +++ b/.ci_support/linux_64_python3.13.____cpython.yaml @@ -2,6 +2,10 @@ c_compiler: - gcc c_compiler_version: - '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_name: - cos6 channel_sources: diff --git a/.ci_support/linux_64_python3.9.____cpython.yaml b/.ci_support/linux_64_python3.9.____cpython.yaml index 27e98117..d8af0509 100644 --- a/.ci_support/linux_64_python3.9.____cpython.yaml +++ b/.ci_support/linux_64_python3.9.____cpython.yaml @@ -2,6 +2,10 @@ c_compiler: - gcc c_compiler_version: - '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_name: - cos6 channel_sources: diff --git a/.ci_support/linux_aarch64_python3.10.____cpython.yaml b/.ci_support/linux_aarch64_python3.10.____cpython.yaml index 971a0b0d..9501b59c 100644 --- a/.ci_support/linux_aarch64_python3.10.____cpython.yaml +++ b/.ci_support/linux_aarch64_python3.10.____cpython.yaml @@ -4,6 +4,10 @@ c_compiler: - gcc c_compiler_version: - '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_arch: - aarch64 cdt_name: diff --git a/.ci_support/linux_aarch64_python3.11.____cpython.yaml b/.ci_support/linux_aarch64_python3.11.____cpython.yaml index 4424de00..26d312e3 100644 --- a/.ci_support/linux_aarch64_python3.11.____cpython.yaml +++ b/.ci_support/linux_aarch64_python3.11.____cpython.yaml @@ -4,6 +4,10 @@ c_compiler: - gcc c_compiler_version: - '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_arch: - aarch64 cdt_name: diff --git a/.ci_support/linux_aarch64_python3.12.____cpython.yaml b/.ci_support/linux_aarch64_python3.12.____cpython.yaml index 5642f8f5..657abb5e 100644 --- a/.ci_support/linux_aarch64_python3.12.____cpython.yaml +++ b/.ci_support/linux_aarch64_python3.12.____cpython.yaml @@ -4,6 +4,10 @@ c_compiler: - gcc c_compiler_version: - '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_arch: - aarch64 cdt_name: diff --git a/.ci_support/linux_aarch64_python3.13.____cpython.yaml b/.ci_support/linux_aarch64_python3.13.____cpython.yaml index f96ce235..0f6004e9 100644 --- a/.ci_support/linux_aarch64_python3.13.____cpython.yaml +++ b/.ci_support/linux_aarch64_python3.13.____cpython.yaml @@ -4,6 +4,10 @@ c_compiler: - gcc c_compiler_version: - '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_arch: - aarch64 cdt_name: diff --git a/.ci_support/linux_aarch64_python3.9.____cpython.yaml b/.ci_support/linux_aarch64_python3.9.____cpython.yaml index 67e05877..01392e7b 100644 --- a/.ci_support/linux_aarch64_python3.9.____cpython.yaml +++ b/.ci_support/linux_aarch64_python3.9.____cpython.yaml @@ -4,6 +4,10 @@ c_compiler: - gcc c_compiler_version: - '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_arch: - aarch64 cdt_name: diff --git a/.ci_support/osx_64_python3.10.____cpython.yaml b/.ci_support/osx_64_python3.10.____cpython.yaml index 9ed45445..47c64a2a 100644 --- a/.ci_support/osx_64_python3.10.____cpython.yaml +++ b/.ci_support/osx_64_python3.10.____cpython.yaml @@ -4,6 +4,10 @@ c_compiler: - clang c_compiler_version: - '15' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/osx_64_python3.11.____cpython.yaml b/.ci_support/osx_64_python3.11.____cpython.yaml index 58116aad..e533b41d 100644 --- a/.ci_support/osx_64_python3.11.____cpython.yaml +++ b/.ci_support/osx_64_python3.11.____cpython.yaml @@ -4,6 +4,10 @@ c_compiler: - clang c_compiler_version: - '15' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/osx_64_python3.12.____cpython.yaml b/.ci_support/osx_64_python3.12.____cpython.yaml index 3ab9067c..03c31d88 100644 --- a/.ci_support/osx_64_python3.12.____cpython.yaml +++ b/.ci_support/osx_64_python3.12.____cpython.yaml @@ -4,6 +4,10 @@ c_compiler: - clang c_compiler_version: - '16' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/osx_64_python3.13.____cpython.yaml b/.ci_support/osx_64_python3.13.____cpython.yaml index 28db5457..050206fa 100644 --- a/.ci_support/osx_64_python3.13.____cpython.yaml +++ b/.ci_support/osx_64_python3.13.____cpython.yaml @@ -4,6 +4,10 @@ c_compiler: - clang c_compiler_version: - '17' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/osx_64_python3.9.____cpython.yaml b/.ci_support/osx_64_python3.9.____cpython.yaml index e26cf1ce..fc5593ff 100644 --- a/.ci_support/osx_64_python3.9.____cpython.yaml +++ b/.ci_support/osx_64_python3.9.____cpython.yaml @@ -4,6 +4,10 @@ c_compiler: - clang c_compiler_version: - '15' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/osx_arm64_python3.10.____cpython.yaml b/.ci_support/osx_arm64_python3.10.____cpython.yaml index 58d8969a..4197f095 100644 --- a/.ci_support/osx_arm64_python3.10.____cpython.yaml +++ b/.ci_support/osx_arm64_python3.10.____cpython.yaml @@ -4,6 +4,10 @@ c_compiler: - clang c_compiler_version: - '15' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/osx_arm64_python3.11.____cpython.yaml b/.ci_support/osx_arm64_python3.11.____cpython.yaml index a85eea98..be3e5f84 100644 --- a/.ci_support/osx_arm64_python3.11.____cpython.yaml +++ b/.ci_support/osx_arm64_python3.11.____cpython.yaml @@ -4,6 +4,10 @@ c_compiler: - clang c_compiler_version: - '15' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/osx_arm64_python3.12.____cpython.yaml b/.ci_support/osx_arm64_python3.12.____cpython.yaml index a5271c9e..bbea5367 100644 --- a/.ci_support/osx_arm64_python3.12.____cpython.yaml +++ b/.ci_support/osx_arm64_python3.12.____cpython.yaml @@ -4,6 +4,10 @@ c_compiler: - clang c_compiler_version: - '16' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/osx_arm64_python3.13.____cpython.yaml b/.ci_support/osx_arm64_python3.13.____cpython.yaml index b32bd4aa..20d68ecb 100644 --- a/.ci_support/osx_arm64_python3.13.____cpython.yaml +++ b/.ci_support/osx_arm64_python3.13.____cpython.yaml @@ -4,6 +4,10 @@ c_compiler: - clang c_compiler_version: - '17' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/osx_arm64_python3.9.____cpython.yaml b/.ci_support/osx_arm64_python3.9.____cpython.yaml index 6bedca9c..3eebd6f5 100644 --- a/.ci_support/osx_arm64_python3.9.____cpython.yaml +++ b/.ci_support/osx_arm64_python3.9.____cpython.yaml @@ -4,6 +4,10 @@ c_compiler: - clang c_compiler_version: - '15' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/win_64_python3.10.____cpython.yaml b/.ci_support/win_64_python3.10.____cpython.yaml index 5590a4b2..f32a7247 100644 --- a/.ci_support/win_64_python3.10.____cpython.yaml +++ b/.ci_support/win_64_python3.10.____cpython.yaml @@ -1,5 +1,7 @@ c_compiler: - vs2019 +c_stdlib: +- vs channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/win_64_python3.11.____cpython.yaml b/.ci_support/win_64_python3.11.____cpython.yaml index ac9d1537..f2e4ab2f 100644 --- a/.ci_support/win_64_python3.11.____cpython.yaml +++ b/.ci_support/win_64_python3.11.____cpython.yaml @@ -1,5 +1,7 @@ c_compiler: - vs2019 +c_stdlib: +- vs channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/win_64_python3.12.____cpython.yaml b/.ci_support/win_64_python3.12.____cpython.yaml index 8d99b1a9..ebc0cea2 100644 --- a/.ci_support/win_64_python3.12.____cpython.yaml +++ b/.ci_support/win_64_python3.12.____cpython.yaml @@ -1,5 +1,7 @@ c_compiler: - vs2019 +c_stdlib: +- vs channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/win_64_python3.13.____cpython.yaml b/.ci_support/win_64_python3.13.____cpython.yaml index 5f31c07e..9fbc44af 100644 --- a/.ci_support/win_64_python3.13.____cpython.yaml +++ b/.ci_support/win_64_python3.13.____cpython.yaml @@ -1,5 +1,7 @@ c_compiler: - vs2019 +c_stdlib: +- vs channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/win_64_python3.9.____cpython.yaml b/.ci_support/win_64_python3.9.____cpython.yaml index cadd2e63..5cb17bb5 100644 --- a/.ci_support/win_64_python3.9.____cpython.yaml +++ b/.ci_support/win_64_python3.9.____cpython.yaml @@ -1,5 +1,7 @@ c_compiler: - vs2019 +c_stdlib: +- vs channel_sources: - conda-forge channel_targets: diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml deleted file mode 100644 index feae24b3..00000000 --- a/.github/workflows/conda-build.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: conda-build -on: - pull_request: - push: - branches: - - "main" - tags: - - "*" - paths: - - '.github/**' - - 'conda.recipe/**' - -jobs: - conda-build: - name: ${{ matrix.conda_build_yml }} - runs-on: ${{ matrix.os }} - env: - CI: True - strategy: - fail-fast: false - matrix: - include: - - { conda_build_yml: linux_64_python3.9.____cpython, os: ubuntu-latest, conda-build-args: '' } - - { conda_build_yml: linux_64_python3.13.____cpython, os: ubuntu-latest, conda-build-args: '' } - - { conda_build_yml: osx_64_python3.10.____cpython, os: macos-latest, conda-build-args: '' } - - { conda_build_yml: osx_arm64_python3.9.____cpython, os: macos-latest, conda-build-args: '' } - - { conda_build_yml: osx_arm64_python3.13.____cpython, os: macos-latest, conda-build-args: '' } - - { conda_build_yml: win_64_python3.9.____cpython, os: windows-latest, conda-build-args: '' } - - { conda_build_yml: win_64_python3.13.____cpython, os: windows-latest, conda-build-args: '' } - steps: - - name: Checkout branch - uses: actions/checkout@v4 - - name: Fetch full git history - run: git fetch --prune --unshallow - - uses: mamba-org/setup-micromamba@0dea6379afdaffa5d528b3d1dabc45da37f443fc - with: - micromamba-version: 1.5.10-0 - init-shell: ${{ matrix.os == 'windows-latest' && 'cmd.exe' || 'bash' }} - environment-name: build - create-args: conda-build - - name: Patch conda build configuration - # use the latest macOS SDK when cross-compiling for arm64 - if: startsWith(matrix.conda_build_yml, 'osx_arm64') - run: | - CONDA_BUILD_SYSROOT="$(xcrun --sdk macosx --show-sdk-path)" - cat <> ".ci_support/${{ matrix.CONDA_BUILD_YML }}.yaml" - CONDA_BUILD_SYSROOT: - - "${CONDA_BUILD_SYSROOT}" - EOF - - name: Build conda package (unix) - if: matrix.os != 'windows-latest' - shell: bash -el {0} - run: >- - conda-build - -m ".ci_support/${{ matrix.CONDA_BUILD_YML }}.yaml"${{ matrix.conda-build-args }} - conda.recipe - - name: Build conda package (windows) - if: matrix.os == 'windows-latest' - shell: cmd /C CALL {0} - run: >- - conda-build - -m ".ci_support/${{ matrix.conda_build_yml }}.yaml"${{ matrix.conda-build-args }} - conda.recipe diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 00000000..3e55367b --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,57 @@ +name: conda-build +on: + pull_request: + push: + branches: + - main + tags: + - "*" + paths: + - '.github/**' + - 'conda.recipe/**' + +jobs: + build: + name: ${{ matrix.variant-file }} + runs-on: ${{ matrix.os }} + env: + CI: True + strategy: + fail-fast: false + matrix: + include: + - { variant-file: linux_64_python3.9.____cpython, target-platform: linux-64, os: ubuntu-latest, rattler-build-args: '' } + - { variant-file: linux_64_python3.13.____cpython, target-platform: linux-64, os: ubuntu-latest, rattler-build-args: '' } + - { variant-file: osx_64_python3.10.____cpython, target-platform: osx-64, os: macos-latest, rattler-build-args: '' } + - { variant-file: osx_arm64_python3.9.____cpython, target-platform: osx-arm64, os: macos-latest, rattler-build-args: '' } + - { variant-file: osx_arm64_python3.13.____cpython, target-platform: osx-arm64, os: macos-latest, rattler-build-args: '' } + - { variant-file: win_64_python3.9.____cpython, target-platform: win-64, os: windows-latest, rattler-build-args: '' } + - { variant-file: win_64_python3.13.____cpython, target-platform: win-64, os: windows-latest, rattler-build-args: '' } + steps: + - name: Checkout branch + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Get git metadata + id: git-metadata + shell: bash + run: | + if [ -f .git/shallow ]; then + git fetch --prune --unshallow + fi + GIT_DESCRIBE_TAG="$(git describe --tags --abbrev=0 || echo UNKNOWN)" + echo GIT_DESCRIBE_TAG=${GIT_DESCRIBE_TAG} >> $GITHUB_OUTPUT + GIT_DESCRIBE_HASH=g"$(git rev-parse --short HEAD || echo UNKNOWN)" + echo GIT_DESCRIBE_HASH=${GIT_DESCRIBE_HASH} >> $GITHUB_OUTPUT + GIT_DESCRIBE_NUMBER="$(git rev-list --count ${GIT_DESCRIBE_TAG}..HEAD || echo UNKNOWN)" + echo GIT_DESCRIBE_NUMBER=$GIT_DESCRIBE_NUMBER >> $GITHUB_OUTPUT + + - uses: prefix-dev/rattler-build-action@b1147fbfc554014f7b152296deeab0de1789f05d # v0.2.30 + with: + recipe-path: conda.recipe/recipe.yaml + build-args: -m .ci_support/${{ matrix.variant-file }}.yaml --target-platform ${{ matrix.target-platform }} ${{ matrix.rattler-build-args }} + artifact-name: package-${{ matrix.variant-file }} + env: + GIT_DESCRIBE_TAG: ${{ steps.git-metadata.outputs.GIT_DESCRIBE_TAG }} + GIT_DESCRIBE_HASH: ${{ steps.git-metadata.outputs.GIT_DESCRIBE_HASH }} + GIT_DESCRIBE_NUMBER: ${{ steps.git-metadata.outputs.GIT_DESCRIBE_NUMBER }} diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml deleted file mode 100644 index ffaf0e4c..00000000 --- a/conda.recipe/meta.yaml +++ /dev/null @@ -1,54 +0,0 @@ -package: - name: glum - version: {{ environ.get('GIT_DESCRIBE_TAG', '').lstrip('v') }}{% if environ.get('GIT_DESCRIBE_NUMBER', 0)|int != 0 %}.post{{ GIT_DESCRIBE_NUMBER }}+{{ GIT_DESCRIBE_HASH }}{% endif %} - -source: - git_url: ../ - - -build: - number: 0 - script: {{ PYTHON }} -m pip install . -vv - -requirements: - build: - - python # [build_platform != target_platform] - - cross-python_{{ target_platform }} # [build_platform != target_platform] - - cython # [build_platform != target_platform] - - numpy # [build_platform != target_platform] - - {{ compiler("c") }} - - {{ compiler("cxx") }} - - llvm-openmp # [osx] - host: - - python - - cython - - llvm-openmp # [osx] - - numpy - - pip - - scikit-learn >=0.23 - - setuptools_scm - run: - - python - - joblib - - numexpr - - {{ pin_compatible('numpy') }} - - packaging - - pandas - - scikit-learn >=0.23 - - scipy - - formulaic >=0.6 - - tabmat >=4.0.0 - -test: - requires: - - pip - commands: - - pip check - imports: - - glum - -about: - home: https://github.com/Quantco/glum - license: BSD-3-Clause - license_family: BSD - license_file: LICENSE diff --git a/conda.recipe/recipe.yaml b/conda.recipe/recipe.yaml new file mode 100644 index 00000000..21e4a041 --- /dev/null +++ b/conda.recipe/recipe.yaml @@ -0,0 +1,64 @@ +context: + name: glum + version: ${{ env.get('GIT_DESCRIBE_TAG') | trim('v') }}${{ ('.post' + env.get('GIT_DESCRIBE_NUMBER') + '+' + env.get('GIT_DESCRIBE_HASH')) if env.get('GIT_DESCRIBE_NUMBER', default='0') != '0' }} + +package: + name: glum + version: ${{ version }} + +source: + path: ../ + +build: + number: 0 + script: python -m pip install . -vv + +requirements: + build: + - if: build_platform != target_platform + then: + - python + - cross-python_${{ target_platform }} + - cython + - numpy + - ${{ compiler("c") }} + - ${{ stdlib("c") }} + - ${{ compiler("cxx") }} + - if: osx + then: + - llvm-openmp + - if: linux + then: + - libgomp + host: + - python + - cython + - if: osx + then: + - llvm-openmp + - numpy + - pip + - scikit-learn >=0.23 + - setuptools + - setuptools-scm + run: + - python + - formulaic >=0.6 + - joblib + - numexpr + - packaging + - pandas + - scikit-learn >=0.23 + - scipy + - tabmat >=4.0.0 + +tests: + - python: + pip_check: true + imports: + - glum + +about: + homepage: https://github.com/Quantco/glum + license: BSD-3-Clause + license_file: LICENSE