Repository navigation
Merge pull request #323 from claimed-framework/fix-conda-flake8-bugs #134
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Python Package using Conda | |
| on: [push] | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Add conda to system path | |
| run: | | |
| # $CONDA is an environment variable pointing to the root of the miniconda directory | |
| echo $CONDA/bin >> $GITHUB_PATH | |
| - name: Install dependencies | |
| run: | | |
| # The repo is pip-managed (pyproject.toml); there is no environment.yml. | |
| python -m pip install --upgrade pip | |
| pip install flake8 pytest | |
| # Best-effort install of the package itself. Heavy ML deps (torch, | |
| # terratorch, ...) may not resolve on a vanilla runner; don't fail | |
| # the lint job on that. | |
| pip install -e . || true | |
| - name: Lint with flake8 | |
| run: | | |
| # stop the build if there are Python syntax errors or undefined names | |
| flake8 src terratorch_iterate --count --select=E9,F63,F7,F82 --show-source --statistics | |
| # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
| flake8 src terratorch_iterate --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
| - name: Test with pytest | |
| run: | | |
| # Advisory: many tests require optional heavy deps (torch, terratorch). | |
| pytest tests/unit || true |