From 5322bb3152ad6e215a1a15c19c567a90c768fac9 Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Thu, 21 Jan 2021 23:14:27 +0000 Subject: [PATCH 1/3] Move to Github Actions --- .coveragerc | 9 ++++ .github/workflows/testing.yml | 62 +++++++++++++++++++++++++++ .travis.yml | 25 ----------- Makefile | 6 +-- dev_requirements.txt | 9 ++++ requirements.txt | 5 --- tests/test_IS.py | 2 +- tests/test_base91.py | 2 +- tests/test_exceptions.py | 2 +- tests/test_parse.py | 2 +- tests/test_parse_comment_telemetry.py | 2 +- tests/test_parse_common.py | 2 +- tests/test_parse_misc.py | 2 +- tests/test_parse_weather_data.py | 2 +- tests/test_passcode.py | 2 +- tests/test_util.py | 2 +- 16 files changed, 93 insertions(+), 43 deletions(-) create mode 100644 .coveragerc create mode 100644 .github/workflows/testing.yml delete mode 100644 .travis.yml create mode 100644 dev_requirements.txt delete mode 100644 requirements.txt diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..c25bdcf --- /dev/null +++ b/.coveragerc @@ -0,0 +1,9 @@ + +# Docs: https://coverage.readthedocs.org/en/latest/config.html + +[run] +branch = False + +# If True, stores relative file paths in data file (needed for Github Actions). +# Using this parameter requires coverage>=5.0 +relative_files = True diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 0000000..5694892 --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,62 @@ +name: Tests + +on: + push: + branches: [ master ] + paths-ignore: + - '.gitignore' + - '*.md' + - '*.rst' + - 'LICENSE' + - 'dev_requirements.txt' + pull_request: + branches: [ master ] + paths-ignore: + - '.gitignore' + - '*.md' + - '*.rst' + - 'LICENSE' + - 'dev_requirements.txt' +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + python-version: [2.7, 3.5, 3.6, 3.7, 3.8, pypy2, pypy3] + steps: + - uses: actions/checkout@v2 + - name: Set up Python Env + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Display Python version + run: python -c "import sys; print(sys.version)" + - name: Install dependencies + run: | + make init + - name: Run Tests + run: | + make test + - name: Upload to Coveralls + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_PARALLEL: true + COVERALLS_FLAG_NAME: "${{ matrix.os }}_${{ matrix.python-version }}" + run: | + coveralls --service=github + + coveralls: + name: Finish Coveralls + needs: test + runs-on: ubuntu-latest + container: python:3-slim + steps: + - name: Install coveralls + run: | + pip3 install --upgrade coveralls + - name: Send coverage finish to coveralls.io + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + coveralls --finish diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c130959..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: python -sudo: false -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" - - "nightly" - - "pypy" - - "pypy3" -matrix: - include: - - python: 3.7 - dist: xenial - sudo: true -install: - - make init - - pip install coveralls - - pip install scrutinizer-ocular -script: - - make test -after_success: - - coveralls - - ocular - diff --git a/Makefile b/Makefile index 58a44d7..ef50346 100644 --- a/Makefile +++ b/Makefile @@ -18,11 +18,11 @@ help: @echo "$$HELPBODY" init: - pip install -r requirements.txt + pip install -r dev_requirements.txt test: - rm -f .coverage aprslib/*.pyc - nosetests --verbosity $(verbosity) --with-coverage --cover-package=aprslib + rm -f .coverage aprslib/*.pyc tests/*.pyc + PYTHONHASHSEED=0 pytest --tb=short --cov-config .coveragerc --cov=aprslib tests pylint: pylint -r n -f colorized aprslib || true diff --git a/dev_requirements.txt b/dev_requirements.txt new file mode 100644 index 0000000..48e1f64 --- /dev/null +++ b/dev_requirements.txt @@ -0,0 +1,9 @@ + +mox3 + +coverage>=5.0; python_version == '2.7' or python_version >= '3.5' +pytest-cov>=2.7.0; python_version == '2.7' or python_version >= '3.5' + +# coveralls 2.0 has removed support for Python 2.7 and 3.4 +git+https://github.com/andy-maier/coveralls-python.git@andy/add-py27#egg=coveralls; python_version == '2.7' +coveralls>=2.1.2; python_version >= '3.5' diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 695a581..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -nose -coverage -unittest2 -mox3 -sphinx==1.3.5 diff --git a/tests/test_IS.py b/tests/test_IS.py index 00326c1..36f0d99 100644 --- a/tests/test_IS.py +++ b/tests/test_IS.py @@ -1,4 +1,4 @@ -import unittest2 as unittest +import unittest import socket import sys import os diff --git a/tests/test_base91.py b/tests/test_base91.py index f6924ef..ef4b6c1 100644 --- a/tests/test_base91.py +++ b/tests/test_base91.py @@ -1,4 +1,4 @@ -import unittest2 as unittest +import unittest import sys from aprslib import base91 diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index f6f06df..68595e4 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -1,4 +1,4 @@ -import unittest2 as unittest +import unittest from aprslib.exceptions import * diff --git a/tests/test_parse.py b/tests/test_parse.py index 0a08938..4974f8d 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -1,7 +1,7 @@ # encoding: utf-8 import sys -import unittest2 as unittest +import unittest from mox3 import mox from aprslib import parse diff --git a/tests/test_parse_comment_telemetry.py b/tests/test_parse_comment_telemetry.py index 59447b4..2240660 100644 --- a/tests/test_parse_comment_telemetry.py +++ b/tests/test_parse_comment_telemetry.py @@ -1,4 +1,4 @@ -import unittest2 as unittest +import unittest from aprslib.parsing import parse_comment_telemetry from aprslib import base91 diff --git a/tests/test_parse_common.py b/tests/test_parse_common.py index 64190dc..82b3b90 100644 --- a/tests/test_parse_common.py +++ b/tests/test_parse_common.py @@ -1,4 +1,4 @@ -import unittest2 as unittest +import unittest import string from random import randint, randrange, sample from datetime import datetime diff --git a/tests/test_parse_misc.py b/tests/test_parse_misc.py index 65ec1c2..0c69c54 100644 --- a/tests/test_parse_misc.py +++ b/tests/test_parse_misc.py @@ -1,4 +1,4 @@ -import unittest2 as unittest +import unittest from aprslib.parsing.misc import parse_status, parse_invalid, parse_user_defined diff --git a/tests/test_parse_weather_data.py b/tests/test_parse_weather_data.py index 5312c34..634ed5f 100644 --- a/tests/test_parse_weather_data.py +++ b/tests/test_parse_weather_data.py @@ -1,4 +1,4 @@ -import unittest2 as unittest +import unittest from aprslib.parsing import parse_weather_data from aprslib.parsing import parse diff --git a/tests/test_passcode.py b/tests/test_passcode.py index 03181b0..af51566 100644 --- a/tests/test_passcode.py +++ b/tests/test_passcode.py @@ -1,4 +1,4 @@ -import unittest2 as unittest +import unittest from aprslib import passcode diff --git a/tests/test_util.py b/tests/test_util.py index 7af037d..642aca4 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -1,5 +1,5 @@ -import unittest2 as unittest +import unittest from aprslib import util From 90eecdb18cb064d383948eb2a1b81398608f564c Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Thu, 21 Jan 2021 23:20:10 +0000 Subject: [PATCH 2/3] update badges in README --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 185d9cd..e1f799e 100644 --- a/README.rst +++ b/README.rst @@ -40,8 +40,8 @@ Contribution :target: https://scrutinizer-ci.com/g/rossengeorgiev/aprs-python/?branch=master :alt: Scrutinizer score -.. |master_build| image:: https://img.shields.io/travis/rossengeorgiev/aprs-python/master.svg?style=flat&label=master%20build - :target: http://travis-ci.org/rossengeorgiev/aprs-python +.. |master_build| image:: https://github.com/rossengeorgiev/aprs-python/workflows/Tests/badge.svg?branch=master + :target: https://github.com/rossengeorgiev/aprs-python/actions?query=workflow%3A%22Tests%22+branch%3Amaster :alt: Build status of master branch .. |docs| image:: https://readthedocs.org/projects/aprs-python/badge/?version=latest From bab4c27471dddf2136da35615a1d523e0c40af3b Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Thu, 21 Jan 2021 23:21:31 +0000 Subject: [PATCH 3/3] update README --- README.rst | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.rst b/README.rst index e1f799e..6119dbc 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ APRS library for Python ~~~~~~~~~~~~~~~~~~~~~~~ -|pypi| |coverage| |scru| |master_build| |docs| +|pypi| |coverage| |master_build| |docs| A python library for dealing with APRS. It can be used to interact with APRS-IS servers, sending and receiving. @@ -36,10 +36,6 @@ Contribution :target: https://coveralls.io/r/rossengeorgiev/aprs-python?branch=master :alt: Test coverage -.. |scru| image:: https://scrutinizer-ci.com/g/rossengeorgiev/aprs-python/badges/quality-score.png?b=master - :target: https://scrutinizer-ci.com/g/rossengeorgiev/aprs-python/?branch=master - :alt: Scrutinizer score - .. |master_build| image:: https://github.com/rossengeorgiev/aprs-python/workflows/Tests/badge.svg?branch=master :target: https://github.com/rossengeorgiev/aprs-python/actions?query=workflow%3A%22Tests%22+branch%3Amaster :alt: Build status of master branch