-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from joshrost/add-actions
Add actions for linting and testing
- Loading branch information
Showing
9 changed files
with
148 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade black | ||
- name: black format check | ||
run: black --check --line-length 120 traffic_light/ test/ setup.py | ||
|
||
test: | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 6 | ||
matrix: | ||
python-version: [3.8, 3.9, "3.10"] | ||
os: [ubuntu-latest] | ||
include: | ||
- os: ubuntu-latest | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Setup build and test environment | ||
run: | | ||
python -m pip install --upgrade pip | ||
- name: Build Python Package | ||
run: | | ||
python -m pip install -r requirements-dev.txt | ||
- name: Update pytest on >= Python3.10 | ||
if: ${{ matrix.python-version == '3.10' || matrix.python-version == '3.11' }} | ||
run: | | ||
python -m pip install pytest==7.0.1 | ||
- name: Unit Test with pytest | ||
run: PYTHONPATH=. pytest test --cov=traffic_light --cov-report term-missing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-r requirements.txt | ||
pytest >= 7.2.2 | ||
pytest-cov >= 4.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pyusb >= 1.2.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
from setuptools import setup, find_packages | ||
|
||
with open("README.md", "r", encoding='utf-8') as desc_file: | ||
with open("README.md", "r", encoding="utf-8") as desc_file: | ||
long_description = desc_file.read() | ||
|
||
setup( | ||
name='cleware-traffic-light', | ||
version='1.0.8', | ||
description='Python3 modul and cli tool to controll the Cleware traffic light', | ||
name="cleware-traffic-light", | ||
version="1.0.8", | ||
description="Python3 modul and cli tool to controll the Cleware traffic light", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
author='Josh Rost', | ||
author_email='joshua.s.rost@gmail.com', | ||
url='https://github.com/joshrost/cleware-traffic-light', | ||
author="Josh Rost", | ||
author_email="joshua.s.rost@gmail.com", | ||
url="https://github.com/joshrost/cleware-traffic-light", | ||
packages=find_packages(), | ||
install_requires=['pyusb'], | ||
install_requires=["pyusb"], | ||
entry_points={ | ||
'console_scripts': ['ctl=traffic_light.__main__:main'], | ||
} | ||
"console_scripts": ["ctl=traffic_light.__main__:main"], | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
from traffic_light.core import ClewareTrafficLight, Color, State | ||
|
||
__all__ = [ | ||
"ClewareTrafficLight", | ||
"Color", | ||
"State" | ||
] | ||
__all__ = ["ClewareTrafficLight", "Color", "State"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters