From 168690963ffbee6c20ed25efb96f781001a6b632 Mon Sep 17 00:00:00 2001 From: Christian Giese Date: Mon, 8 Jul 2024 11:14:47 +0000 Subject: [PATCH] migrate from travis to GitHub actions --- .github/workflows/python-publish.yml | 31 ++++++++++++++ .github/workflows/python-test.yml | 60 ++++++++++++++++++++++++++++ .travis.yml | 10 ----- README.md | 1 - README.rst | 2 - setup.py | 9 +++-- 6 files changed, 96 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/python-publish.yml create mode 100644 .github/workflows/python-test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..04f3572 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,31 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* \ No newline at end of file diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml new file mode 100644 index 0000000..29c69a2 --- /dev/null +++ b/.github/workflows/python-test.yml @@ -0,0 +1,60 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python 3.X test + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ '3.8', '3.9', '3.10' ] + + 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 pytest pytest-pep8 pytest-cov python-coveralls flake8 coverage lcov + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Install pyrad + run: | + pip install . + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Run unittest with coverage + run: | + coverage run -m unittest discover + coverage report -m + coverage lcov + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: run-${{ matrix.python-version }} + path-to-lcov: coverage.lcov + parallel: true + + finish: + needs: test + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5fdcdb9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: python -python: - - "2.7" - - "3.5" -# command to install dependencies -install: "pip install pytest future pytest-pep8 pytest-cov python-coveralls" -# command to run tests -script: python -m pytest -v --cov ancp --cov-report term-missing -after_success: - - coveralls diff --git a/README.md b/README.md index 6325c9b..2824859 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -[![Build Status](https://travis-ci.org/GIC-de/PyANCP.svg?branch=master)](https://travis-ci.org/GIC-de/PyANCP) [![Documentation Status](https://readthedocs.org/projects/pyancp/badge/?version=latest)](http://pyancp.readthedocs.io/en/latest/?badge=latest) [![Coverage Status](https://coveralls.io/repos/github/GIC-de/PyANCP/badge.svg?branch=master)](https://coveralls.io/github/GIC-de/PyANCP?branch=master) [![Version](https://img.shields.io/pypi/v/PyANCP.svg)](https://pypi.python.org/pypi/PyANCP) diff --git a/README.rst b/README.rst index 9a48f69..6417b1e 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,3 @@ -.. image:: https://travis-ci.org/GIC-de/PyANCP.svg?branch=master - :target: https://travis-ci.org/GIC-de/PyANCP .. image:: https://coveralls.io/repos/github/GIC-de/PyANCP/badge.svg?branch=master :target: https://coveralls.io/github/GIC-de/PyANCP?branch=master .. image:: https://readthedocs.org/projects/pyancp/badge/?version=latest diff --git a/setup.py b/setup.py index 0cf71d5..4229a14 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ """ from setuptools import setup, find_packages -version = '0.1.6' +version = '0.1.7' setup(name='PyANCP', version=version, @@ -13,9 +13,10 @@ description='Python ANCP (RFC 6320) Client and Library', long_description=open('README.rst').read(), classifiers=[ - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10' ], packages=find_packages(), zip_safe=True,