Skip to content

Commit a3ce7e5

Browse files
authored
Merge pull request #2 from basilfx/feature/actions
Add GitHub actions
2 parents df01852 + 2c317f5 commit a3ce7e5

File tree

7 files changed

+96
-10
lines changed

7 files changed

+96
-10
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[flake8]
2+
ignore = E203, W503
23
max-line-length = 88

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: pip
4+
directory: "/"
5+
schedule:
6+
interval: weekly

.github/workflows/lint.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Linting
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- uses: actions/setup-python@v2
16+
with:
17+
python-version: "3.10"
18+
19+
- uses: actions/cache@v2
20+
with:
21+
path: ~/.local
22+
key: poetry-1.2.2
23+
24+
- uses: snok/install-poetry@v1
25+
with:
26+
version: 1.2.2
27+
virtualenvs-create: true
28+
virtualenvs-in-project: true
29+
30+
- uses: actions/cache@v2
31+
id: cache-deps
32+
with:
33+
path: .venv
34+
key: pydeps-${{ hashFiles('**/poetry.lock') }}
35+
36+
- run: poetry install --no-interaction --no-root
37+
if: steps.cache-deps.outputs.cache-hit != 'true'
38+
39+
- run: poetry install --no-interaction
40+
41+
- run: poetry run flake8 tinylink tests
42+
43+
- run: poetry run black --check --diff tinylink tests
44+
45+
- run: poetry run isort --check --diff tinylink tests

.github/workflows/test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Testing
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- uses: actions/setup-python@v2
16+
with:
17+
python-version: "3.10"
18+
19+
- uses: actions/cache@v2
20+
with:
21+
path: ~/.local
22+
key: poetry-1.2.2
23+
24+
- uses: snok/install-poetry@v1
25+
with:
26+
version: 1.2.2
27+
virtualenvs-create: true
28+
virtualenvs-in-project: true
29+
30+
- uses: actions/cache@v2
31+
id: cache-deps
32+
with:
33+
path: .venv
34+
key: pydeps-${{ hashFiles('**/poetry.lock') }}
35+
36+
- run: poetry install --no-interaction --no-root
37+
if: steps.cache-deps.outputs.cache-hit != 'true'
38+
39+
- run: poetry install --no-interaction
40+
41+
- run: poetry run pytest

.travis.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# python-tinylink
22
Frame-based streaming protocol for embedded applications.
33

4-
[![Build Status](https://travis-ci.org/basilfx/python-tinylink.svg?branch=master)](https://travis-ci.org/basilfx/python-tinylink)
4+
[![Linting](https://github.com/basilfx/python-tinylink/actions/workflows/lint.yml/badge.svg)](https://github.com/basilfx/python-tinylink/actions/workflows/lint.yml)
5+
[![Testing](https://github.com/basilfx/python-tinylink/actions/workflows/test.yml/badge.svg)](https://github.com/basilfx/python-tinylink/actions/workflows/test.yml)
56

67
## Introduction
78
This is a general purpose Python module to provide a bi-directional frame-based

tinylink/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def process_stdin(link: tinylink.TinyLink) -> Optional[bool]:
127127
try:
128128
# Assume it is a float.
129129
value = struct.pack(link.endianness + pack, float(item))
130-
except:
130+
except: # noqa
131131
try:
132132
# Assume it is an int.
133133
value = struct.pack(link.endianness + pack, int(item, 0))

0 commit comments

Comments
 (0)