From 59f255500ac6509a71343d6372994b60e71c1698 Mon Sep 17 00:00:00 2001 From: megyaz Date: Mon, 28 Oct 2024 14:30:03 +0100 Subject: [PATCH 1/3] condabuild for windows --- .github/workflows/python-package-conda.yml | 61 ++++++++++++---------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index c73a267..f24b081 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -17,58 +17,62 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: miniforge-version: latest - - name: Install conda-build + channels: conda-forge + auto-update-conda: true + - name: Install build dependencies shell: bash -l {0} - run: conda install conda-build setuptools_scm boa git + run: | + conda install conda-build setuptools_scm boa git compilers + pip install wheel build + - name: Set environment variables for compilers + shell: bash -l {0} + run: | + export CXXFLAGS="-std=c++11" # Adjust flags as necessary for your project - name: build package shell: bash -l {0} run: | export SETUPTOOLS_SCM_PRETEND_VERSION=$(python -m setuptools_scm) - echo "Version: " - echo $SETUPTOOLS_SCM_PRETEND_VERSION - conda mambabuild $GITHUB_WORKSPACE --output-folder=$GITHUB_WORKSPACE + echo "Version: $SETUPTOOLS_SCM_PRETEND_VERSION" + conda mambabuild $GITHUB_WORKSPACE --output-folder=$GITHUB_WORKSPACE --no-anaconda-upload --debug - uses: actions/upload-artifact@v3 with: name: package-${{ github.sha }} path: ${{ github.workspace }}/**/azint*.bz2 build-win: - runs-on: ${{ matrix.os }} + runs-on: windows-latest timeout-minutes: 15 - strategy: - matrix: - os: [windows-latest] steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: ilammy/msvc-dev-cmd@v1 + - name: Setup MSVC Compiler + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 - uses: conda-incubator/setup-miniconda@v2 with: miniforge-version: latest - - name: Install conda-build - shell: bash -l {0} - run: conda install conda-build setuptools_scm boa git + channels: conda-forge + auto-update-conda: true + - name: Install build dependencies + run: | + conda install conda-build setuptools_scm boa git compilers + pip install wheel build - name: build package - shell: bash -l {0} run: | - rm /usr/bin/link export SETUPTOOLS_SCM_PRETEND_VERSION=$(python -m setuptools_scm) - echo "Version: " - echo $SETUPTOOLS_SCM_PRETEND_VERSION - conda mambabuild $GITHUB_WORKSPACE --output-folder=$GITHUB_WORKSPACE + echo "Version: $SETUPTOOLS_SCM_PRETEND_VERSION" + conda mambabuild $GITHUB_WORKSPACE --output-folder=$GITHUB_WORKSPACE --no-anaconda-upload --debug - uses: actions/upload-artifact@v3 with: name: package-${{ github.sha }} path: ${{ github.workspace }}/**/azint*.bz2 build-mac-arm: - runs-on: ${{ matrix.os }} + runs-on: macos-14 timeout-minutes: 15 - strategy: - matrix: - os: [macos-14] steps: - uses: actions/checkout@v3 @@ -77,16 +81,19 @@ jobs: - uses: conda-incubator/setup-miniconda@v3 with: miniforge-version: latest - - name: Install conda-build + channels: conda-forge + auto-update-conda: true + - name: Install build dependencies shell: bash -l {0} - run: conda install conda-build setuptools_scm boa git + run: | + conda install conda-build setuptools_scm boa git compilers + pip install wheel build - name: build package shell: bash -l {0} run: | export SETUPTOOLS_SCM_PRETEND_VERSION=$(python -m setuptools_scm) - echo "Version: " - echo $SETUPTOOLS_SCM_PRETEND_VERSION - conda mambabuild $GITHUB_WORKSPACE --output-folder=$GITHUB_WORKSPACE + echo "Version: $SETUPTOOLS_SCM_PRETEND_VERSION" + conda mambabuild $GITHUB_WORKSPACE --output-folder=$GITHUB_WORKSPACE --no-anaconda-upload --debug - uses: actions/upload-artifact@v3 with: name: package-${{ github.sha }} From 182dbec02624ac1b73e0614478a828d9fe6ecc3a Mon Sep 17 00:00:00 2001 From: megyaz Date: Mon, 28 Oct 2024 15:02:49 +0100 Subject: [PATCH 2/3] increase timeout-minutes --- .github/workflows/python-package-conda.yml | 57 ++++++++-------------- 1 file changed, 21 insertions(+), 36 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index f24b081..642a80a 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -5,7 +5,7 @@ on: [push] jobs: build: runs-on: ${{ matrix.os }} - timeout-minutes: 15 + timeout-minutes: 30 # Increased timeout limit strategy: matrix: os: [ubuntu-latest, macos-latest] @@ -17,23 +17,16 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: miniforge-version: latest - channels: conda-forge - auto-update-conda: true - - name: Install build dependencies + - name: Install conda-build shell: bash -l {0} - run: | - conda install conda-build setuptools_scm boa git compilers - pip install wheel build - - name: Set environment variables for compilers - shell: bash -l {0} - run: | - export CXXFLAGS="-std=c++11" # Adjust flags as necessary for your project + run: conda install conda-build setuptools_scm boa git - name: build package shell: bash -l {0} run: | export SETUPTOOLS_SCM_PRETEND_VERSION=$(python -m setuptools_scm) - echo "Version: $SETUPTOOLS_SCM_PRETEND_VERSION" - conda mambabuild $GITHUB_WORKSPACE --output-folder=$GITHUB_WORKSPACE --no-anaconda-upload --debug + echo "Version: " + echo $SETUPTOOLS_SCM_PRETEND_VERSION + conda mambabuild $GITHUB_WORKSPACE --output-folder=$GITHUB_WORKSPACE - uses: actions/upload-artifact@v3 with: name: package-${{ github.sha }} @@ -41,30 +34,25 @@ jobs: build-win: runs-on: windows-latest - timeout-minutes: 15 + timeout-minutes: 30 # Increased timeout limit steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Setup MSVC Compiler - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x64 + - uses: ilammy/msvc-dev-cmd@v1 - uses: conda-incubator/setup-miniconda@v2 with: miniforge-version: latest - channels: conda-forge - auto-update-conda: true - - name: Install build dependencies - run: | - conda install conda-build setuptools_scm boa git compilers - pip install wheel build + - name: Install conda-build + shell: pwsh # Use PowerShell shell + run: conda install conda-build setuptools_scm boa git - name: build package + shell: pwsh run: | - export SETUPTOOLS_SCM_PRETEND_VERSION=$(python -m setuptools_scm) - echo "Version: $SETUPTOOLS_SCM_PRETEND_VERSION" - conda mambabuild $GITHUB_WORKSPACE --output-folder=$GITHUB_WORKSPACE --no-anaconda-upload --debug + $env:SETUPTOOLS_SCM_PRETEND_VERSION = $(python -m setuptools_scm) + Write-Host "Version: $env:SETUPTOOLS_SCM_PRETEND_VERSION" + conda mambabuild $GITHUB_WORKSPACE --output-folder=$GITHUB_WORKSPACE - uses: actions/upload-artifact@v3 with: name: package-${{ github.sha }} @@ -72,7 +60,7 @@ jobs: build-mac-arm: runs-on: macos-14 - timeout-minutes: 15 + timeout-minutes: 30 # Increased timeout limit steps: - uses: actions/checkout@v3 @@ -81,19 +69,16 @@ jobs: - uses: conda-incubator/setup-miniconda@v3 with: miniforge-version: latest - channels: conda-forge - auto-update-conda: true - - name: Install build dependencies + - name: Install conda-build shell: bash -l {0} - run: | - conda install conda-build setuptools_scm boa git compilers - pip install wheel build + run: conda install conda-build setuptools_scm boa git - name: build package shell: bash -l {0} run: | export SETUPTOOLS_SCM_PRETEND_VERSION=$(python -m setuptools_scm) - echo "Version: $SETUPTOOLS_SCM_PRETEND_VERSION" - conda mambabuild $GITHUB_WORKSPACE --output-folder=$GITHUB_WORKSPACE --no-anaconda-upload --debug + echo "Version: " + echo $SETUPTOOLS_SCM_PRETEND_VERSION + conda mambabuild $GITHUB_WORKSPACE --output-folder=$GITHUB_WORKSPACE - uses: actions/upload-artifact@v3 with: name: package-${{ github.sha }} From 06acf07b7d77232d379ea416265e002c206c08be Mon Sep 17 00:00:00 2001 From: megyaz Date: Mon, 28 Oct 2024 15:31:23 +0100 Subject: [PATCH 3/3] add RECIPE_PATH --- .github/workflows/python-package-conda.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 642a80a..aa35968 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -26,7 +26,7 @@ jobs: export SETUPTOOLS_SCM_PRETEND_VERSION=$(python -m setuptools_scm) echo "Version: " echo $SETUPTOOLS_SCM_PRETEND_VERSION - conda mambabuild $GITHUB_WORKSPACE --output-folder=$GITHUB_WORKSPACE + conda mambabuild $GITHUB_WORKSPACE/conda-recipe --output-folder=$GITHUB_WORKSPACE - uses: actions/upload-artifact@v3 with: name: package-${{ github.sha }} @@ -52,7 +52,7 @@ jobs: run: | $env:SETUPTOOLS_SCM_PRETEND_VERSION = $(python -m setuptools_scm) Write-Host "Version: $env:SETUPTOOLS_SCM_PRETEND_VERSION" - conda mambabuild $GITHUB_WORKSPACE --output-folder=$GITHUB_WORKSPACE + conda mambabuild "$env:GITHUB_WORKSPACE/conda-recipe" --output-folder="$env:GITHUB_WORKSPACE" - uses: actions/upload-artifact@v3 with: name: package-${{ github.sha }} @@ -78,7 +78,7 @@ jobs: export SETUPTOOLS_SCM_PRETEND_VERSION=$(python -m setuptools_scm) echo "Version: " echo $SETUPTOOLS_SCM_PRETEND_VERSION - conda mambabuild $GITHUB_WORKSPACE --output-folder=$GITHUB_WORKSPACE + conda mambabuild $GITHUB_WORKSPACE/conda-recipe --output-folder=$GITHUB_WORKSPACE - uses: actions/upload-artifact@v3 with: name: package-${{ github.sha }}