-
-
Notifications
You must be signed in to change notification settings - Fork 4
74 lines (61 loc) · 2.2 KB
/
pip.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: pip
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.10']
os: [ubuntu-latest]
pytest: ['"pytest<8.0"']
# pip cache paths
include:
- os: ubuntu-latest
path: ~/.cache/pip
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# use pip caching
- uses: actions/cache@v2
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# Install dependencies
- name: Install
run: |
python -m pip install numpy scipy matplotlib ${{matrix.pytest}}
python -m pip install -e .
- name: Self-test
run: |
pytest --pyargs scpdt -v -s
- name: Self-test CLI
run: |
python -m scpdt scpdt/tests/finder_cases.py -vv
- name: Test testfile CLI
run: |
python -m scpdt ./scpdt/tests/scipy_linalg_tutorial_clone.rst -v
- name: Run testmod a scipy submodule
run: |
python -c'from scipy.linalg import _basic; from scpdt import testmod; testmod(_basic, verbose=True)'
- name: Run testmod a scipy submodule -- Public API onlly
run: |
python -mpip install pooch
python -c'from scipy import ndimage; from scpdt import testmod; testmod(ndimage, verbose=True, strategy="api")'
- name: Test pytest plugin
# This test will fail in a venv where scpdt has not been installed and the plugin has not been activated
run: |
test_files=("scpdt/tests/module_cases.py" "scpdt/tests/stopwords_cases.py" "scpdt/tests/local_file_cases.py")
for file in "${test_files[@]}"; do
python -m pytest "${file}" --doctest-modules
done