diff --git a/.github/workflows/continous_integration.yml b/.github/workflows/continous_integration.yml index b8d54f1..e4eece5 100644 --- a/.github/workflows/continous_integration.yml +++ b/.github/workflows/continous_integration.yml @@ -40,13 +40,21 @@ jobs: cache: 'pip' cache-dependency-path: setup.py + - uses: actions/cache@v4 + with: + path: | + ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} + restore-keys: | + ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} + ${{ runner.os }}-pip- + - name: Install dependencies run: | sudo apt-get update sudo apt-get install -y ffmpeg python -m pip install --upgrade pip - pip install pytest pytest-runner pytest-rerunfailures coveralls freezegun - pip install -e . + pip install -e ".[dev]" - name: Run tests run: coverage run -m pytest -v -s diff --git a/pyproject.toml b/pyproject.toml index 04aae2b..da17af2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,8 +55,18 @@ dependencies = [ 'tables', 'regions' ] + dynamic = ["version"] +[project.optional-dependencies] +test = [ + 'pytest', + 'pytest-runner', + 'pytest-rerunfailures', + 'coveralls', + 'freezegun', +] + [project.scripts] gwemopt-run = "gwemopt.run:run"