Skip to content

Commit

Permalink
Merge ab72c20 into e57f5aa
Browse files Browse the repository at this point in the history
  • Loading branch information
fphammerle committed Jun 18, 2020
2 parents e57f5aa + ab72c20 commit b439407
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 20 deletions.
36 changes: 26 additions & 10 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# sync with https://github.com/fphammerle/ical2vdir/blob/master/.github/workflows/python.yml

# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions

# shown in badge
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-a-workflow#adding-a-workflow-status-badge-to-your-repository
name: tests
Expand All @@ -11,7 +13,26 @@ on:
- cron: '0 20 * * 5'

jobs:
build:
code-format:
runs-on: ubuntu-18.04
strategy:
matrix:
python-version:
- 3.8
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- run: pip install --upgrade pipenv>=2018.10.9
# TODO exclude dbus-python from pipenv install
- run: sudo apt-get install --yes --no-install-recommends libdbus-1-dev
- run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
env:
PYTHON_VERSION: ${{ matrix.python-version }}
- run: pipenv graph
- run: pipenv run black --check .
tests:
runs-on: ubuntu-18.04
strategy:
matrix:
Expand All @@ -27,20 +48,15 @@ jobs:
python-version: ${{ matrix.python-version }}
- run: pip install --upgrade pipenv>=2018.10.9
- run: sudo apt-get install --yes --no-install-recommends libdbus-1-dev
- run: pipenv install --deploy --dev
# ModuleNotFoundError: No module named 'importlib_metadata'
# https://github.com/WanzenBug/pylint-import-requirements/issues/17
- run: if python3 -c 'import sys; sys.exit(sys.version_info < (3, 8))'; then
pipenv graph;
pipenv install --dev importlib-metadata;
fi
- run: pipenv install --python "$PYTHON_VERSION" --deploy --dev
env:
PYTHON_VERSION: ${{ matrix.python-version }}
- run: pipenv graph
- run: pipenv run pytest --cov=systemctl_mqtt --cov-report=term-missing --cov-fail-under=100
- run: pipenv run pylint --load-plugins=pylint_import_requirements systemctl_mqtt
# https://github.com/PyCQA/pylint/issues/352
- run: pipenv run pylint tests/*
- run: pipenv run mypy systemctl_mqtt tests
- run: pipenv run pytest --cov=systemctl_mqtt --cov-report=term-missing --cov-fail-under=100
- run: pipenv run black --check .
# >=1.9.0 to detect branch name
# https://github.com/coveralls-clients/coveralls-python/pull/207
# https://github.com/coverallsapp/github-action/issues/4#issuecomment-547036866
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.mypy_cache/
build/
dist/
tags
16 changes: 15 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,26 @@ name = "pypi"
systemctl-mqtt = {editable = true,path = "."}

[dev-packages]
black = "==19.10b0"
# black requires python>=3.6
# https://github.com/psf/black/commit/e74117f172e29e8a980e2c9de929ad50d3769150#diff-2eeaed663bd0d25b7e608891384b7298R51
black = {version = "==19.10b0", markers = "python_version >= '3.6'"}
mypy = "*"
pylint = "*"
pylint-import-requirements = "*"
pytest = "*"
pytest-cov = "*"

# python3.5 compatibility
# https://github.com/jaraco/zipp/commit/05a3c52b4d41690e0471a2e283cffb500dc0329a
zipp = "<2"
# workaround https://github.com/pytest-dev/pytest/issues/3953
pathlib2 = {version = "*", markers="python_version < '3.6'"}

# python3.8 compatibility
# workaround https://github.com/WanzenBug/pylint-import-requirements/issues/17
importlib-metadata = "*"
# workaround pipenv unexpectedly adding marker "python_version < '3.8'"
typed-ast = "*"

[requires]
python_version = "3"
29 changes: 20 additions & 9 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b439407

Please sign in to comment.