Skip to content

Commit

Permalink
Merge pull request #48 from ms7m/46-pytests
Browse files Browse the repository at this point in the history
Fix test issues + fix #46
  • Loading branch information
ms7m authored Dec 5, 2022
2 parents f748189 + f014c27 commit 5ee3eed
Show file tree
Hide file tree
Showing 9 changed files with 392 additions and 173 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,11 @@ jobs:
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
ignore_dev_requirements: "yes"


- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
LICENSE
notifypy
68 changes: 40 additions & 28 deletions .github/workflows/test_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,64 @@
name: Test Linux

on:
push:
branches:
- dev
- master
paths:
- notifypy/**
- tests/**
- pyproject.toml
- poetry.lock
pull_request:
branches:
- dev
- master
paths:
- notifypy/**
- tests/**
- pyproject.toml
- poetry.lock
# push:
# branches:
# - dev
# - master
# paths:
# - notifypy/**
# - tests/**
# - pyproject.toml
# - poetry.lock
# pull_request:
# branches:
# - dev
# - master
# paths:
# - notifypy/**
# - tests/**
# - pyproject.toml
# - poetry.lock
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: ${{ matrix.python-version }}


- name: Install OS dependencies
run: |
sudo apt-get update
sudo apt-get install libnotify-bin
sudo apt-get install alsa
sudo apt-get install curl
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.2.1"


- name: Install dependencies
run: |
pipx install poetry
poetry install
run: poetry install



- name: Lint with pylint
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run pylint --errors-only notifypy/
- name: Test with pytest (Linux dbus)
run: |
dbus-run-session -- poetry run pytest tests/
- name: Test with pytest (Linux Libnotify)
run: |
pip uninstall jeepney -y
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/test_linux_dbus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Test Linux (dbus)

on:
# push:
# branches:
# - dev
# - master
# paths:
# - notifypy/**
# - tests/**
# - pyproject.toml
# - poetry.lock
# pull_request:
# branches:
# - dev
# - master
# paths:
# - notifypy/**
# - tests/**
# - pyproject.toml
# - poetry.lock
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}


- name: Install OS dependencies
run: |
sudo apt-get update
sudo apt-get install libnotify-bin
sudo apt-get install alsa
sudo apt-get install curl
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.2.1"

- name: Install dependencies
run: poetry install

- name: Lint with pylint
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run pylint --errors-only notifypy/
- name: Test with pytest (Linux dbus)
run: |
dbus-run-session -- poetry run pytest tests/
- name: Test with pytest (Linux Libnotify)
run: |
poetry run pytest tests/
- name: Test building package
run: |
poetry build
26 changes: 19 additions & 7 deletions .github/workflows/test_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,33 @@ on:
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.2.1"


- name: Install dependencies
run: |
pipx install poetry
poetry install
run: poetry install


- name: Lint with pylint
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run pylint --errors-only notifypy/
- name: Test with pytest
run: |
pip install pytest
Expand Down
23 changes: 18 additions & 5 deletions .github/workflows/test_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,37 @@ on:
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.2.1"


- name: Install dependencies
run: |
pipx install poetry
poetry install
- name: Lint with pylint
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run pylint --errors-only notifypy/
- name: Test with pytest
run: |
poetry run pytest tests/
- name: Test building package
run: |
poetry build
2 changes: 1 addition & 1 deletion notifypy/os_notifiers/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


class LinuxNotifierLibNotify(BaseNotifier):
def __init__(self):
def __init__(self, **kwargs):
"""Main Linux Notification Class
This uses libnotify's tool of notfiy-send.
Expand Down
2 changes: 1 addition & 1 deletion notifypy/os_notifiers/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class WindowsNotifier(BaseNotifier):
def __init__(self):
def __init__(self, **kwargs):
"""Main Notification System for Windows. Basically ported from go-toast/toast"""

# Create the base
Expand Down
Loading

0 comments on commit 5ee3eed

Please sign in to comment.