Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/manual-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ on: workflow_dispatch
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.9]
python-version: [3.8, 3.9]

steps:
- name: Send building notification
Expand All @@ -34,10 +34,12 @@ jobs:
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 test/ notecard/ examples/ --count --ignore=E722,F401,F403,W503 --show-source --statistics
make flake8
# flake8 test/ notecard/ examples/ --count --ignore=E722,F401,F403,W503,E501 --show-source --statistics
- name: Lint Docs with Pydocstyle
run: |
pydocstyle notecard/ examples/
make docstyle
# pydocstyle notecard/ examples/
- name: Send running tests notification
run: |
curl --request POST \
Expand All @@ -47,7 +49,7 @@ jobs:
--data '{"req":"note.add","file":"build_results.qi","body":{"result":"running_tests"}}'
- name: Test with pytest
run: |
pytest
make test
- name: Check if the job has succeeded
if: ${{ success() }}
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
Expand All @@ -38,10 +38,10 @@ jobs:
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 test/ notecard/ examples/ --count --ignore=E722,F401,F403,W503 --show-source --statistics
make flake8
- name: Lint Docs with Pydocstyle
run: |
pydocstyle notecard/ examples/
make docstyle
- name: Send running tests notification
run: |
curl --request POST \
Expand Down
35 changes: 27 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
# define VENV_NAME to use a specific virtual environment. It defaults to `env`.
VENV_NAME?=env
VENV_ACTIVATE=. $(VENV_NAME)/bin/activate
PYTHON=${VENV_NAME}/bin/python3
PYTHON=python
VENV =

default: test
# check if the VENV file exists
ifneq ("$(wildcard $(PVENV_ACTIVATE))","")
VENV = venv
PYTHON = ${VENV_NAME}/bin/python3
endif

default: docstyle flake8 test

venv: $(VENV_NAME)/bin/activate

test: venv
${PYTHON} -m pydocstyle notecard/ examples/
${PYTHON} -m flake8 test/ notecard/ examples/ --count --ignore=E722,F401,F403,W503 --show-source --statistics
test: $(VENV)
${PYTHON} -m pytest test --cov=notecard

coverage: venv
docstyle: $(VENV)
${PYTHON} -m pydocstyle notecard/ examples/

flake8: $(VENV)
# E722 Do not use bare except, specify exception instead https://www.flake8rules.com/rules/E722.html
# F401 Module imported but unused https://www.flake8rules.com/rules/F401.html
# F403 'from module import *' used; unable to detect undefined names https://www.flake8rules.com/rules/F403.html
# W503 Line break occurred before a binary operator https://www.flake8rules.com/rules/W503.html
# E501 Line too long (>79 characters) https://www.flake8rules.com/rules/E501.html
${PYTHON} -m flake8 test/ notecard/ examples/ --count --ignore=E722,F401,F403,W503,E501 --show-source --statistics

coverage: $(VENV)
${PYTHON} -m pytest test --doctest-modules --junitxml=junit/test-results.xml --cov=notecard --cov-report=xml --cov-report=html

run_build:
run_build: $(VENV)
${PYTHON} -m setup sdist bdist_wheel

deploy:
deploy: $(VENV)
${PYTHON} -m twine upload -r "pypi" --config-file .pypirc 'dist/*'

.PHONY: venv test coverage run_build deploy
Loading