Skip to content

Commit 8e053e6

Browse files
authored
add CI (GH actions) (#14)
* add CI (GH actions) * use requirements.txt as spec in setup.py * omit py39 for now
1 parent 92e000f commit 8e053e6

File tree

3 files changed

+60
-8
lines changed

3 files changed

+60
-8
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
name: ${{ matrix.name }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
include:
18+
- name: Linux py36
19+
os: ubuntu-16.04
20+
pyversion: '3.6'
21+
- name: Linux py37
22+
os: ubuntu-latest
23+
pyversion: '3.7'
24+
- name: Linux py38
25+
os: ubuntu-latest
26+
pyversion: '3.8'
27+
# - name: Linux py39
28+
# os: ubuntu-latest
29+
# pyversion: '3.9'
30+
- name: MacOS py38
31+
os: macos-latest
32+
pyversion: '3.8'
33+
- name: Windows py38
34+
os: windows-latest
35+
pyversion: '3.8'
36+
37+
steps:
38+
- uses: actions/checkout@v2
39+
- name: Set up Python ${{ matrix.pyversion }}
40+
uses: actions/setup-python@v2
41+
with:
42+
python-version: ${{ matrix.pyversion }}
43+
- name: Install dependencies
44+
run: |
45+
python -m pip install --upgrade pip
46+
pip install -U -r requirements.txt
47+
pip install -q -U black flake8 pytest
48+
- name: Lint (black and flake8)
49+
run: |
50+
black --check .
51+
flake8 .
52+
- name: Test with pytest
53+
shell: bash
54+
run: |
55+
python setup.py install
56+
rm -rf ./dash_slicer ./build ./egg-info
57+
pytest -v .

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ numpy
33
plotly
44
dash
55
dash_core_components
6+
scikit-image

setup.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,8 @@
1111
VERSION = re.search(r"__version__ = \"(.*?)\"", fh.read()).group(1)
1212

1313

14-
runtime_deps = [
15-
"pillow",
16-
"numpy",
17-
"plotly",
18-
"dash",
19-
"dash_core_components",
20-
"scikit-image", # may not be needed eventually?
21-
]
14+
with open("requirements.txt") as fh:
15+
runtime_deps = [x.strip() for x in fh.read().splitlines() if x.strip()]
2216

2317

2418
setup(

0 commit comments

Comments
 (0)