forked from snstac/inrcot
-
Notifications
You must be signed in to change notification settings - Fork 0
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
16 changed files
with
244 additions
and
217 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# These are supported funding model platforms | ||
|
||
github: ampledata | ||
patreon: # Replace with a single Patreon username | ||
open_collective: # Replace with a single Open Collective username | ||
ko_fi: ampledata | ||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
liberapay: # Replace with a single Liberapay username | ||
issuehunt: # Replace with a single IssueHunt username | ||
otechie: # Replace with a single Otechie username | ||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry | ||
custom: https://www.buymeacoffee.com/ampledata |
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
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,10 +1,8 @@ | ||
Copyright 2021 Greg Albrecht | ||
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 | ||
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, | ||
|
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,75 +1,78 @@ | ||
# Makefile for Python Programs | ||
|
||
# | ||
# 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 = pytak | ||
.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: remember | ||
pip install -e . | ||
install_test_requirements: | ||
python3 -m pip install -r requirements_test.txt | ||
|
||
install: remember | ||
python setup.py install | ||
install: | ||
python3 setup.py install | ||
|
||
uninstall: | ||
pip uninstall -y inrcot | ||
python3 -m pip uninstall -y $(this_app) | ||
|
||
reinstall: uninstall install | ||
|
||
remember: | ||
@echo | ||
@echo "Hello from the Makefile..." | ||
@echo "Don't forget to run: 'make install_requirements'" | ||
@echo | ||
|
||
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: | ||
|
||
build: remember_test | ||
python3 -m build --sdist --wheel | ||
|
||
twine_check: remember_test build | ||
twine check dist/* | ||
|
||
upload: remember_test build | ||
twine upload dist/* | ||
test-result.xml htmlcov fab.log .coverage __pycache__ \ | ||
*/__pycache__ | ||
|
||
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,E231 --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
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 |
---|---|---|
|
@@ -21,17 +21,16 @@ | |
~~~~ | ||
:author: Greg Albrecht W2GMD <[email protected]> | ||
:copyright: Copyright 2021 Greg Albrecht | ||
:copyright: Copyright 2022 Greg Albrecht | ||
:license: Apache License, Version 2.0 | ||
:source: <https://github.com/ampledata/inrcot> | ||
""" | ||
|
||
from .constants import (LOG_FORMAT, LOG_LEVEL, DEFAULT_POLL_INTERVAL, # NOQA | ||
DEFAULT_COT_STALE, DEFAULT_COT_TYPE) | ||
from .constants import DEFAULT_POLL_INTERVAL, DEFAULT_COT_STALE, DEFAULT_COT_TYPE | ||
|
||
from .functions import inreach_to_cot, split_feed # NOQA | ||
from .functions import create_tasks, inreach_to_cot, split_feed | ||
|
||
from .classes import InrWorker # NOQA | ||
from .classes import Worker | ||
|
||
__author__ = "Greg Albrecht W2GMD <[email protected]>" | ||
__copyright__ = "Copyright 2022 Greg Albrecht" | ||
|
Oops, something went wrong.