From f490e10f1f14f4b0d641f9067a7f18c7069c5f8c Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Thu, 17 Jul 2025 22:13:55 -0400 Subject: [PATCH 1/3] updated repo link in help text --- mailfmt.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mailfmt.py b/mailfmt.py index fb34d8a..1af4272 100755 --- a/mailfmt.py +++ b/mailfmt.py @@ -11,10 +11,10 @@ # Author: Daniel Fichtinger # License: ISC -import textwrap -import sys -import re import argparse +import re +import sys +import textwrap def main() -> None: @@ -87,9 +87,9 @@ def main() -> None: description="Heuristic formatter for plain text email. Preserves markup, signoffs, and signature blocks.", epilog=""" Author : Daniel Fichtinger -Repository: https://git.sr.ht/~ficd/mailfmt +Repository: https://git.ficd.sh/ficd/mailfmt License : ISC -Contact : daniel@ficd.ca +Contact : daniel@ficd.sh """, formatter_class=argparse.RawDescriptionHelpFormatter, ) From c2d2780e4ab6afb6ed4b8304d3e41961f87ea6cf Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Thu, 17 Jul 2025 22:19:09 -0400 Subject: [PATCH 2/3] added --version flag --- mailfmt.py | 11 +++++++++++ pyproject.toml | 4 ++-- uv.lock | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/mailfmt.py b/mailfmt.py index 1af4272..995e9aa 100755 --- a/mailfmt.py +++ b/mailfmt.py @@ -15,6 +15,7 @@ import argparse import re import sys import textwrap +from importlib.metadata import version def main() -> None: @@ -93,6 +94,13 @@ Contact : daniel@ficd.sh """, formatter_class=argparse.RawDescriptionHelpFormatter, ) + parser.add_argument( + "-v", + "--version", + required=False, + help="Print version info and exit.", + action="store_true", + ) parser.add_argument( "-w", "--width", @@ -162,6 +170,9 @@ Contact : daniel@ficd.sh help="Output file. (default: %(default)s)", ) args = parser.parse_args() + if args.version: + print(version("mailfmt")) + exit(0) width = args.width should_check_signoff = args.no_signoff should_check_signature = args.no_signature diff --git a/pyproject.toml b/pyproject.toml index 583a3bc..5694f65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [project] name = "mailfmt" -version = "1.0.3" +version = "1.0.4" description = "Heuristic plain text email formatter." readme = "README.md" authors = [ - { name = "Daniel Fichtinger", email = "daniel@ficd.ca" } + { name = "Daniel Fichtinger", email = "daniel@ficd.sh" } ] requires-python = ">=3.11" dependencies = [] diff --git a/uv.lock b/uv.lock index 927ca8f..029043b 100644 --- a/uv.lock +++ b/uv.lock @@ -4,5 +4,5 @@ requires-python = ">=3.11" [[package]] name = "mailfmt" -version = "1.0.1" +version = "1.0.3" source = { editable = "." } From 1aa4455de0c2b6e40365da2b6ce41feed84839c9 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Thu, 17 Jul 2025 22:20:09 -0400 Subject: [PATCH 3/3] added publish workflow --- .forgejo/workflows/publish.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .forgejo/workflows/publish.yml diff --git a/.forgejo/workflows/publish.yml b/.forgejo/workflows/publish.yml new file mode 100644 index 0000000..fde3206 --- /dev/null +++ b/.forgejo/workflows/publish.yml @@ -0,0 +1,20 @@ +on: + push: + tags: + - 'v*' +jobs: + publish: + runs-on: based-alpine + steps: + - uses: actions/checkout@v4 + - name: setup cache + id: uv-cache + uses: https://git.ficd.sh/ficd/uv-cache@v1 + - name: build + run: | + uv sync + uv build + - name: publish + run: | + uv publish --token ${{ secrets.PYPI_TOKEN }} +