15 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
7e413b09ec CI: disable PyPy3
There are some test-related issues with it, so disable it for now.
2018-11-13 03:16:52 +01:00
3aa08b67c0 CI: prefer pip to Debian packages
According to Travis CI docs, pip should be preferred.
2018-11-13 03:07:06 +01:00
42f93bc481 Add coveralls badge to README 2018-11-13 02:59:32 +01:00
dbfc1b3f50 CI: Add coveralls support 2018-11-13 02:52:46 +01:00
9d47588ad2 Add PyPI badge to README 2018-11-13 02:20:42 +01:00
217e5fb17e CI: try to fix and simplify apt setup
Run apt update to update the package cache, as this seems to be needed by
Travis now. Also reduce the package set - we don't build any deb or rpm
packages anymore. This should hopefully fix the CI build.
2018-11-09 01:14:41 +01:00
3875b1f415 Note serial module name conflict in FAQ
See #35 for discussion.
2018-11-09 01:02:01 +01:00
8e31765cba Add Quickstart documentation 2018-09-24 23:29:45 +02:00
6 changed files with 70 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,17 +0,0 @@
sudo: required
dist: trusty
language: python
cache:
- pip
python:
- "3.4"
- "3.5"
- "3.6"
- "pypy3"
before_install:
- sudo apt install rpm dpkg-dev debhelper dh-python python3-setuptools fakeroot python3-serial python3-yaml
install:
- pip install pyusb
script:
- python setup.py build
- python setup.py test

View File

@ -1,4 +1,6 @@
[![Build Status](https://travis-ci.org/grigorig/stcgal.svg)](https://travis-ci.org/grigorig/stcgal)
[![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
===============================
@ -32,6 +34,17 @@ Features
* Automatic power-cycling with DTR toggle or a custom shell command
* Automatic UART protocol detection
Quickstart
----------
Install stcgal (might need root/administrator privileges):
pip3 install stcgal
Call stcgal and show usage:
stcgal -h
Further information
-------------------

View File

@ -20,6 +20,10 @@ Interfaces that are known to not work:
In general, stcgal requires accurate baud rate timings and parity support.
### stcgal fails to start with the error `module 'serial' has no attribute 'PARITY_NONE'` or similar
There is a module name conflict between the PyPI package 'serial' (a data serialization library) and the PyPI package 'pyserial' (the serial port access library needed by stcgal). You have to uninstall the 'serial' package (`pip3 uninstall serial`) and reinstall 'pyserial' (`pip3 install --force-reinstall pyserial`) to fix this. There is no other known solution at the moment.
### stcgal fails to recognize the MCU and is stuck at "Waiting for MCU"
There are a number of issues that can result in this symptom:

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"])