diff --git a/.github/actions/conda-build/action.yml b/.github/actions/conda-build/action.yml deleted file mode 100644 index e4d97d03..00000000 --- a/.github/actions/conda-build/action.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Run image -description: Run private container from GitHub Packages Registry after Docker login -inputs: - conda_build_yml: - description: "conda-build variant file" - required: true -runs: - using: 'docker' - image: condaforge/mambaforge:latest - args: - - /bin/bash - - "-l" - - "-c" - - "./.github/workflows/conda-build.sh ${{ inputs.conda_build_yml }}" diff --git a/.github/actions/linter/action.yml b/.github/actions/linter/action.yml deleted file mode 100644 index 2e1719b1..00000000 --- a/.github/actions/linter/action.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: Run linter in Docker image -description: Run private container from GitHub Packages Registry after Docker login -runs: - using: 'docker' - image: condaforge/mambaforge:latest - args: - - /bin/bash - - "-l" - - "-c" - - "./.github/workflows/pre-commit.sh" diff --git a/.github/actions/unittests/action.yml b/.github/actions/unittests/action.yml deleted file mode 100644 index dc6b2244..00000000 --- a/.github/actions/unittests/action.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Run image -description: Run private container from GitHub Packages Registry after Docker login -inputs: - python_version: - description: 'Python version' - required: true - pandas_version: - description: 'Pandas version' - required: false - numpy_version: - description: 'Numpy version' - required: false - scikit_version: - description: 'Scikit-learn version' - required: false - scipy_version: - description: 'Scipy version' - required: false - tabmat_version: - description: 'Tabmat version' - required: false -runs: - using: 'docker' - image: condaforge/mambaforge:latest - args: - - /bin/bash - - "-l" - - "-c" - - "PYTHON_VERSION=${{ inputs.python_version }} PANDAS_VERSION=${{ inputs.pandas_version }} NUMPY_VERSION=${{ inputs.numpy_version }} SCIKIT_VERSION=${{ inputs.scikit_version }} SCIPY_VERSION=${{ inputs.scipy_version }} TABMAT_VERSION=${{ inputs.tabmat_version }} ./.github/workflows/test.sh" diff --git a/.github/workflows/base.sh b/.github/workflows/base.sh deleted file mode 100644 index e2de98cb..00000000 --- a/.github/workflows/base.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -eo pipefail - -export PYTHON_VERSION=$1 - -# Enable 'conda' command to make 'conda activate' work -CONDA_BASE=$(conda info --base) -source ${CONDA_BASE}/etc/profile.d/conda.sh diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index eb1aef5b..f0b0f052 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -16,12 +16,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Build wheels uses: pypa/cibuildwheel@v2.14.1 env: CIBW_ARCHS_MACOS: x86_64 arm64 - - uses: actions/upload-artifact@v3 with: path: ./wheelhouse/*.whl @@ -31,17 +29,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 name: Install Python with: python-version: '3.8' - - name: Install build dependencies run: python -m pip install setuptools setuptools-scm wheel Cython numpy scikit-learn - name: Build sdist run: python setup.py sdist - - uses: actions/upload-artifact@v3 with: path: dist/*.tar.gz @@ -55,12 +50,11 @@ jobs: with: name: artifact path: dist - - - uses: pypa/gh-action-pypi-publish@v1.8.8 + - uses: pypa/gh-action-pypi-publish@v1.8.10 with: user: __token__ password: ${{ secrets.GH_TESTPYPI_UPLOAD }} - repository_url: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ upload_pypi: needs: [build_wheels, build_sdist, upload_testpypi] @@ -71,8 +65,7 @@ jobs: with: name: artifact path: dist - - - uses: pypa/gh-action-pypi-publish@v1.8.8 + - uses: pypa/gh-action-pypi-publish@v1.8.10 with: user: __token__ password: ${{ secrets.GH_PYPI_UPLOAD }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36ab70d3..5f77be17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,62 +2,76 @@ name: CI on: [push] jobs: - linter: - name: "Linter (pre-commit)" + pre-commit-checks: + name: Linux - pre-commit checks - Python 3.10 + timeout-minutes: 30 runs-on: ubuntu-latest env: - CI: True - strategy: - fail-fast: true + PRE_COMMIT_USE_MICROMAMBA: 1 steps: - - name: Pull image - run: docker pull condaforge/mambaforge:latest - - name: Checkout branch - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} - - name: Run linter inside of container - uses: ./.github/actions/linter - linux: - name: "Linux - tests - Py${{ matrix.PYTHON_VERSION }}" - runs-on: ubuntu-latest - env: - CI: True - strategy: - fail-fast: true - matrix: - PYTHON_VERSION: ['3.8', '3.9', '3.10'] - steps: - - name: Pull image - run: docker pull condaforge/mambaforge:latest - - name: Checkout branch - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} - - name: Run CI inside of container - uses: ./.github/actions/unittests - with: - python_version: ${{ matrix.PYTHON_VERSION }} - linux-conda-build: - name: "Linux - conda-build - Python ${{ matrix.CONDA_BUILD_YML }}" - runs-on: ubuntu-latest + - name: Checkout branch + uses: actions/checkout@v3.5.2 + - name: Set up micromamba + uses: mamba-org/setup-micromamba@d05808540d968a55ca33c798e0661fb98f533c73 + - name: Add micromamba to GITHUB_PATH + run: echo "${HOME}/micromamba-bin" >> "$GITHUB_PATH" + - name: Install Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Run pre-commit checks + uses: pre-commit/action@v3.0.0 + + unit-tests: + name: Tests - ${{ matrix.os }} - Py${{ matrix.python-version }} + runs-on: ${{ matrix.os }} env: CI: True strategy: fail-fast: true matrix: - CONDA_BUILD_YML: - - linux_64_numpy1.20python3.8.____cpython + include: + - { os: ubuntu-latest, python-version: '3.8' } + - { os: ubuntu-latest, python-version: '3.9' } + - { os: ubuntu-latest, python-version: '3.10' } + - { os: ubuntu-latest, python-version: '3.11' } + - { os: macos-latest, python-version: '3.10' } + - { os: windows-latest, python-version: '3.10' } steps: - - name: Pull image - run: docker pull condaforge/mambaforge:latest - name: Checkout branch uses: actions/checkout@v3 + - name: Set up conda env + uses: mamba-org/setup-micromamba@875557da4ee020f18df03b8910a42203fbf02da1 with: - ref: ${{ github.head_ref }} - - name: Fetch full git history - run: git fetch --prune --unshallow - - name: Run CI inside of container - uses: ./.github/actions/conda-build - with: - conda_build_yml: ${{ matrix.CONDA_BUILD_YML }} + environment-file: environment.yml + init-shell: ${{ matrix.os == 'windows-latest' && 'powershell' || 'bash' }} + cache-environment: true + create-args: >- + python=${{ matrix.python-version }} + - name: Install repository (unix) + if: matrix.os != 'windows-latest' + shell: bash -el {0} + run: pip install --no-use-pep517 --no-deps --disable-pip-version-check -e . + - name: Install repository (windows) + if: matrix.os == 'windows-latest' + shell: powershell + run: pip install --no-use-pep517 --no-deps --disable-pip-version-check -e . + - name: Run pytest (unix) + if: matrix.os != 'windows-latest' + shell: bash -el {0} + run: pytest -nauto tests/glm --doctest-modules src/glum + - name: Run pytest (windows) + if: matrix.os == 'windows-latest' + shell: powershell + run: pytest -nauto .\tests\glm --doctest-modules .\src\glum + - name: Run doctest + if: matrix.os != 'windows-latest' + shell: bash -el {0} + # Check that the readme example will work by running via doctest. + # We run outside the repo to make the test a bit more similar to + # a user running after installing with conda. + run: | + mkdir ../temp + cp README.md ../temp + cd ../temp + python -m doctest -v README.md diff --git a/.github/workflows/conda-build-linux-main.yml b/.github/workflows/conda-build-linux-main.yml deleted file mode 100644 index 7da62dcb..00000000 --- a/.github/workflows/conda-build-linux-main.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: conda-build Linux -on: - push: - branches: - - main -jobs: - linux-conda-build: - name: "Linux - conda-build - Python ${{ matrix.CONDA_BUILD_YML }}" - runs-on: ubuntu-latest - env: - CI: True - strategy: - fail-fast: true - matrix: - CONDA_BUILD_YML: - - linux_64_numpy1.20python3.8.____cpython - - linux_64_numpy1.20python3.9.____cpython - - linux_64_numpy1.23python3.11.____cpython - steps: - - name: Pull image - run: docker pull condaforge/mambaforge:latest - - name: Checkout branch - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} - - name: Fetch full git history - run: git fetch --prune --unshallow - - name: Run CI inside of container - uses: ./.github/actions/conda-build - with: - conda_build_yml: ${{ matrix.CONDA_BUILD_YML }} diff --git a/.github/workflows/conda-build-macos.yml b/.github/workflows/conda-build-macos.yml deleted file mode 100644 index c51c844e..00000000 --- a/.github/workflows/conda-build-macos.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: conda-build macOS -on: - push: - paths: - - '.github/**' - - 'conda.recipe/**' -jobs: - macos-conda-build: - name: "MacOS - conda-build - Python ${{ matrix.CONDA_BUILD_YML }}" - runs-on: macos-latest - env: - CI: True - CONDA_BUILD_YML: ${{ matrix.CONDA_BUILD_YML }} - strategy: - fail-fast: false - matrix: - CONDA_BUILD_YML: - - osx_64_numpy1.20python3.9.____cpython - - osx_64_numpy1.23python3.11.____cpython - - osx_arm64_numpy1.20python3.8.____cpython - - osx_arm64_numpy1.21python3.10.____cpython - steps: - - name: Checkout branch - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} - - name: Fetch full git history - run: git fetch --prune --unshallow - - uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3 - with: - miniforge-variant: Mambaforge - miniforge-version: 4.10.0-0 - use-mamba: true - channels: conda-forge - - name: Build conda package - shell: bash -l {0} - run: ./.github/workflows/macos-conda-build.sh - diff --git a/.github/workflows/conda-build-win.yml b/.github/workflows/conda-build-win.yml deleted file mode 100644 index fbac9819..00000000 --- a/.github/workflows/conda-build-win.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: conda-build Windows -on: - push: - paths: - - '.github/**' - - 'conda.recipe/**' -jobs: - windows-conda-build: - name: "Windows - conda-build - ${{ matrix.CONDA_BUILD_YML }}" - runs-on: windows-latest - env: - CI: True - CONDA_BUILD_YML: "${{ matrix.CONDA_BUILD_YML }}" - strategy: - fail-fast: false - matrix: - CONDA_BUILD_YML: - - win_64_numpy1.20python3.8.____cpython - - win_64_numpy1.23python3.11.____cpython - steps: - - name: Checkout branch - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} - - name: Fetch full git history - run: git fetch --prune --unshallow - - uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3 - with: - miniforge-variant: Mambaforge - miniforge-version: 4.14.0-2 - use-mamba: true - - name: Build conda package - shell: pwsh - run: | - mamba install -n base -y boa - conda mambabuild -m .ci_support/${{ matrix.CONDA_BUILD_YML}}.yaml conda.recipe diff --git a/.github/workflows/conda-build.sh b/.github/workflows/conda-build.sh deleted file mode 100755 index f93b0ad9..00000000 --- a/.github/workflows/conda-build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -eo pipefail - -export CONDA_BUILD_YML=$1 - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -source ${SCRIPT_DIR}/base.sh $* -conda activate base -mamba install -y boa conda-build -conda mambabuild -m .ci_support/${CONDA_BUILD_YML}.yaml conda.recipe diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml new file mode 100644 index 00000000..c18dba23 --- /dev/null +++ b/.github/workflows/conda-build.yml @@ -0,0 +1,64 @@ +name: conda-build +on: + pull_request: + branches: + - main + push: + branches: + - main + 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_numpy1.20python3.8.____cpython, os: ubuntu-latest, conda-build-args: '' } + - { conda_build_yml: linux_64_numpy1.20python3.9.____cpython, os: ubuntu-latest, conda-build-args: '' } + - { conda_build_yml: linux_64_numpy1.23python3.11.____cpython, os: ubuntu-latest, conda-build-args: '' } + - { conda_build_yml: osx_64_numpy1.20python3.9.____cpython, os: macos-latest, conda-build-args: '' } + - { conda_build_yml: osx_64_numpy1.23python3.11.____cpython, os: macos-latest, conda-build-args: '' } + - { conda_build_yml: osx_arm64_numpy1.20python3.8.____cpython, os: macos-latest, conda-build-args: ' --no-test' } + - { conda_build_yml: osx_arm64_numpy1.21python3.10.____cpython, os: macos-latest, conda-build-args: ' --no-test' } + - { conda_build_yml: win_64_numpy1.20python3.8.____cpython, os: windows-latest, conda-build-args: '' } + - { conda_build_yml: win_64_numpy1.23python3.11.____cpython, os: windows-latest, conda-build-args: '' } + steps: + - name: Checkout branch + uses: actions/checkout@v3 + - name: Fetch full git history + run: git fetch --prune --unshallow + - uses: mamba-org/setup-micromamba@875557da4ee020f18df03b8910a42203fbf02da1 + with: + init-shell: ${{ matrix.os == 'windows-latest' && 'cmd.exe' || 'bash' }} + environment-name: build + create-args: boa + - 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-mambabuild + -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-mambabuild + -m ".ci_support/${{ matrix.conda_build_yml }}.yaml"${{ matrix.conda-build-args }} + conda.recipe diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 6c8a8553..0a6c2bcc 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -5,7 +5,6 @@ on: push: paths: - '.github/workflows/daily.yml' - - '.github/workflows/test.sh' jobs: linux-daily-unittests: @@ -18,35 +17,50 @@ jobs: matrix: include: - PYTHON_VERSION: '3.10' - PANDAS_VERSION: 'nightly' - NUMPY_VERSION: 'nightly' - SCIKIT_VERSION: 'nightly' - SCIPY_VERSION: 'nightly' - TABMAT_VERSION: 'nightly' NOTE: 'Nightly Builds' # run once with nightlies - PYTHON_VERSION: '3.10' - PANDAS_VERSION: '' - NUMPY_VERSION: '' - SCIKIT_VERSION: '' - SCIPY_VERSION: '' - TABMAT_VERSION: '' NOTE: 'Default Builds' # run once with normal dependencies steps: - - name: Pull image - run: docker pull condaforge/mambaforge:latest - name: Checkout branch uses: actions/checkout@v3 + - uses: mamba-org/setup-micromamba@875557da4ee020f18df03b8910a42203fbf02da1 with: - ref: ${{ github.head_ref }} - - name: Run CI inside of container - uses: ./.github/actions/unittests - with: - python_version: ${{ matrix.PYTHON_VERSION }} - pandas_version: ${{ matrix.PANDAS_VERSION }} - numpy_version: ${{ matrix.NUMPY_VERSION }} - scikit_version: ${{ matrix.SCIKIT_VERSION }} - scipy_version: ${{ matrix.SCIPY_VERSION }} - tabmat_version: ${{ matrix.TABMAT_VERSION }} + environment-file: environment.yml + create-args: >- + python=${{ matrix.PYTHON_VERSION }} + - name: Install nightlies + if: matrix.NOTE == 'Nightly Builds' + shell: bash -el {0} + run: | + # needed for tabmat + echo "Install compilation dependencies" + micromamba install -y c-compiler cxx-compiler cython jemalloc-local libgomp mako xsimd + + PRE_WHEELS="https://pypi.anaconda.org/scipy-wheels-nightly/simple" + for pkg in numpy pandas scikit-learn scipy; do + echo "Installing $pkg nightly" + micromamba remove -y --force $pkg + pip install --pre --no-deps --only-binary :all: --upgrade --timeout=60 -i $PRE_WHEELS $pkg + done + echo Install tabmat nightly + micromamba remove -y --force tabmat + pip install git+https://github.com/Quantco/tabmat + - name: Install repository + shell: bash -el {0} + run: pip install --no-use-pep517 --no-deps --disable-pip-version-check -e . + - name: Run pytest + shell: bash -el {0} + run: pytest -nauto tests/glm --doctest-modules src/glum/ + - name: Run doctest + shell: bash -el {0} + # Check that the readme example will work by running via doctest. + # We run outside the repo to make the test a bit more similar to + # a user running after installing with conda. + run: | + mkdir ../temp + cp README.md ../temp + cd ../temp + python -m doctest -v README.md - name: Issue on failure uses: actions/github-script@v6 if: ${{ failure() }} @@ -68,4 +82,4 @@ jobs: labels: ["[bot] Daily run"] }) } - }); \ No newline at end of file + }); diff --git a/.github/workflows/macos-conda-build.sh b/.github/workflows/macos-conda-build.sh deleted file mode 100755 index 598f8cf4..00000000 --- a/.github/workflows/macos-conda-build.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -set -exo pipefail - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -source ${SCRIPT_DIR}/base.sh $* -conda activate base - -mamba install -y conda-build boa -c conda-forge -# Don't test cross-compiled result (there is no emulation) and use the latest MacOS SDK. -if grep -q "osx-arm64" .ci_support/${CONDA_BUILD_YML}.yaml; then - CONDA_BUILD_ARGS="--no-test" - export CONDA_BUILD_SYSROOT=$(xcrun --sdk macosx --show-sdk-path) - cat <> .ci_support/${CONDA_BUILD_YML}.yaml -CONDA_BUILD_SYSROOT: - - "${CONDA_BUILD_SYSROOT}" -EOF -fi -conda mambabuild -m .ci_support/${CONDA_BUILD_YML}.yaml conda.recipe ${CONDA_BUILD_ARGS:-} diff --git a/.github/workflows/macos.sh b/.github/workflows/macos.sh deleted file mode 100755 index 9b679576..00000000 --- a/.github/workflows/macos.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -exo pipefail -source ~/.profile - -mamba install -y yq jq - -yq -Y ". + {dependencies: [.dependencies[], \"python=${PYTHON_VERSION}\"] }" environment.yml > /tmp/environment.yml -mamba env create -f /tmp/environment.yml -mamba env update -n $(yq -r .name environment.yml) --file environment-benchmark.yml -conda activate $(yq -r .name environment.yml) -pip install --no-use-pep517 --no-deps --disable-pip-version-check -e . -pytest -nauto tests --doctest-modules src/glum/ diff --git a/.github/workflows/pre-commit.sh b/.github/workflows/pre-commit.sh deleted file mode 100755 index e5e081a8..00000000 --- a/.github/workflows/pre-commit.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -exo pipefail - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -source ${SCRIPT_DIR}/base.sh $* - -git config --global --add safe.directory /github/workspace - -mamba install -y pre-commit - -export PRE_COMMIT_USE_MAMBA=1 - -pre-commit install -pre-commit run -a diff --git a/.github/workflows/test.sh b/.github/workflows/test.sh deleted file mode 100755 index 2e3c74cb..00000000 --- a/.github/workflows/test.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash - -set -exo pipefail - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -source ${SCRIPT_DIR}/base.sh "$PYTHON_VERSION" - -mamba install -y yq - -cat environment.yml > /tmp/environment.yml - -# pin version of some libraries, if specified -LIBRARIES=("python" "pandas" "numpy" "scikit" "scipy" "tabmat") -for library in "${LIBRARIES[@]}"; do - varname="${library^^}_VERSION" - version=${!varname} - if [[ -n "$version" && "$version" != "nightly" ]]; then - if [[ "${library}" == "scikit" ]]; then - library="scikit-learn" - fi - yq -Y --in-place ". + {dependencies: [.dependencies[], \"${library}=${version}\"]}" /tmp/environment.yml - fi -done - -cat /tmp/environment.yml - -mamba env create -f /tmp/environment.yml -mamba env update -n $(yq -r .name environment.yml) --file environment-benchmark.yml -conda activate $(yq -r .name environment.yml) - -# This needs to be done before any 'uninstall --force' -if [[ "$TABMAT_VERSION" == "nightly" ]]; then - echo "Install compilation dependencies" - mamba install -y c-compiler cxx-compiler cython jemalloc-local libgomp mako xsimd -fi - -PRE_WHEELS="https://pypi.anaconda.org/scipy-wheels-nightly/simple" -if [[ "$NUMPY_VERSION" == "nightly" ]]; then - echo "Installing Numpy nightly" - conda uninstall -y --force numpy - pip install --pre --no-deps --only-binary :all: --upgrade --timeout=60 -i $PRE_WHEELS numpy -fi -if [[ "$PANDAS_VERSION" == "nightly" ]]; then - echo "Installing Pandas nightly" - conda uninstall -y --force pandas - pip install --pre --no-deps --only-binary :all: --upgrade --timeout=60 -i $PRE_WHEELS pandas -fi -if [[ "$SCIKIT_VERSION" == "nightly" ]]; then - echo "Install scikit-learn nightly" - conda uninstall -y --force scikit-learn - pip install --pre --no-deps --only-binary :all: --upgrade --timeout=60 -i $PRE_WHEELS scikit-learn -fi -if [[ "$SCIPY_VERSION" == "nightly" ]]; then - echo "Installing Scipy nightly" - conda uninstall -y --force scipy - pip install --pre --no-deps --only-binary :all: --upgrade --timeout=60 -i $PRE_WHEELS scipy -fi -if [[ "$TABMAT_VERSION" == "nightly" ]]; then - echo "Install tabmat nightly" - conda uninstall -y --force tabmat - pip install git+https://github.com/Quantco/tabmat -fi - -git config --global --add safe.directory /github/workspace - -pip install --no-use-pep517 --no-deps --disable-pip-version-check -e . -pytest -nauto tests --doctest-modules src/glum/ - -# Check that the readme example will work by running via doctest. -# We run outside the repo to make the test a bit more similar to -# a user running after installing with conda. -mkdir ../temp -cp README.md ../temp -cd ../temp -python -m doctest -v README.md \ No newline at end of file diff --git a/.github/workflows/tests-macos-main.yml b/.github/workflows/tests-macos-main.yml deleted file mode 100644 index 2e602a1e..00000000 --- a/.github/workflows/tests-macos-main.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: CI - macOS -on: - push: - branches: - - main - -jobs: - macos: - name: "MacOS - tests - Python ${{ matrix.PYTHON_VERSION }}" - runs-on: macos-latest - env: - CI: True - PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }} - strategy: - fail-fast: true - matrix: - PYTHON_VERSION: ['3.10'] - steps: - - name: Checkout branch - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} - - uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3 - with: - miniforge-variant: Mambaforge - miniforge-version: 4.10.0-0 - use-mamba: true - - name: Run Unit Tests - shell: bash -l {0} - run: ./.github/workflows/macos.sh - diff --git a/.github/workflows/tests-macos.yml b/.github/workflows/tests-macos.yml deleted file mode 100644 index b6649b51..00000000 --- a/.github/workflows/tests-macos.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: CI - macOS -on: - push: - paths: - - '.github/**' - - '**/*.pyx' - - '**/*.cpp' - - 'setup.py' - - 'environment.yml' - - 'environment-benchmark.yml' - -jobs: - macos: - name: "MacOS - tests - Python ${{ matrix.PYTHON_VERSION }}" - runs-on: macos-latest - env: - CI: True - PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }} - strategy: - fail-fast: true - matrix: - PYTHON_VERSION: ['3.10'] - steps: - - name: Checkout branch - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} - - uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3 - with: - miniforge-variant: Mambaforge - miniforge-version: 4.10.0-0 - use-mamba: true - - name: Run Unit Tests - shell: bash -l {0} - run: ./.github/workflows/macos.sh diff --git a/.github/workflows/tests-win-main.yml b/.github/workflows/tests-win-main.yml deleted file mode 100644 index 4cdecd20..00000000 --- a/.github/workflows/tests-win-main.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: CI - Windows -on: - push: - branches: - - main -jobs: - windows-ci: - name: "Win - tests - Python ${{ matrix.PYTHON_VERSION }}" - runs-on: windows-latest - env: - CI: True - strategy: - fail-fast: true - matrix: - PYTHON_VERSION: ['3.10'] - steps: - - name: Set git to use LF - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - name: Checkout branch - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} - - uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3 - with: - python-version: ${{ matrix.PYTHON_VERSION }} - miniforge-variant: Mambaforge - miniforge-version: 4.10.0-0 - use-mamba: true - environment-file: environment.yml - activate-environment: glum - - name: Install benchmark dependencies - shell: pwsh - run: | - mamba env update -n glum --file environment-benchmark.yml - - name: Run Unit Tests - shell: pwsh - run: | - python -m pip install -e . --no-deps -vv --no-use-pep517 --disable-pip-version-check - pytest tests --doctest-modules src/glum/ diff --git a/.github/workflows/tests-win.yml b/.github/workflows/tests-win.yml deleted file mode 100644 index 045c8cf1..00000000 --- a/.github/workflows/tests-win.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: CI - Windows -on: - push: - paths: - - '.github/**' - - '**/*.pyx' - - '**/*.cpp' - - 'setup.py' - - 'environment.yml' - - 'environment-benchmark.yml' - -jobs: - windows-ci: - name: "Win - tests - Python ${{ matrix.PYTHON_VERSION }}" - runs-on: windows-latest - env: - CI: True - strategy: - fail-fast: true - matrix: - PYTHON_VERSION: ['3.10'] - steps: - - name: Set git to use LF - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - name: Checkout branch - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} - - uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3 - with: - python-version: ${{ matrix.PYTHON_VERSION }} - miniforge-variant: Mambaforge - miniforge-version: 4.10.0-0 - use-mamba: true - environment-file: environment.yml - activate-environment: glum - - name: Install benchmark dependencies - shell: pwsh - run: | - mamba env update -n glum --file environment-benchmark.yml - - name: Run Unit Tests - shell: pwsh - run: | - python -m pip install -e . --no-deps -vv --no-use-pep517 --disable-pip-version-check - pytest tests --doctest-modules src/glum diff --git a/.readthedocs.yml b/.readthedocs.yml index 6057aa84..d0b8a18c 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,6 +1,6 @@ version: 2 build: - os: ubuntu-20.04 + os: ubuntu-22.04 tools: python: mambaforge-4.10 sphinx: