Skip to content

Commit

Permalink
Merge pull request #137 from jpgill86/github-actions
Browse files Browse the repository at this point in the history
Add minimal GitHub Actions workflow for testing installation, importing the package, and building the docs
  • Loading branch information
jpgill86 committed Jan 20, 2021
2 parents 28e37da + 889ae00 commit 32e5c61
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 11 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: tests

on: [push, pull_request]

jobs:
test-docs:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Checkout repository
uses: actions/checkout@v2

- name: Install package from repository with docs dependencies
run: |
pip install -e .[docs]
- name: List pip packages
run: |
pip -V
pip list
- name: Build docs
run: |
cd doc
make html
test-linux:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.5', '3.6', '3.7', '3.8', '3.9']
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Checkout repository
uses: actions/checkout@v2

- name: Install package from repository
run: |
pip install -e .
- name: Install other required dependencies
run: |
pip install PyQt5
- name: List pip packages
run: |
pip -V
pip list
- name: Test imports
run: |
python -c "import ephyviewer"
python -c "import ephyviewer.datasource"
python -c "import ephyviewer.icons"
python -c "import ephyviewer.tests"
2 changes: 1 addition & 1 deletion doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Installation
============

Requirements:
* Python ≥ 3.4
* Python ≥ 3.5
* numpy
* scipy
* matplotlib ≥ 2.0
Expand Down
2 changes: 1 addition & 1 deletion ephyviewer/datasource/epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, epoch=None, possible_labels=[], color_labels=None, channel_na
# add labels missing from possible_labels but found in epoch data
new_labels_from_data = list(set(epoch['label'])-set(self.possible_labels))
if restrict_to_possible_labels:
assert len(new_labels_from_data)==0, f'epoch data contains labels not found in possible_labels: {new_labels_from_data}'
assert len(new_labels_from_data)==0, 'epoch data contains labels not found in possible_labels: ' + str(new_labels_from_data)
self.possible_labels += new_labels_from_data

# put the epochs into a canonical order after loading
Expand Down
3 changes: 3 additions & 0 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# these restricted versions are defaults on ReadTheDocs, so use the same in
# local builds and in tests
sphinx<2
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
matplotlib>=2.0
numpy
pyqtgraph>=0.10.0
scipy
16 changes: 7 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
import os


install_requires = [
'numpy',
#~ 'PyQt5',
'pyqtgraph>=0.10.0',
'matplotlib>=2.0',
'scipy',
]

# Read in the README to serve as the long_description, which will be presented
# on pypi.org as the project description.
with open('README.rst', 'r') as f:
Expand All @@ -20,15 +12,21 @@
exec(f.read(), None, d)
version = d['version']

with open('requirements.txt', 'r') as f:
install_requires = f.read()

entry_points={'console_scripts': ['ephyviewer=ephyviewer.scripts:launch_standalone_ephyviewer']}
extras_require = {}
with open('requirements-docs.txt', 'r') as f:
extras_require['docs'] = f.read()

entry_points={'console_scripts': ['ephyviewer=ephyviewer.scripts:launch_standalone_ephyviewer']}

setup(
name = 'ephyviewer',
version = version,
packages = find_packages(),
install_requires = install_requires,
extras_require = extras_require,
author = 'S.Garcia, Jeffrey Gill',
author_email = '', # left blank because multiple emails cannot be provided
description = 'Simple viewers for ephys signals, events, video and more',
Expand Down

0 comments on commit 32e5c61

Please sign in to comment.