Skip to content

Commit 4aadb31

Browse files
authored
Merge pull request #3 from sappelhoff/egg
Full overhaul: eeg_positions 2.0
2 parents 04b2449 + a6fd97b commit 4aadb31

48 files changed

Lines changed: 2802 additions & 516 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/python_build-test.yml renamed to .github/workflows/python_build-test-deploy.yml

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Python build and tests
1+
name: Python build and test and deploy
22

33
on:
44
push:
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Python
2020
uses: actions/setup-python@v1
2121
with:
22-
python-version: 3.6
22+
python-version: 3.7
2323

2424
- name: Update pip, setuptools, and wheel
2525
run: python -m pip install --upgrade pip setuptools wheel
@@ -53,9 +53,10 @@ jobs:
5353
fail-fast: false
5454
matrix:
5555
platform: [ubuntu-latest, macos-latest, windows-latest]
56-
python-version: [3.6]
56+
python-version: [3.7]
5757

5858
runs-on: ${{ matrix.platform }}
59+
needs: [build]
5960

6061
steps:
6162
- uses: actions/checkout@v2
@@ -67,21 +68,55 @@ jobs:
6768

6869
- name: Install dependencies
6970
run: |
70-
python -m pip install --upgrade pip
71-
pip install -e .[test]
71+
make inplace
7272
7373
- name: Check formatting
7474
if: "matrix.platform == 'ubuntu-latest'"
7575
run: |
76-
flake8 --docstring-convention numpy .
77-
check-manifest .
76+
make flake
77+
make check-manifest
7878
7979
- name: Test with pytest
8080
run: |
81-
pytest --doctest-modules --cov=eeg_positions/ --cov-report=xml --cov-config=setup.cfg --verbose -s
81+
make test
8282
8383
- name: Upload coverage report
8484
if: "matrix.platform == 'ubuntu-latest'"
8585
uses: codecov/codecov-action@v1
8686
with:
8787
file: ./coverage.xml
88+
89+
- name: build docs
90+
if: "matrix.platform == 'ubuntu-latest'"
91+
run: |
92+
make build-doc
93+
94+
- name: Upload docs build artifacts
95+
if: "matrix.platform == 'ubuntu-latest'"
96+
uses: actions/upload-artifact@v2
97+
with:
98+
name: docs-artifact
99+
path: docs/_build/html
100+
101+
deploy:
102+
103+
runs-on: ubuntu-latest
104+
needs: [build, test]
105+
if: github.ref == 'refs/heads/master' # only run on master
106+
107+
steps:
108+
- uses: actions/checkout@v2
109+
110+
- name: Download docsbuild artifacts
111+
uses: actions/download-artifact@v2
112+
with:
113+
name: docs-artifact
114+
path: docs/_build/html
115+
116+
- name: Deploy
117+
uses: JamesIves/[email protected]
118+
with:
119+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120+
BRANCH: gh-pages # The branch the action should deploy to.
121+
FOLDER: docs/_build/html # The folder the action should deploy.
122+
CLEAN: true # Automatically remove deleted files from the deploy branch
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflows will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
deploy:
12+
13+
runs-on: ubuntu-latest
14+
15+
env:
16+
TZ: Europe/Berlin
17+
FORCE_COLOR: true
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up Python
21+
uses: actions/setup-python@v1
22+
with:
23+
python-version: 3.8
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install --upgrade setuptools wheel twine
28+
- name: Build and publish
29+
env:
30+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
31+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
32+
run: |
33+
python setup.py sdist bdist_wheel
34+
twine upload dist/*

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
docs/auto_examples
2+
docs/generated
3+
.vscode
4+
15
# Byte-compiled / optimized / DLL files
26
__pycache__/
37
*.py[cod]

.zenodo.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
],
1111
"license": "BSD-3-Clause",
1212
"upload_type": "software",
13+
"access_right": "open",
14+
"language": "eng",
1315
"creators": [
1416
{
1517
"name": "Appelhoff, Stefan",

MANIFEST.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ include MANIFEST.in
22
include README.md
33
include LICENSE
44
include .zenodo.json
5+
include Makefile
56

67
graft eeg_positions
8+
graft examples
79
graft data
10+
graft docs
811

912
### Exclude
1013

@@ -13,6 +16,9 @@ global-exclude __pycache__
1316

1417
recursive-exclude .github *
1518
recursive-exclude images *.png
19+
recursive-exclude docs/_build *
20+
recursive-exclude docs/generated *
21+
recursive-exclude docs/auto_examples *
1622

1723
exclude .gitignore
1824
exclude .coveragerc

Makefile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
.PHONY: all clean inplace test isort black format flake check-manifest pep build-doc conda
2+
3+
all: clean inplace pep test build-doc
4+
5+
inplace:
6+
python -m pip install --upgrade pip
7+
python -m pip install --editable ".[dev]" --no-cache-dir
8+
9+
clean:
10+
find . -type d -name 'eeg_positions.egg-info' -exec rm -rf {} +;
11+
find . -type d -name 'dist' -exec rm -rf {} +;
12+
find . -type d -name 'build' -exec rm -rf {} +;
13+
find . -type d -name '__pycache__' -exec rm -rf {} +;
14+
find . -type d -name '.pytest_cache' -exec rm -rf {} +;
15+
find . -type f -name 'coverage.xml' -exec rm -rf {} +;
16+
find . -type f -name '.coverage' -exec rm -rf {} +;
17+
18+
test:
19+
pytest --doctest-modules --doctest-ignore-import-errors --cov=eeg_positions/ --cov-report=xml --cov-config=setup.cfg --verbose -s
20+
21+
isort:
22+
isort eeg_positions
23+
isort examples
24+
isort docs/conf.py
25+
26+
black:
27+
black eeg_positions
28+
black examples
29+
black docs/conf.py
30+
31+
format: isort black
32+
33+
flake:
34+
flake8 --docstring-convention numpy eeg_positions
35+
flake8 --docstring-convention numpy examples
36+
37+
check-manifest:
38+
check-manifest .
39+
40+
pep: flake check-manifest
41+
42+
build-doc:
43+
rm -rf docs/auto_examples
44+
rm -rf docs/generated
45+
cd docs; make clean
46+
cd docs; make html
47+
cd docs; make view
48+
49+
conda:
50+
conda env remove -n eegpos
51+
conda create --yes -n eegpos Python=3.8

0 commit comments

Comments
 (0)