Skip to content

Commit

Permalink
CI: minimize storage usage (#1658)
Browse files Browse the repository at this point in the history
* CI: minimize storage usage

* Ignore warning in Python 3.9

* newer pytest required

* bump pytest-cov too
  • Loading branch information
adamjstewart authored Oct 13, 2023
1 parent 7a793f3 commit 27be503
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 18 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ jobs:
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[tests]
run: |
pip install .[tests]
pip cache purge
- name: List pip dependencies
run: pip list
- name: Run pytest checks
Expand All @@ -51,7 +53,9 @@ jobs:
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[datasets,tests]
run: |
pip install .[datasets,tests]
pip cache purge
- name: List pip dependencies
run: pip list
- name: Run integration checks
Expand All @@ -77,7 +81,9 @@ jobs:
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[docs,tests] planetary_computer pystac
run: |
pip install .[docs,tests] planetary_computer pystac
pip cache purge
- name: List pip dependencies
run: pip list
- name: Run notebook checks
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ jobs:
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/style.txt') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements/style.txt
run: |
pip install -r requirements/style.txt
pip cache purge
- name: List pip dependencies
run: pip list
- name: Run black checks
Expand All @@ -50,7 +52,9 @@ jobs:
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/style.txt') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements/style.txt
run: |
pip install -r requirements/style.txt
pip cache purge
- name: List pip dependencies
run: pip list
- name: Run flake8 checks
Expand All @@ -73,7 +77,9 @@ jobs:
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/style.txt') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements/style.txt
run: |
pip install -r requirements/style.txt
pip cache purge
- name: List pip dependencies
run: pip list
- name: Run isort checks
Expand All @@ -96,7 +102,9 @@ jobs:
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/style.txt') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements/style.txt
run: |
pip install -r requirements/style.txt
pip cache purge
- name: List pip dependencies
run: pip list
- name: Run pydocstyle checks
Expand All @@ -119,7 +127,9 @@ jobs:
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/style.txt') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements/style.txt
run: |
pip install -r requirements/style.txt
pip cache purge
- name: List pip dependencies
run: pip list
- name: Run pyupgrade checks
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ jobs:
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/required.txt') }}-${{ hashFiles('requirements/datasets.txt') }}-${{ hashFiles('requirements/tests.txt') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements/required.txt -r requirements/datasets.txt -r requirements/tests.txt
run: |
pip install -r requirements/required.txt -r requirements/datasets.txt -r requirements/tests.txt
pip cache purge
- name: List pip dependencies
run: pip list
- name: Run mypy checks
Expand Down Expand Up @@ -70,7 +72,9 @@ jobs:
if: ${{ runner.os == 'Windows' }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements/required.txt -r requirements/datasets.txt -r requirements/tests.txt
run: |
pip install -r requirements/required.txt -r requirements/datasets.txt -r requirements/tests.txt
pip cache purge
- name: List pip dependencies
run: pip list
- name: Run pytest checks
Expand Down Expand Up @@ -107,7 +111,9 @@ jobs:
sudo apt-get install unrar
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements/min-reqs.old -c requirements/min-cons.old
run: |
pip install -r requirements/min-reqs.old -c requirements/min-cons.old
pip cache purge
- name: List pip dependencies
run: pip list
- name: Run pytest checks
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/tutorials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[docs,tests] planetary_computer pystac
run: |
pip install .[docs,tests] planetary_computer pystac
pip cache purge
- name: List pip dependencies
run: pip list
- name: Run notebook checks
Expand Down
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ tests = [
"mypy>=0.900",
# nbmake 1.3.3+ required for variable mocking
"nbmake>=1.3.3",
# pytest 6.2+ required for pytest.MonkeyPatch
"pytest>=6.2",
# pytest-cov 2.4+ required for pytest --cov flags
"pytest-cov>=2.4",
# pytest 7.3+ required for tmp_path_retention_policy
"pytest>=7.3",
# pytest-cov 4+ required for pytest 7.2+ compatibility
"pytest-cov>=4",
]
all = [
"torchgeo[datasets,docs,style,tests]",
Expand Down Expand Up @@ -276,6 +276,7 @@ testpaths = [
"tests",
"docs/tutorials",
]
tmp_path_retention_policy = "failed"

# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
[tool.setuptools.dynamic]
Expand Down
4 changes: 2 additions & 2 deletions requirements/min-reqs.old
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ pyupgrade==2.8.0
# tests
mypy==0.900
nbmake==1.3.3
pytest==6.2.0
pytest-cov==2.4.0
pytest==7.3.0
pytest-cov==4.0.0

0 comments on commit 27be503

Please sign in to comment.