-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
329 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Lint & Test Code | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
|
||
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 test requirements | ||
run: | | ||
make install_test_requirements | ||
- name: Install package itself (editable) | ||
run: | | ||
make editable | ||
- name: Lint with pylint | ||
run: | | ||
make pylint | ||
- name: Lint with flake8 | ||
run: | | ||
make flake8 | ||
- name: Test with pytest-cov | ||
run: | | ||
make test_cov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,78 @@ | ||
# Makefile for Python APRS Cursor-on-Target Gateway. | ||
# | ||
# Source:: https://github.com/ampledata/aprscot | ||
# Copyright 2022 Greg Albrecht <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Author:: Greg Albrecht W2GMD <[email protected]> | ||
# Copyright:: Copyright 2022 Greg Albrecht | ||
# License:: Apache License, Version 2.0 | ||
# | ||
|
||
|
||
this_app = aprscot | ||
.DEFAULT_GOAL := all | ||
|
||
all: editable | ||
|
||
all: develop | ||
|
||
install_requirements: | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
develop: | ||
python3 setup.py develop | ||
|
||
install_requirements_test: | ||
pip install -r requirements_test.txt | ||
editable: | ||
python3 -m pip install -e . | ||
|
||
develop: | ||
pip install -e . | ||
install_test_requirements: | ||
python3 -m pip install -r requirements_test.txt | ||
|
||
install: | ||
python setup.py install | ||
python3 setup.py install | ||
|
||
uninstall: | ||
pip uninstall -y aprscot | ||
python3 -m pip uninstall -y $(this_app) | ||
|
||
reinstall: uninstall install | ||
|
||
remember_test: | ||
@echo | ||
@echo "Hello from the Makefile..." | ||
@echo "Don't forget to run: 'make install_requirements_test'" | ||
@echo | ||
publish: | ||
python3 setup.py publish | ||
|
||
clean: | ||
@rm -rf *.egg* build dist *.py[oc] */*.py[co] cover doctest_pypi.cfg \ | ||
nosetests.xml pylint.log output.xml flake8.log tests.log \ | ||
test-result.xml htmlcov fab.log .coverage */__pycache__/ | ||
|
||
# Publishing: | ||
test-result.xml htmlcov fab.log .coverage __pycache__ \ | ||
*/__pycache__ | ||
|
||
build: remember_test | ||
python3 -m build --sdist --wheel | ||
|
||
twine_check: remember_test build | ||
twine check dist/* | ||
|
||
upload: remember_test build | ||
twine upload dist/* | ||
|
||
publish: build twine_check upload | ||
|
||
# Tests: | ||
|
||
pep8: remember_test | ||
# flake8 --max-complexity 12 --exit-zero *.py */*.py | ||
# 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 | ||
pep8: | ||
flake8 --max-line-length=88 --extend-ignore=E203 --exit-zero $(this_app)/*.py | ||
|
||
flake8: pep8 | ||
|
||
lint: remember_test | ||
lint: | ||
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \ | ||
-r n *.py */*.py || exit 0 | ||
--max-line-length=88 -r n $(this_app)/*.py || exit 0 | ||
|
||
pylint: lint | ||
|
||
pytest: remember_test | ||
checkmetadata: | ||
python3 setup.py check -s --restructuredtext | ||
|
||
mypy: | ||
mypy --strict . | ||
|
||
pytest: | ||
pytest | ||
|
||
test: lint pep8 pytest | ||
test: editable install_test_requirements pytest | ||
|
||
test_cov: | ||
pytest --cov=$(this_app) | ||
|
||
black: | ||
black . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,43 @@ | ||
#!/usr/bin/env python | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
# APRS Cursor-on-Target Gateway. | ||
# | ||
# Copyright 2022 Greg Albrecht <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Author:: Greg Albrecht W2GMD <[email protected]> | ||
# | ||
|
||
""" | ||
APRS Cursor-on-Target Gateway. | ||
~~~~ | ||
:author: Greg Albrecht W2GMD <[email protected]> | ||
:copyright: Copyright 2022 Greg Albrecht | ||
:license: Apache License, Version 2.0 | ||
:source: <https://github.com/ampledata/aprscot> | ||
""" | ||
|
||
from .constants import (LOG_FORMAT, LOG_LEVEL, DEFAULT_APRSIS_PORT, # NOQA | ||
DEFAULT_COT_TYPE, DEFAULT_COT_STALE, | ||
DEFAULT_APRSIS_HOST, DEFAULT_APRSIS_CALLSIGN, | ||
DEFAULT_APRSIS_FILTER) | ||
|
||
from .functions import aprs_to_cot # NOQA | ||
from .constants import ( # NOQA | ||
LOG_FORMAT, | ||
LOG_LEVEL, | ||
DEFAULT_APRSIS_PORT, | ||
DEFAULT_COT_TYPE, | ||
DEFAULT_COT_STALE, | ||
DEFAULT_APRSIS_HOST, | ||
DEFAULT_APRSIS_CALLSIGN, | ||
DEFAULT_APRSIS_FILTER, | ||
) | ||
|
||
from .functions import aprs_to_cot, create_tasks # NOQA | ||
|
||
from .classes import APRSWorker # NOQA | ||
|
||
|
Oops, something went wrong.