Skip to content

Commit

Permalink
fixes for pytak 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ampledata committed Aug 30, 2022
1 parent d6d4ebe commit 08752ad
Show file tree
Hide file tree
Showing 16 changed files with 244 additions and 217 deletions.
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
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
3 changes: 2 additions & 1 deletion .github/workflows/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ jobs:
- name: Build Debian/Apt bdist_deb
run: |
export REPO_NAME=$(echo ${{ github.repository }} | awk -F"/" '{print $2}')
python3 setup.py --command-packages=stdeb.command bdist_deb
ls -al deb_dist/
cp deb_dist/python3-inrcot_*_all.deb deb_dist/python3-inrcot_latest_all.deb
cp deb_dist/python3-${REPO_NAME}_*_all.deb deb_dist/python3-${REPO_NAME}_latest_all.deb
- uses: actions/upload-artifact@master
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# This workflow 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: Publish package to PyPI

name: Publish package to PYPI

on: push
on:
push:
tags:
- '*'

jobs:
deploy:
Expand All @@ -18,13 +19,12 @@ jobs:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python3 -m pip install --upgrade pip
python3 -m pip install setuptools wheel twine
- name: Build
run: |
python setup.py sdist bdist_wheel
python3 setup.py sdist bdist_wheel
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
Expand Down
51 changes: 0 additions & 51 deletions .github/workflows/python-test.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/python-test_and_lint.yml
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
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode/
*.deb
*.egg
*.egg-info/
Expand Down Expand Up @@ -29,8 +30,5 @@ output.xml
pylint.log
redis-server.log
redis-server/
.python-version
venv/
config.ini

*/__pycache__/
__pycache__
.ipynb_checkpoints/
6 changes: 2 additions & 4 deletions LICENSE
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,
Expand Down
103 changes: 53 additions & 50 deletions Makefile
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 .
5 changes: 2 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,15 @@ Use Cases
=========

There are numerous applications for satellite based position location information,
including:
including::

1. Blue Force Tracking
2. Search & Rescue (SAR)
3. Partner Forces PLI
4. Asset Tracking
5. Data diode, CDS & cybersecurity considerations
6. Wildland Firefighting / Dingell Act

``inrcot`` may also be of use in wildland firefighting, see Section 1114.d of
INRCOT may also be of use in wildland firefighting, see Section 1114.d of
the `Dingell Act <https://www.congress.gov/bill/116th-congress/senate-bill/47/text>`_::

Location Systems for Wildland Firefighters.--
Expand Down
9 changes: 4 additions & 5 deletions inrcot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading

0 comments on commit 08752ad

Please sign in to comment.