-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (53 loc) · 2.17 KB
/
pytest-py38-mindeps.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
name: pytest-py38-mindeps
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8.14' #used at HMC
- name: Set fixed versions in requirements.txt extracted from pyproject.toml
run: |
python -m pip install --upgrade pip
python -m pip install "toml-to-requirements==0.1.0" # highest version available to py38
toml-to-req --toml-file pyproject.toml --include-optional # --optional-lists dev # commented arg is available from toml-to-requirements 0.2.0, but that version is not available for py38.
sed -i -E 's/>=/==/' requirements.txt
# temporarily removing all non-dev optional requirements manually, can be done more cleanly with toml-to-req>=0.2.0
sed -i '/^sphinx/d' requirements.txt
sed -i '/^nbsphinx/d' requirements.txt
sed -i '/^pydata-sphinx-theme/d' requirements.txt
sed -i '/^jupyter/d' requirements.txt
sed -i '/^notebook/d' requirements.txt
- name: Print contents of requirements.txt
run: |
# print file contents
cat requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
# also install the package itself to enable subprocess to work properly (for cli)
python -m pip install -e .
- name: list env contents
run: |
conda info
conda list
pip list
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest -m "not acceptance" --cov=hatyan --cov-report xml --cov-report term