Skip to content

Commit aa8e9b5

Browse files
authored
Merge pull request #47 from YosefLab/workflow
Update test.yml and readthedocs.yml
2 parents 351826c + e46bf55 commit aa8e9b5

File tree

4 files changed

+56
-35
lines changed

4 files changed

+56
-35
lines changed

.github/workflows/test.yml

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
41
name: hotspot
52

63
on:
@@ -9,30 +6,50 @@ on:
96
pull_request:
107
branches: [master]
118

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
1213
jobs:
13-
build:
14-
runs-on: ubuntu-latest
15-
timeout-minutes: 20
14+
test:
15+
runs-on: ${{ matrix.os }}
16+
defaults:
17+
run:
18+
shell: bash -e {0} # -e to fail on error
19+
1620
strategy:
21+
fail-fast: false
1722
matrix:
18-
python-version: [3.7, 3.8, 3.9]
23+
os: [ubuntu-latest]
24+
python: ["3.10", "3.11", "3.12"]
25+
26+
name: Integration
27+
28+
env:
29+
OS: ${{ matrix.os }}
30+
PYTHON: ${{ matrix.python }}
1931

2032
steps:
21-
- uses: actions/checkout@v2
22-
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v2
24-
with:
25-
python-version: ${{ matrix.python-version }}
26-
- name: Cache pip
27-
uses: actions/cache@v2
28-
with:
29-
path: ~/.cache/pip
30-
key: ${{ runner.os }}-pip-v1-${{ hashFiles('**/requirements.txt') }}
31-
restore-keys: |
32-
${{ runner.os }}-pip-v1-
33-
- name: Install dependencies
34-
run: |
35-
pip install .[test]
36-
- name: Test with pytest
37-
run: |
38-
pytest
33+
- uses: actions/checkout@v4
34+
- name: Set up Python ${{ matrix.python }}
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: ${{ matrix.python }}
38+
cache: "pip"
39+
cache-dependency-path: "**/pyproject.toml"
40+
41+
- name: Install test dependencies
42+
run: |
43+
python -m pip install --upgrade pip wheel
44+
45+
- name: Install dependencies
46+
run: |
47+
pip install ".[test]"
48+
49+
- name: Test
50+
env:
51+
MPLBACKEND: agg
52+
PLATFORM: ${{ matrix.os }}
53+
DISPLAY: :42
54+
run: |
55+
pytest -v --color=yes

.readthedocs.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
# https://docs.readthedocs.io/en/stable/config-file/v2.html
12
version: 2
23
build:
3-
image: latest
4+
os: ubuntu-20.04
5+
tools:
6+
python: "3.11"
47
sphinx:
58
configuration: docs/source/conf.py
9+
# disable this for more lenient docs builds
10+
fail_on_warning: false
611
python:
7-
version: 3.8
812
install:
9-
- method: pip
10-
path: .
11-
extra_requirements:
12-
- docs
13+
- method: pip
14+
path: .
15+
extra_requirements:
16+
- docs

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
'sphinx.ext.viewcode',
4545
'sphinx.ext.githubpages',
4646
'sphinx.ext.napoleon',
47-
'nbsphinx',
47+
'myst_nb',
4848
]
4949

5050
#autodoc settings
@@ -64,6 +64,7 @@
6464
napoleon_use_ivar = False
6565
napoleon_use_param = True
6666
napoleon_use_rtype = True
67+
nb_execution_mode = "off"
6768

6869
# Add any paths that contain templates here, relative to this directory.
6970
templates_path = ['_templates']
@@ -90,7 +91,6 @@
9091

9192
# nbsphinx specific settings
9293
exclude_patterns = ["_build", "**.ipynb_checkpoints"]
93-
nbsphinx_execute = "never"
9494

9595

9696
# -- Options for HTML output -------------------------------------------------

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ python = ">=3.7,<4.0"
4747
pynndescent = ">=0.5"
4848
anndata = ">=0.7"
4949
sphinx-book-theme = {version= ">=0.2.0", optional = true}
50-
nbsphinx = {version = "*", optional = true}
50+
myst-nb = {version = "*", optional = true}
5151
sphinx = {version = ">=4.1", optional = true}
5252
ipython = {version = "*", optional = true}
5353
scanpy = {version = "*", optional = true}
5454

5555

5656
[tool.poetry.extras]
5757
test = ["pytest", "scanpy"]
58-
docs=["sphinx-book-theme", "nbsphinx", "sphinx", "ipython"]
58+
docs=["sphinx-book-theme", "myst-nb", "sphinx", "ipython"]
5959

6060
[tool.poetry.dev-dependencies]
6161

0 commit comments

Comments
 (0)