Skip to content

Commit

Permalink
First try at continuous integration
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelcroquette committed Nov 14, 2024
1 parent b255baa commit 8037f6b
Show file tree
Hide file tree
Showing 11 changed files with 253 additions and 192 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["pypy3.10", "3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- 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
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

# must mock PyQt in order to get autodoc import running
MOCK_MODULES = ['numpy', 'scipy', 'qtpy', 'pyqtgraph', 'pandas',
'asyncio', 'quamash', 'scipy.signal', 'scipy.fftpack',
'asyncio', 'qasync', 'scipy.signal', 'scipy.fftpack',
'paramiko', 'scp']
sys.modules.update((mod_name, MagicMock()) for mod_name in MOCK_MODULES)

Expand Down
12 changes: 6 additions & 6 deletions docs/source/developer_guide/api/asynchronous/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ function). Let's see that on an example:
%pylab qt # in a notebook, we need the qt event loop to run in the background
import asyncio
import scipy.fftpack
import quamash # quamash allows to use the asyncio syntax of python 3 with the Qt event loop. Not sure how mainstream the library is...
import qasync # qasync allows to use the asyncio syntax of python 3 with the Qt event loop. Not sure how mainstream the library is...
from PyQt4 import QtCore, QtGui
import asyncio
loop = quamash.QEventLoop()
loop = qasync.QEventLoop()
asyncio.set_event_loop(loop) # set the qt event loop as the loop to be used by asyncio


Expand Down Expand Up @@ -58,12 +58,12 @@ practice, the code execution is probably extremely similar)
%pylab qt
import asyncio
import scipy.fftpack
import quamash
import qasync
from PyQt4 import QtCore, QtGui
APP = QtGui.QApplication.instance()
import asyncio
from promise import Promise
loop = quamash.QEventLoop()
loop = qasync.QEventLoop()
asyncio.set_event_loop(loop)


Expand Down Expand Up @@ -187,10 +187,10 @@ would easily do the trick:
%pylab qt
import asyncio
import scipy.fftpack
import quamash
import qasync
from PyQt4 import QtCore, QtGui
import asyncio
loop = quamash.QEventLoop()
loop = qasync.QEventLoop()
asyncio.set_event_loop(loop)


Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 8037f6b

Please sign in to comment.