Skip to content

Commit 549c814

Browse files
committed
Add github actions.
1 parent 3d85245 commit 549c814

3 files changed

Lines changed: 51 additions & 3 deletions

File tree

.github/workflows/python.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: pydevtips
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
fail-fast: false
11+
max-parallel: 12
12+
matrix:
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
python-version: [3.8, 3.9, 3.10]
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Checkout submodules
18+
shell: bash
19+
run: |
20+
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
21+
git submodule sync --recursive
22+
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies and build package
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install -e .
31+
- name: Lint with flake8
32+
run: |
33+
pip install flake8
34+
# stop the build if there are Python syntax errors or undefined names
35+
flake8 . --count --select=B,C,E,F,W,T4,B9 --show-source --statistics --max-complexity=18 --max-line-length=100 --ignore=E203,E266,E501,W503,F403,F401,C901
36+
- name: Format with black
37+
run: |
38+
pip install black
39+
black *.py -l 100
40+
black examples/*.py -l 100
41+
black profile/*.py -l 100
42+
black pydevtips/*.py -l 100
43+
black tests/*.py -l 100
44+
- name: Test with pytest
45+
run: |
46+
pip install -U pytest
47+
pytest

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ This is done through `twine <https://pypi.org/project/twine/>`__:
110110
TODO
111111
====
112112

113-
- matplotlib in dev install
113+
- matplotlib, pytest, black in dev install
114114
- example file with hydra
115115
- manifest file to not include file in package
116-
- GitHub actions
116+
- GitHub actions for formating and unit tests
117+
- GitHub actions for releasing to PyPi
117118
- documentation if time

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"Programming Language :: Python :: 3",
1818
"Operating System :: OS Independent",
1919
],
20-
python_requires=">=3.9",
20+
python_requires=">=3.8",
2121
install_requires=[
2222
"numpy",
2323
"matplotlib",

0 commit comments

Comments
 (0)