7 Commits

Author SHA1 Message Date
51ac52d3a3 Fix build status badge
Use GitHub Actions badge.
2021-01-02 18:13:29 +01:00
43dbb2ef64 README: fix coverage badge branch 2021-01-02 18:07:21 +01:00
d7ed8bd530 Fix coveralls integration 2021-01-02 18:06:19 +01:00
6b83017de9 Raise minimal Python version to 3.5
Newer PyYAML versions require Python 3.5.

Python 3.4 is EOL for some time and even 3.5 reached EOL recently. So
just switch to that as minimum version.
2021-01-02 17:24:44 +01:00
2d7ccf8b3d Fix PyYAML warning
Use SafeLoader to get rid of warning.
2021-01-02 17:22:15 +01:00
77b3f0e1b7 Replace Travis CI with GitHub Actions 2021-01-02 15:24:46 +01:00
5d3214060b Merge branch 'coveralls' 2018-11-13 03:18:07 +01:00
5 changed files with 54 additions and 21 deletions

50
.github/workflows/python.yml vendored Normal file
View File

@ -0,0 +1,50 @@
name: Python package
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.5, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyusb coverage coveralls pyserial PyYAML tqdm
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build package
run: |
python setup.py build
- name: Test with unittest
run: |
coverage run --source=stcgal setup.py test
- name: Coveralls
run: |
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true
coveralls:
name: Finish Coveralls
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,16 +0,0 @@
sudo: required
dist: trusty
language: python
cache:
- pip
python:
- "3.4"
- "3.5"
- "3.6"
#- "pypy3"
install:
- pip install pyusb coverage coveralls pyserial PyYAML tqdm
script:
- python setup.py build
- coverage run --source=stcgal setup.py test
- coveralls

View File

@ -1,5 +1,5 @@
[![Build Status](https://travis-ci.org/grigorig/stcgal.svg)](https://travis-ci.org/grigorig/stcgal)
[![Coverage Status](https://coveralls.io/repos/github/grigorig/stcgal/badge.svg?branch=coveralls)](https://coveralls.io/github/grigorig/stcgal?branch=coveralls)
[![Build Status](https://github.com/grigorig/stcgal/workflows/Python%20package/badge.svg?branch=master)](https://github.com/grigorig/stcgal/actions?query=workflow%3A%22Python+package%22)
[![Coverage Status](https://coveralls.io/repos/github/grigorig/stcgal/badge.svg?branch=master)](https://coveralls.io/github/grigorig/stcgal?branch=master)
[![PyPI version](https://badge.fury.io/py/stcgal.svg)](https://badge.fury.io/py/stcgal)
stcgal - STC MCU ISP flash tool

View File

@ -58,7 +58,6 @@ setup(
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Topic :: Software Development :: Embedded Systems",

View File

@ -137,7 +137,7 @@ class ProgramTests(unittest.TestCase):
def test_program_stc8_untrimmed(self, out, sleep_mock, serial_mock, write_mock, read_mock):
"""Test error with untrimmed MCU"""
with open("./tests/stc8f2k08s2-untrimmed.yml") as test_file:
test_data = yaml.load(test_file.read())
test_data = yaml.load(test_file.read(), Loader=yaml.SafeLoader)
opts = get_default_opts()
opts.trim = 0.0
opts.protocol = test_data["protocol"]
@ -154,7 +154,7 @@ class ProgramTests(unittest.TestCase):
def _program_yml(self, yml, serial_mock, read_mock):
"""Program MCU with data from YAML file"""
with open(yml) as test_file:
test_data = yaml.load(test_file.read())
test_data = yaml.load(test_file.read(), Loader=yaml.SafeLoader)
opts = get_default_opts()
opts.protocol = test_data["protocol"]
opts.code_image.read.return_value = bytes(test_data["code_data"])