Skip to content

Commit

Permalink
add latest_dependencies.py and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamOrmondroyd committed Sep 24, 2023
1 parent 108d77c commit b7daa56
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,25 @@ jobs:

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

latest-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tomli
eval "python -m pip install $(./bin/min_dependencies.py)"
python -m pip install -e ".[test]"
- name: Test with pytest
run: python -m pytest --cov=anesthetic tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
17 changes: 17 additions & 0 deletions bin/latest_dependencies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python
import tomli

with open("pyproject.toml", 'rb') as f:
pyproject = tomli.load(f)

deps = pyproject["project"]["dependencies"]
deps = [dep.partition("==")[0] for dep in deps]
deps = [dep.partition(">=")[0] for dep in deps]
deps = [dep.partition("<=")[0] for dep in deps]
deps = [dep.partition(">")[0] for dep in deps]
deps = [dep.partition("<")[0] for dep in deps]
deps = [dep.partition("~=")[0] for dep in deps]
deps = [dep.partition("^=")[0] for dep in deps]
deps = [f'"{dep}"' for dep in deps]

print(' '.join(deps))

0 comments on commit b7daa56

Please sign in to comment.