Skip to content

Commit

Permalink
docs and automation
Browse files Browse the repository at this point in the history
  • Loading branch information
dnil committed Nov 22, 2024
1 parent 62ead5e commit 73e5436
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 29 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,23 @@ jobs:
- name: Check out git repository
uses: actions/checkout@v4

- name: Set up Python 3.12
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
python-version-file: ".python_version"

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Install the project
run: uv sync --all-extras --dev

- name: Run tests
# For example, using `pytest`
run: uv run pytest tests

- name: Install build tools
run: >-
Expand Down
40 changes: 16 additions & 24 deletions .github/workflows/tests_and_cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,22 @@ jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check out git repository
uses: actions/checkout@v4

- name: Set up Python 3.11
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version-file: ".python_version"

# Cache package installation step to speed up the following step
- uses: actions/cache@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} }}
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Install deps
run: |
pip install --upgrade --upgrade-strategy eager -e .
pip check
- name: Install the project
run: uv sync --all-extras --dev

test:
needs: setup
Expand All @@ -38,24 +37,17 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"

# Cache package installation step to speed up the following step
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}


- name: Install pytest
run: pip install pytest pytest-cov

- name: Run pytest
run: pytest --cov --rootdir=/home/runner/work/stranger
run: uv run pytest tests --cov --rootdir=/home/runner/work/stranger

- name: Upload coverage
uses: actions/upload-artifact@v4
Expand All @@ -69,10 +61,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version-file: ".python_version"
- name: Install deps
run: |
python -m pip install --upgrade pip
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ Annotates output files from [ExpansionHunter][hunter] and [TRGT][trgt] with the

## Installation

Stranger uses the `uv` project manager. It is very quick and lightweight - see the [uv installation instructions](https://docs.astral.sh/uv/getting-started/installation/).

```
git clone github.com/clinical-genomics/stranger
cd stranger
pip install --editable .
uv pip install --editable .
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "stranger"
version = "0.9.2"
description = "Annotate VCF files with STR variants with pathogenicity implications"
authors = [{name="Daniel Nilsson", email="[email protected]"}, {name="Mans Magnuson", email="[email protected]"}]
license = "MIT"
license = {text = "MIT License"}
readme = "README.md"
include = [
"README.md",
Expand Down
6 changes: 5 additions & 1 deletion stranger/resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from importlib_resources import files
try:
from importlib.resources import files
except ImportError:
# Try backported to piPY<37 `importlib_resources`.
from importlib_resources import files

###### Files ######

Expand Down

0 comments on commit 73e5436

Please sign in to comment.