Skip to content

Commit

Permalink
Merge pull request #25 from flatironinstitute/tests
Browse files Browse the repository at this point in the history
New cached functionality to speed up PR testing
  • Loading branch information
geoffwoollard authored Jun 25, 2024
2 parents 18b3cdf + c9d871a commit c92efa5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 24 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,33 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Cache dependencies and test data
id: cache

- name: Cache dependencies
id: cache_deps
uses: actions/cache@v3
with:
path: |
${{ env.pythonLocation }}
key: venv-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml') }}

- name: Cache test data
id: cache_test_data
uses: actions/cache@v3
with:
path: |
~/.cache/pip
tests/data
data
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/tests/scripts/fetch_test_data.sh') }}
restore-keys: |
${{ runner.os }}-pip-
key: venv-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/tests/scripts/fetch_test_data.sh') }}

- name: Install dependencies
if: ${{ steps.cache_deps.outputs.cache-hit != 'true' }}
run: |
python -m pip install --upgrade pip
pip install .
pip install pytest omegaconf
- name: Get test data from OSF
if: steps.cache.outputs.cache-hit != 'true'
if: ${{ steps.cache_test_data.outputs.cache-hit != 'true' }}
run: |
sh tests/scripts/fetch_test_data.sh
Expand Down
32 changes: 16 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,29 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"torch",
"numpy",
"natsort",
"pandas",
"dataclasses_json",
"mrcfile",
"scipy",
"cvxpy",
"POT",
"aspire",
"jupyter",
"osfclient",
"seaborn",
"ipyfilechooser",
"torch<=2.3.1",
"numpy<=2.0.0",
"natsort<=8.4.0",
"pandas<=2.2.2",
"dataclasses_json<=0.6.7",
"mrcfile<=1.5.0",
"scipy<=1.13.1",
"cvxpy<=1.5.2",
"POT<=0.9.3",
"aspire<=0.12.2",
"jupyter<=1.0.0",
"osfclient<=0.0.5",
"seaborn<=0.13.2",
"ipyfilechooser<=0.6.0",
]

[project.optional-dependencies]
dev = [
"pytest",
"pytest<=8.2.2",
"mypy",
"pre-commit",
"ruff",
"omegaconf"
"omegaconf<=2.3.0"
]

[project.urls]
Expand Down

0 comments on commit c92efa5

Please sign in to comment.