From 370e7e4dc5c718eb8ec1b2274a5f01b9477b5899 Mon Sep 17 00:00:00 2001 From: Austreelis Date: Fri, 8 Sep 2023 16:01:03 +0200 Subject: [PATCH] Add scripts to run tools locally This adds a script for each executable, and a __main__.py for offpunk itself. This intends to "fix" (albeit unperfectly, see below) how 46f61bf forbade locally running executables without first installing offpunk in your site packages (or hacking on PYTHONPATH). Of those, most are "glue script", files in the top-level directory and outside offpunk's module, which are purely there to allow running the `netcache`, `ansicat` and `opnk` without any other setup than a working python and a `git clone`. Notably, they will not be included in the source distribution (sdist) archive built by flit. Sadly the `offpunk` executable doesn't get the same treatment, because having both an `offpunk.py` script and an `offpunk` python package is ambiguous, and flit disallows that, avoiding to package anything. So instead it now has a pretty bare __main__.py, which really works the same way as the "glue scripts", except this one does get packaged. This means everything but `offpunk` may be run like `./netcache.py`, making this setup a bit inconsistent (which may or may not be an issue). Running `python -m ` works for everything though, so there *is* a consistent way to run them all, and in the darkness, bind them. --- ansicat.py | 3 +++ netcache.py | 3 +++ offpunk/__main__.py | 3 +++ opnk.py | 3 +++ 4 files changed, 12 insertions(+) create mode 100755 ansicat.py create mode 100755 netcache.py create mode 100644 offpunk/__main__.py create mode 100755 opnk.py diff --git a/ansicat.py b/ansicat.py new file mode 100755 index 0000000..904525d --- /dev/null +++ b/ansicat.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 +from offpunk.ansicat import main +main() diff --git a/netcache.py b/netcache.py new file mode 100755 index 0000000..8e727dc --- /dev/null +++ b/netcache.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 +from offpunk.netcache import main +main() diff --git a/offpunk/__main__.py b/offpunk/__main__.py new file mode 100644 index 0000000..69141b8 --- /dev/null +++ b/offpunk/__main__.py @@ -0,0 +1,3 @@ +from . import main +main() + diff --git a/opnk.py b/opnk.py new file mode 100755 index 0000000..fdeec6f --- /dev/null +++ b/opnk.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 +from offpunk.opnk import main +main()