Skip to content

Commit

Permalink
migrate from travis to GitHub actions
Browse files Browse the repository at this point in the history
+ migrate to GitHub actions
+ update README
+ update copyright
+ ...
  • Loading branch information
GIC-de committed Jul 8, 2024
1 parent 25eaceb commit f61df08
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 26 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -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@v4
- name: Set up Python
uses: actions/setup-python@v5
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/*
60 changes: 60 additions & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -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@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
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
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Christian Giese
Copyright (c) 2017 - 2024 Christian Giese

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![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)
[![Test Status](https://github.com/GIC-de/PyANCP/actions/workflows/python-test.yml/badge.svg)](https://github.com/GIC-de/PyANCP/actions/workflows/python-test.yml)
[![Coverage Status](https://coveralls.io/repos/github/GIC-de/PyANCP/badge.svg?branch=master)](https://coveralls.io/github/GIC-de/PyANCP?branch=master)
[![Documentation Status](https://readthedocs.org/projects/pyancp/badge/?version=latest)](http://pyancp.readthedocs.io/en/latest/?badge=latest)
[![Version](https://img.shields.io/pypi/v/PyANCP.svg)](https://pypi.python.org/pypi/PyANCP)
[![Downloads](https://img.shields.io/pypi/dm/PyANCP.svg)](https://pypi.python.org/pypi/PyANCP)
[![Python Versions](https://img.shields.io/pypi/pyversions/PyANCP.svg)](https://pypi.python.org/pypi/PyANCP)
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. image:: https://travis-ci.org/GIC-de/PyANCP.svg?branch=master
:target: https://travis-ci.org/GIC-de/PyANCP
.. image:: https://github.com/GIC-de/PyANCP/actions/workflows/python-test.yml/badge.svg
:target: https://github.com/GIC-de/PyANCP/actions/workflows/python-test.yml
.. 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
Expand Down
2 changes: 1 addition & 1 deletion ancp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Python ANCP Client
"""
__author__ = 'Christian Giese (GIC-de)'
__copyright__ = 'Copyright 2017-2021, Christian Giese'
__copyright__ = 'Copyright 2017-2024, Christian Giese'

__all__ = ['client', 'subscriber']
2 changes: 1 addition & 1 deletion ancp/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""ANCP Client
Copyright (C) 2017-2021, Christian Giese (GIC-de)
Copyright (C) 2017-2024, Christian Giese (GIC-de)
SPDX-License-Identifier: MIT
"""
from __future__ import print_function
Expand Down
2 changes: 1 addition & 1 deletion ancp/subscriber.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""ANCP Subscribers
Copyright (C) 2017-2021, Christian Giese (GIC-de)
Copyright (C) 2017-2024, Christian Giese (GIC-de)
SPDX-License-Identifier: MIT
"""
from __future__ import print_function
Expand Down
2 changes: 1 addition & 1 deletion bin/client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
"""ANCP Client Example
Copyright (C) 2017-2021, Christian Giese (GIC-de)
Copyright (C) 2017-2024, Christian Giese (GIC-de)
SPDX-License-Identifier: MIT
"""
from ancp.client import Client
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

# General information about the project.
project = u'PyANCP'
copyright = u'Copyright 2017-2021, Christian Giese (GIc-de)'
copyright = u'Copyright 2017-2024, Christian Giese (GIc-de)'
author = u'Christian Giese'

# The version info for the project you're documenting, acts as replacement for
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
from setuptools import setup, find_packages

version = '0.1.6'
version = '0.1.7'

setup(name='PyANCP',
version=version,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""ANCP Client Tests
Copyright (C) 2017-2021, Christian Giese (GIC-de)
Copyright (C) 2017-2024, Christian Giese (GIC-de)
SPDX-License-Identifier: MIT
"""
from ancp.client import *
Expand Down
2 changes: 1 addition & 1 deletion tests/test_subscriber.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""ANCP Subscriber Tests
Copyright (C) 2017-2021, Christian Giese (GIC-de)
Copyright (C) 2017-2024, Christian Giese (GIC-de)
SPDX-License-Identifier: MIT
"""
from ancp.subscriber import *
Expand Down

0 comments on commit f61df08

Please sign in to comment.