From 1c4355d5a88c2d9b40be282f95f2f5b1005f3535 Mon Sep 17 00:00:00 2001 From: henry senyondo Date: Fri, 7 Jun 2024 16:20:59 -0400 Subject: [PATCH 1/2] Update Conda-app.yml --- .github/workflows/Conda-app.yml | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/.github/workflows/Conda-app.yml b/.github/workflows/Conda-app.yml index c864ee19..849395cb 100644 --- a/.github/workflows/Conda-app.yml +++ b/.github/workflows/Conda-app.yml @@ -13,26 +13,20 @@ jobs: strategy: fail-fast: false matrix: - python-version: - - "3.12" - - "3.11" - - "3.10" + python-version: [ "3.12", "3.11", "3.10" ] + os: [ "ubuntu-latest" ] - os: - - "ubuntu-latest" + runs-on: ${{ matrix.os }} - runs-on: "${{ matrix.os }}" - - # use bash everywhere defaults: run: - shell: "bash -l {0}" + shell: bash -l {0} steps: - - name: "Checkout code" - uses: "actions/checkout@v4" + - name: Checkout code + uses: actions/checkout@v4 - - name: Install opencv dependencies + - name: Install OpenCV dependencies run: | sudo apt-get update sudo apt-get install -y libgl1-mesa-glx libegl1-mesa @@ -48,14 +42,14 @@ jobs: cache-downloads: true - name: Run pytest - run: pytest -v + run: micromamba run -n DeepForest pytest -v - name: Check style - run: yapf -d --recursive deepforest/ --style=.style.yapf + run: micromamba run -n DeepForest yapf -d --recursive deepforest/ --style=.style.yapf - name: Check notebook build - run: pytest --nbmake docs/*.ipynb + run: micromamba run -n DeepForest pytest --nbmake docs/*.ipynb - name: Test Docs run: | - cd docs && make clean && make html SPHINXOPTS="-W" + cd docs && micromamba run -n DeepForest make clean && make html SPHINXOPTS="-W" From 39b06d76960f8a401e94054d70cf41889b9bb0df Mon Sep 17 00:00:00 2001 From: henry senyondo Date: Mon, 24 Jun 2024 09:41:50 -0400 Subject: [PATCH 2/2] Update Conda-app.yml --- .github/workflows/Conda-app.yml | 85 +++++++++++++++++---------------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/.github/workflows/Conda-app.yml b/.github/workflows/Conda-app.yml index 849395cb..d09d427d 100644 --- a/.github/workflows/Conda-app.yml +++ b/.github/workflows/Conda-app.yml @@ -1,55 +1,56 @@ name: Conda package on: - push: - branches: [ main ] pull_request: - branches: [ main ] + push: + branches: [main] jobs: - ci: - name: "CI setup" - - strategy: - fail-fast: false - matrix: - python-version: [ "3.12", "3.11", "3.10" ] - os: [ "ubuntu-latest" ] - - runs-on: ${{ matrix.os }} - + mypy: + runs-on: ubuntu-latest defaults: run: shell: bash -l {0} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install OpenCV dependencies - run: | - sudo apt-get update - sudo apt-get install -y libgl1-mesa-glx libegl1-mesa - sudo apt-get install -y python3-opencv - - - name: Install Conda environment with Micromamba - uses: mamba-org/setup-micromamba@v1 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - name: Cache conda + uses: actions/cache@v4 + env: + # Increase this value to reset cache if environment-test.yml has not changed + CACHE_NUMBER: 0 + with: + path: ~/conda_pkgs_dir + key: ${{ runner.os }}-py39-conda-${{ env.CACHE_NUMBER }}-${{ + hashFiles('environment.yml') }} + - name: Cache multiple paths + uses: actions/cache@v4 + env: + # Increase this value to reset cache if requirements.txt has not changed + CACHE_NUMBER: 0 with: - environment-name: DeepForest + path: | + ~/.cache/pip + $RUNNER_TOOL_CACHE/Python/* + ~\AppData\Local\pip\Cache + key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ + hashFiles('requirements.txt') }} + - uses: conda-incubator/setup-miniconda@v2 + with: + miniforge-variant: Mambaforge + miniforge-version: latest + mamba-version: "*" + activate-environment: DeepForest + channel-priority: strict environment-file: environment.yml - create-args: "python=${{ matrix.python-version }}" - cache-environment: true - cache-downloads: true - - - name: Run pytest - run: micromamba run -n DeepForest pytest -v - - - name: Check style - run: micromamba run -n DeepForest yapf -d --recursive deepforest/ --style=.style.yapf - - - name: Check notebook build - run: micromamba run -n DeepForest pytest --nbmake docs/*.ipynb - - - name: Test Docs + python-version: "3.10" # Run pre-commit on oldest supported Python version + use-mamba: true + use-only-tar-bz2: false # IMPORTANT: This may break caching of conda packages! See https://github.com/conda-incubator/setup-miniconda/issues/267 + - name: Install-pymc and mypy dependencies + run: | + conda activate DeepForest + pip install -e . + python --version + - name: Run Pytest run: | - cd docs && micromamba run -n DeepForest make clean && make html SPHINXOPTS="-W" + conda activate DeepForest + python pytest -v