Skip to content

Commit

Permalink
documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ampledata committed Jun 21, 2024
1 parent 258db0d commit 1b12ec8
Show file tree
Hide file tree
Showing 21 changed files with 86 additions and 122 deletions.
40 changes: 13 additions & 27 deletions .github/workflows/debian.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Debian package
name: Build Debian Package

on:
push:
Expand All @@ -15,33 +15,19 @@ jobs:
steps:
- uses: actions/checkout@master

- name: Install packaging dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y \
python3 python3-dev python3-pip python3-venv python3-all \
dh-python debhelper devscripts dput software-properties-common \
python3-distutils python3-setuptools python3-wheel python3-stdeb
- name: Build Debian/Apt sdist_dsc
run: |
rm -Rf deb_dist/*
python3 setup.py --command-packages=stdeb.command sdist_dsc
- 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-${REPO_NAME}_*_all.deb deb_dist/python3-${REPO_NAME}_latest_all.deb
- uses: actions/upload-artifact@master
- name: Install Debian Package Building Dependencies
run: sudo bash debian/install_pkg_build_deps.sh

- name: Create Debian Package
run: make clean package

- name: Upload Artifacts to GitHub
uses: actions/upload-artifact@master
with:
name: artifact-deb
path: |
deb_dist/*.deb
path: deb_dist/*.deb

- name: Create Release
- name: Create GitHub Release
id: create_release
uses: actions/create-release@master
env:
Expand All @@ -52,12 +38,12 @@ jobs:
draft: false
prerelease: false

- name: Upload Release Asset
- name: Upload Release Asset to GitHub
id: upload-release-asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: deb_dist/*.deb
tag: ${{ github.ref }}
overwrite: true
file_glob: true
file_glob: true
65 changes: 42 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Makefile for PyTAK
# Makefile from https://github.com/snstac/pytak
# PyTAK Makefile
#
# Copyright Sensors & Signals LLC https://www.snstac.com
# Copyright Sensors & Signals LLC https://www.snstac.com/
#
# 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 All @@ -15,50 +14,49 @@
# limitations under the License.
#

this_app = pytak
.DEFAULT_GOAL := all
REPO_NAME ?= $(shell echo $(wildcard */classes.py) | awk -F'/' '{print $$1}')
SHELL := /bin/bash
.DEFAULT_GOAL := editable
# postinst = $(wildcard debian/*.postinst.sh)
# service = $(wildcard debian/*.service)

all: editable
prepare:
mkdir -p build/

develop:
python3 -m pip install --use-feature=in-tree-build .
python3 setup.py develop

editable:
python3 -m pip install -e .

install_test_requirements:
python3 -m pip install -r requirements_test.txt
python3 -m pip install -r requirements_test.txt

install:
python3 setup.py install

uninstall:
python3 -m pip uninstall -y $(this_app)
python3 -m pip uninstall -y $(REPO_NAME)

reinstall: uninstall install

dist: build

build:
python3 -m build

publish: dist
twine upload dist/*
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__ \
*/__pycache__ */.mypy_cache/ .pytest_cache/
*/__pycache__ deb_dist .mypy_cache

pep8:
flake8 --max-line-length=88 --extend-ignore=E203,E231 --exit-zero $(this_app)/*.py
flake8 --max-line-length=88 --extend-ignore=E203 --exit-zero $(REPO_NAME)/*.py

flake8: pep8

lint:
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
--max-line-length=88 -r n $(this_app)/*.py || exit 0
--max-line-length=88 -r n $(REPO_NAME)/*.py || exit 0

pylint: lint

Expand All @@ -74,11 +72,32 @@ pytest:
test: editable install_test_requirements pytest

test_cov:
pytest --cov=$(this_app) --cov-report term-missing
pytest --cov=$(REPO_NAME) --cov-report term-missing

black:
black .

mkdocs:
pip install -r docs/requirements.txt
mkdocs serve
mkdocs serve

deb_dist:
python3 setup.py --command-packages=stdeb.command sdist_dsc

deb_custom:
cp debian/$(REPO_NAME).conf $(wildcard deb_dist/*/debian)/$(REPO_NAME).default
cp debian/$(REPO_NAME).postinst $(wildcard deb_dist/*/debian)/$(REPO_NAME).postinst
cp debian/$(REPO_NAME).service $(wildcard deb_dist/*/debian)/$(REPO_NAME).service

