Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore python 3.8 support #32

Merged
merged 6 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.0.1] - 2023-12-27

### Changed

- Update Makefile to help me remember the correct packaging workflow.

## [3.0.0] - 2023-12-27

### Changed
Expand Down
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ PREFIX=/usr/local
SHAREDIR=share/$(NAME)
SYSTEMD_SERVICE_DIR=/lib/systemd/system
USER=$(NAME)
VERSION=3.0.0
VERSION=3.0.1
RELEASE=1

TESTS=\
unit_tests/test_peer_stats.py \
Expand Down Expand Up @@ -52,6 +53,21 @@ install:
BINDIR=$(PREFIX)/$(BINDIR) CONFDIR=$(CONFDIR) GROUP=$(GROUP) NAME=$(NAME) USER=$(USER) python3 \
src/jinja2_render.py src/ntpmon.env > $(DESTDIR)/$(CONFDIR)/$(NAME)

release:
dch --newversion $(VERSION)-$(RELEASE)
dch --release --distribution focal
for i in CHANGELOG.md debian/changelog debian/*.rst; do \
grep -qw "$(VERSION)" $$i || exit 1; \
done

tag:
git commit -m'Prepare $(VERSION) release' -a
git tag --sign v$(VERSION)
git push --tags

dput:
dput ntpmon buildroot/ntpmon_$(VERSION)-$(RELEASE)_source.changes

$(BUILDROOT):
mkdir $@

Expand Down
18 changes: 18 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
ntpmon (3.0.1-1) focal; urgency=medium

* New upstream patch version to add packaging workflow.

-- Paul Gear <[email protected]> Wed, 27 Dec 2023 22:16:45 +1000

ntpmon (3.0.0+repack1-1) focal; urgency=medium

* No change repack to add Debian changelog.

-- Paul Gear <[email protected]> Wed, 27 Dec 2023 22:15:20 +1000

ntpmon (3.0.0-1) focal; urgency=medium

* New upstream release.

-- Paul Gear <[email protected]> Wed, 27 Dec 2023 21:23:05 +1000

ntpmon (2.1.0-1) focal; urgency=medium

* New upstream release.
Expand Down
2 changes: 1 addition & 1 deletion debian/check_ntpmon-man.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:Version: 3.0.0
:Version: 3.0.1
:Date: 2023-12-27
:Copyright: 2015-2023 Paul Gear
:Title: check_ntpmon
Expand Down
3 changes: 2 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Build-Depends:
python3-all,
python3-docutils,
python3-jinja2,
python3-psutil
python3-psutil,
python3-pytest
Standards-Version: 4.6.0
Homepage: https://github.com/paulgear/ntpmon
Rules-Requires-Root: no
Expand Down
2 changes: 1 addition & 1 deletion debian/ntpmon-man.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:Version: 3.0.0
:Version: 3.0.1
:Date: 2023-12-27
:Copyright: 2015-2023 Paul Gear
:Title: ntpmon
Expand Down
12 changes: 6 additions & 6 deletions src/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
import sys

from io import TextIOWrapper
from typing import ClassVar
from typing import ClassVar, Dict


import line_protocol


class Output:

peertypes: ClassVar[dict[str, str]] = {
peertypes: ClassVar[Dict[str, str]] = {
"backup": "peers/count-backup",
"excess": "peers/count-excess",
"false": "peers/count-false",
Expand All @@ -27,7 +27,7 @@ class Output:
"sync": "peers/count-sync",
}

peerstatstypes: ClassVar[dict[str, str]] = {
peerstatstypes: ClassVar[Dict[str, str]] = {
"authenticated": "authenticated/bool",
"authentication_enabled": "authentication-enabled/bool",
"authentication_fail": "authentication-fail/bool",
Expand Down Expand Up @@ -58,7 +58,7 @@ class Output:
"synchronized": "synchronized/bool",
}

summarytypes: ClassVar[dict[str, str]] = {
summarytypes: ClassVar[Dict[str, str]] = {
"frequency": "frequency/frequency_offset",
"offset": "offset/time_offset",
"reach": "reachability/percent",
Expand Down Expand Up @@ -119,7 +119,7 @@ def __init__(self, args: argparse.Namespace) -> None:
"type",
]

peerstatstypes: ClassVar[dict[str, str]] = {
peerstatstypes: ClassVar[Dict[str, str]] = {
"authenticated": ("i", None, "Whether the peer is authenticated"),
"authentication_enabled": ("i", None, "Whether the peer has authentication enabled"),
"authentication_fail": ("i", None, "Whether the peer has failed authentication"),
Expand Down Expand Up @@ -150,7 +150,7 @@ def __init__(self, args: argparse.Namespace) -> None:
"synchronized": ("i", None, "Whether the peer reports as synchronized"),
}

summarystatstypes: ClassVar[dict[str, tuple[str, str, str]]] = {
summarystatstypes: ClassVar[Dict[str, tuple[str, str, str]]] = {
"frequency": (None, "_hertz", "Frequency error of the local clock"),
"offset": (None, "_seconds", "Mean clock offset of peers"),
"reach": ("%", "_ratio", "Peer reachability over the last 8 polls"),
Expand Down