Skip to content

Commit

Permalink
moving version to a file, updating makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
ampledata committed Feb 3, 2025
1 parent 94db0b8 commit 084bef3
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 20 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

REPO_NAME ?= $(shell echo $(wildcard */__init__.py) | awk -F'/' '{print $$1}')
REPO_NAME ?= $(shell echo $(wildcard src/*/__init__.py) | awk -F'/' '{print $$2}')
SHELL := /bin/bash
.DEFAULT_GOAL := editable
# postinst = $(wildcard debian/*.postinst.sh)
Expand Down Expand Up @@ -47,7 +47,7 @@ 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__ deb_dist .mypy_cache
*/__pycache__ deb_dist .mypy_cache .pytest_cache

pep8:
flake8 --max-line-length=88 --extend-ignore=E203 --exit-zero $(REPO_NAME)/*.py
Expand All @@ -67,12 +67,12 @@ mypy:
mypy --strict .

pytest:
pytest
python3 -m pytest

test: editable install_test_requirements pytest

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

black:
black .
Expand Down
14 changes: 5 additions & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

[metadata]
name = pytak
version = attr: pytak.__version__
version = file: src/pytak/VERSION
url = https://github.com/snstac/pytak
project_urls =
CI: GitHub Actions = https://github.com/snstac/pytak/actions
Expand All @@ -30,17 +30,15 @@ maintainer = Greg Albrecht <[email protected]>
maintainer_email = [email protected]
license = Apache 2.0
license_files = LICENSE
authors =
{ name="Greg Albrecht", email="[email protected]" }
requires_python = ">=3.7"
classifiers =
License :: OSI Approved :: Apache Software License
Intended Audience :: Developers
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Development Status :: 5 - Production/Stable
Operating System :: POSIX
Operating System :: MacOS :: MacOS X
Expand All @@ -55,13 +53,11 @@ keywords =
TAK
TAK Server


[options]
packages = find:
include_package_data = True
packages = pytak, pytak.asyncio_dgram
python_requires = >=3.6, <4


[options.extras_require]
with_crypto = cryptography >= 39.0.0
with_takproto = takproto >= 2.0.0
Expand Down
2 changes: 0 additions & 2 deletions pytak/__init__.py → src/pytak/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

"""Python Team Awareness Kit (PyTAK) Module."""

__version__ = "7.1.0"

from .constants import ( # NOQA
LOG_LEVEL,
LOG_FORMAT,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions pytak/functions.py → src/pytak/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def cot2xml(event: pytak.COTEvent) -> ET.Element:
point.set("ce", ce)

flow_tags = ET.Element("_flow-tags_")
_ft_tag: str = f"{pytak.DEFAULT_HOST_ID}-v{pytak.__version__}".replace("@", "-")
_ft_tag: str = f"{pytak.DEFAULT_HOST_ID}-pytak".replace("@", "-")
flow_tags.set(_ft_tag, pytak.cot_time())

detail = ET.Element("detail")
Expand Down Expand Up @@ -238,7 +238,8 @@ def gen_cot_xml(
point.set("ce", ce)

flow_tags = ET.Element("_flow-tags_")
_ft_tag: str = f"{pytak.DEFAULT_HOST_ID}-v{pytak.__version__}".replace("@", "-")
# FIXME: Add PyTAK version to the flow tags.
_ft_tag: str = f"{pytak.DEFAULT_HOST_ID}-pytak".replace("@", "-")
flow_tags.set(_ft_tag, pytak.cot_time())

detail = ET.Element("detail")
Expand Down
4 changes: 1 addition & 3 deletions tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ def test_cot2xml():
flow_tags_element = detail_element.find("_flow-tags_")
assert flow_tags_element is not None
assert (
flow_tags_element.get(
f"{pytak.DEFAULT_HOST_ID}-v{pytak.__version__}".replace("@", "-")
)
flow_tags_element.get(f"{pytak.DEFAULT_HOST_ID}-pytak".replace("@", "-"))
is not None
)

0 comments on commit 084bef3

Please sign in to comment.