bdist_deb: deb_dist deb_custom
cd deb_dist/$(REPO_NAME)-*/ && dpkg-buildpackage -rfakeroot -uc -us

faux_latest:
cp deb_dist/$(REPO_NAME)_*-1_all.deb deb_dist/$(REPO_NAME)_latest_all.deb
cp deb_dist/$(REPO_NAME)_*-1_all.deb deb_dist/python3-$(REPO_NAME)_latest_all.deb

package: bdist_deb faux_latest

extract:
dpkg-deb -e $(wildcard deb_dist/*latest_all.deb) deb_dist/extract
dpkg-deb -x $(wildcard deb_dist/*latest_all.deb) deb_dist/extract
18 changes: 7 additions & 11 deletions README.rst → README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
.. image:: https://pytak.readthedocs.io/en/latest/atak_screenshot_with_pytak_logo-x25.jpg
:alt: ATAK Screenshot with PyTAK Logo.
:target: https://github.com/snstac/pytak/blob/main/docs/atak_screenshot_with_pytak_logo.jpg
![ATAK Screenshot with PyTAK Logo.](media/atak_screenshot_with_pytak_logo-x25.jpg)

Python Team Awareness Kit (PyTAK)
*********************************
# Python Team Awareness Kit

PyTAK is a Python Module for creating TAK clients, servers & gateways.
PyTAK is a Python Module for creating [TAK](https://tak.gov) clients, servers & gateways.

PyTAK includes:

Expand All @@ -14,14 +11,12 @@ PyTAK includes:
- Functions for parsing and serializing TAK & CoT data.
- Functions for sending and receiving TAK & CoT data over a network.

Documentation
=============
## Documentation

See `PyTAK documentation <https://pytak.rtfd.io/>`_ for instructions on getting
See [PyTAK documentation](https://pytak.rtfd.io/) for instructions on getting
started with PyTAK, examples, configuration & troubleshooting options.

License & Copyright
===================
## License & Copyright

Copyright Sensors & Signals LLC https://www.snstac.com

Expand All @@ -37,3 +32,4 @@ limitations under the License.

asyncio_dgram is Copyright (c) 2019 Justin Bronder and is licensed under the MIT
License, see pytak/asyncio_dgram/LICENSE for details.

4 changes: 2 additions & 2 deletions docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ When installing PyTAK::
Alternative, installing from a Debian package::

sudo apt update -y
wget https://github.com/snstak/takproto/releases/latest/download/python3-takproto_latest_all.deb
sudo apt install -f ./python3-takproto_latest_all.deb
wget https://github.com/snstak/takproto/releases/latest/download/takproto_latest_all.deb
sudo apt install -f ./takproto_latest_all.deb


## Python 3.6+
Expand Down
14 changes: 1 addition & 13 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@

![ATAK Screenshot with PyTAK Logo.](atak_screenshot_with_pytak_logo-x25.jpg)

# Python Team Awareness Kit Documentation

PyTAK is a Python Module for creating [TAK](https://tak.gov) clients, servers & gateways.

PyTAK includes:

- TAK Protocol support for interconnecting with ATAK, WinTAK, iTAK & TAK Server.
- Classes for handling TAK, Cursor on Target (CoT) & non-CoT data.
- Functions for parsing and serializing TAK & CoT data.
- Functions for sending and receiving TAK & CoT data over a network.
{!README.md!}
8 changes: 4 additions & 4 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ To install PyTAK, download the pytak package and install using apt:

```sh
sudo apt update -y
wget https://github.com/snstac/pytak/releases/latest/download/python3-pytak_latest_all.deb
sudo apt install -f ./python3-pytak_latest_all.deb
wget https://github.com/snstac/pytak/releases/latest/download/pytak_latest_all.deb
sudo apt install -f ./pytak_latest_all.deb
```

### Data Package Support
Expand All @@ -27,8 +27,8 @@ To install takproto, download the deb package and install using apt::

```sh
sudo apt update -y
wget https://github.com/snstak/takproto/releases/latest/download/python3-takproto_latest_all.deb
sudo apt install -f ./python3-takproto_latest_all.deb
wget https://github.com/snstak/takproto/releases/latest/download/takproto_latest_all.deb
sudo apt install -f ./takproto_latest_all.deb
```

## Install from Python Package Index (PyPI)
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ site_url: https://pytak.rtfd.io/
repo_url: https://github.com/snstac/pytak/
site_description: Python Team Awareness Kit (PyTAK) Documentation
site_author: Greg Albrecht <[email protected]>
copyright: Copyright Sensors & Signals LLC snstac.com
copyright: Copyright Sensors & Signals LLC https://www.snstac.com/

theme:
name: material
Expand Down
15 changes: 3 additions & 12 deletions pytak/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# __init__.py from https://github.com/snstac/pytak
#
# Copyright Sensors & Signals LLC https://www.snstac.com
#
Expand All @@ -14,13 +15,9 @@
# limitations under the License.
#

"""Python Team Awareness Kit (PyTAK) Module.
:source: <https://github.com/snstac/pytak>
"""

__version__ = "6.4.0"
"""Python Team Awareness Kit (PyTAK) Module."""

__version__ = "7.0.0-beta1"

from .constants import ( # NOQA
LOG_LEVEL,
Expand Down Expand Up @@ -81,9 +78,3 @@
)

from . import asyncio_dgram # NOQA

# from .crypto_functions import *

__author__ = "Greg Albrecht <[email protected]>"
__copyright__ = "Copyright Sensors & Signals LLC https://www.snstac.com"
__license__ = "Apache License, Version 2.0"
5 changes: 1 addition & 4 deletions pytak/classes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# classes.py from https://github.com/snstac/pytak
#
# Copyright Sensors & Signals LLC https://www.snstac.com
#
Expand Down Expand Up @@ -37,10 +38,6 @@
except ImportError:
pass

__author__ = "Greg Albrecht <[email protected]>"
__copyright__ = "Copyright Sensors & Signals LLC https://www.snstac.com"
__license__ = "Apache License, Version 2.0"


class Worker: # pylint: disable=too-few-public-methods
"""Meta class for all other Worker Classes."""
Expand Down
5 changes: 1 addition & 4 deletions pytak/client_functions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# client_functions.py from https://github.com/snstac/pytak
#
# Copyright Sensors & Signals LLC https://www.snstac.com
#
Expand Down Expand Up @@ -54,10 +55,6 @@
warnings.warn("Using Python < 3.7, consider upgrading Python.")
from asyncio import get_event_loop as get_running_loop

__author__ = "Greg Albrecht <[email protected]>"
__copyright__ = "Copyright Sensors & Signals LLC https://www.snstac.com"
__license__ = "Apache License, Version 2.0"


async def create_udp_client(
url: ParseResult, local_addr=None
Expand Down
5 changes: 1 addition & 4 deletions pytak/commands.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# commands.py from https://github.com/snstac/pytak
#
# Copyright Sensors & Signals LLC https://www.snstac.com
#
Expand All @@ -18,10 +19,6 @@

import pytak

__author__ = "Greg Albrecht <[email protected]>"
__copyright__ = "Copyright Sensors & Signals LLC https://www.snstac.com"
__license__ = "Apache License, Version 2.0"


def main() -> None:
"""Boilerplate main function."""
Expand Down
6 changes: 1 addition & 5 deletions pytak/constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# constants.py from https://github.com/snstac/pytak
#
# Copyright Sensors & Signals LLC https://www.snstac.com
#
Expand All @@ -23,11 +24,6 @@
from typing import Optional


__author__ = "Greg Albrecht <[email protected]>"
__copyright__ = "Copyright Sensors & Signals LLC https://www.snstac.com"
__license__ = "Apache License, Version 2.0"


LOG_LEVEL: int = logging.INFO
LOG_FORMAT: logging.Formatter = logging.Formatter(
("%(asctime)s pytak %(levelname)s - %(message)s")
Expand Down
Loading

0 comments on commit 1b12ec8

Please sign in to comment.