Skip to content

Commit

Permalink
Update setuptools configuration
Browse files Browse the repository at this point in the history
Add Github Actions workflows for automated deployment
  • Loading branch information
dmitri-mcguckin committed Dec 19, 2021
1 parent 8311667 commit d9bda09
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 10 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy to PyPi

on:
release:
types: published

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Update Pip
run: python3 -m pip install --upgrade pip

- name: Install regular and dev dependencies
run: pip install .[dev]

- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
33 changes: 33 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Unit Tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Update Pip
run: python3 -m pip install --upgrade pip

- name: Install regular and dev dependencies
run: pip install .[dev]

- name: Lint with flake8
run: |
flake8 webcamd --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 webcamd --count --exit-zero --max-complexity=30 --max-line-length=127 --statistics
- name: Run unit tests
run: python3 -m unittest tests/spec_*.py
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
long_description_content_type='text/markdown',
url=wd.APP_URL,
project_urls={
'Documentation': 'https://github.com/christopherkobayashi/octoprint-stuff',
'Bug Tracking': 'https://github.com/christopherkobayashi/octoprint-stuff/issues'
'Documentation': 'https://github.com/dmitri-mcguckin/webcamd/blob/main/README.md',
'Bug Tracking': 'https://github.com/dmitri-mcguckin/webcamd/issues'
},
packages=setuptools.find_packages(),
include_package_data=True,
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
Expand Down
Empty file added tests/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions tests/spec_webcamd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import unittest

class TestWebcamD(unittest.TestCase):
def test_hello_world(self):
assert True
4 changes: 2 additions & 2 deletions webcamd.service
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=Webcam Daemon. A minimalist webcam streaming service.
Description=A minimalist service for streaming a webcam over HLS
After=network.online.target
Wants=network.online.target

Expand All @@ -8,7 +8,7 @@ Type=simple
User=octoprint
Group=octoprint
ExecStart=/usr/bin/webcamd
ExecStop=killall -u webcam webcamd
ExecStop=killall -u octoprint webcamd

[Install]
WantedBy=multi-user.target
12 changes: 6 additions & 6 deletions webcamd/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
MAJOR = 0
MAJOR = 1
MINOR = 0
PATCH = 1
PATCH = 0

APP_NAME = 'webcamd'
APP_DESCRIPTION = 'A minimalist webcam streaming service.'
APP_DESCRIPTION = 'A minimalist service for streaming a webcam over HLS'
APP_VERSION = f'{MAJOR}.{MINOR}.{PATCH}'
APP_AUTHOR = 'Igor Maculan'
APP_AUTHOR_EMAIL = '[email protected]'
APP_LICENSE = 'GPL-3.0'
APP_URL = 'https://github.com/christopherkobayashi/octoprint-stuff'
APP_URL = 'https://github.com/dmitri-mcguckin/webcamd'

MAINTAINER_NAME = 'Christopher RYU'
MAINTAINER_EMAIL = '[email protected]'
MAINTAINER_NAME = 'Dmitri McGuckin'
MAINTAINER_EMAIL = '[email protected]'

0 comments on commit d9bda09

Please sign in to comment.