From 54327432fae98957576fc42f1f80c81cc39ad656 Mon Sep 17 00:00:00 2001 From: "Sam G." Date: Tue, 14 May 2024 22:05:02 -0700 Subject: [PATCH] rename to execlib, update package details --- README.md | 2 +- docs/conf.py | 2 +- docs/index.md | 14 +++++++------- execlib/__init__.py | 10 ++++++++++ {execlog => execlib}/event.py | 0 {execlog => execlib}/handler.py | 0 {execlog => execlib}/listener.py | 2 +- execlib/listeners/__init__.py | 1 + {execlog => execlib}/listeners/path.py | 8 ++++---- {execlog => execlib}/router.py | 6 +++--- execlib/routers/__init__.py | 1 + {execlog => execlib}/routers/path.py | 8 ++++---- {execlog => execlib}/server.py | 4 ++-- execlib/syncers/__init__.py | 1 + {execlog => execlib}/syncers/router.py | 8 ++++---- execlib/util/__init__.py | 2 ++ {execlog => execlib}/util/generic.py | 4 ++-- {execlog => execlib}/util/path.py | 0 execlog/__init__.py | 10 ---------- execlog/listeners/__init__.py | 1 - execlog/routers/__init__.py | 1 - execlog/syncers/__init__.py | 1 - execlog/util/__init__.py | 2 -- pyproject.toml | 12 ++++++------ requirements.txt | 21 --------------------- tests/test_listener.py | 8 ++++---- tests/test_router.py | 8 ++++---- tests/test_server.py | 4 ++-- 28 files changed, 60 insertions(+), 81 deletions(-) create mode 100644 execlib/__init__.py rename {execlog => execlib}/event.py (100%) rename {execlog => execlib}/handler.py (100%) rename {execlog => execlib}/listener.py (96%) create mode 100644 execlib/listeners/__init__.py rename {execlog => execlib}/listeners/path.py (99%) rename {execlog => execlib}/router.py (99%) create mode 100644 execlib/routers/__init__.py rename {execlog => execlib}/routers/path.py (96%) rename {execlog => execlib}/server.py (99%) create mode 100644 execlib/syncers/__init__.py rename {execlog => execlib}/syncers/router.py (97%) create mode 100644 execlib/util/__init__.py rename {execlog => execlib}/util/generic.py (96%) rename {execlog => execlib}/util/path.py (100%) delete mode 100644 execlog/__init__.py delete mode 100644 execlog/listeners/__init__.py delete mode 100644 execlog/routers/__init__.py delete mode 100644 execlog/syncers/__init__.py delete mode 100644 execlog/util/__init__.py delete mode 100644 requirements.txt diff --git a/README.md b/README.md index 2dbbc9e..ccba9bf 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Overview -`execlog` is a lightweight multi-threaded job framework written in Python. It implements a +`execlib` is a lightweight multi-threaded job framework written in Python. It implements a simple event-based model over core Python utilities like `ThreadPoolExecutor` to facilitate reactivity and manage concurrent responses. diff --git a/docs/conf.py b/docs/conf.py index 7f3a14b..918f027 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -6,7 +6,7 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = 'execlog' +project = 'execlib' copyright = '2024, Sam Griesemer' author = 'Sam Griesemer' diff --git a/docs/index.md b/docs/index.md index 071ffd9..833f1ae 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,4 +1,4 @@ -# `execlog` package docs +# `execlib` package docs {ref}`genindex` {ref}`modindex` {ref}`search` @@ -10,18 +10,18 @@ :nosignatures: :recursive: - execlog.Handler - execlog.Listener - execlog.Router - execlog.Server - execlog.listeners + execlib.Handler + execlib.Listener + execlib.Router + execlib.Server + execlib.listeners ``` ## Auto-reference contents ```{toctree} :maxdepth: 3 -_autoref/execlog.rst +_autoref/execlib.rst ``` ```{toctree} diff --git a/execlib/__init__.py b/execlib/__init__.py new file mode 100644 index 0000000..4e15b03 --- /dev/null +++ b/execlib/__init__.py @@ -0,0 +1,10 @@ +from execlib import util +from execlib import routers +from execlib import syncers +from execlib import listeners + +from execlib.server import Server +from execlib.handler import Handler +from execlib.listener import Listener +from execlib.event import Event, FileEvent +from execlib.router import Router, ChainRouter, Event, RouterBuilder, route diff --git a/execlog/event.py b/execlib/event.py similarity index 100% rename from execlog/event.py rename to execlib/event.py diff --git a/execlog/handler.py b/execlib/handler.py similarity index 100% rename from execlog/handler.py rename to execlib/handler.py diff --git a/execlog/listener.py b/execlib/listener.py similarity index 96% rename from execlog/listener.py rename to execlib/listener.py index 78807f2..209d536 100644 --- a/execlog/listener.py +++ b/execlib/listener.py @@ -5,7 +5,7 @@ See also: ''' import threading -from execlog.event import Event +from execlib.event import Event class Listener[E: Event](threading.Thread): diff --git a/execlib/listeners/__init__.py b/execlib/listeners/__init__.py new file mode 100644 index 0000000..7931bed --- /dev/null +++ b/execlib/listeners/__init__.py @@ -0,0 +1 @@ +from execlib.listeners.path import PathListener diff --git a/execlog/listeners/path.py b/execlib/listeners/path.py similarity index 99% rename from execlog/listeners/path.py rename to execlib/listeners/path.py index 1753715..ec41a67 100644 --- a/execlog/listeners/path.py +++ b/execlib/listeners/path.py @@ -8,10 +8,10 @@ from collections import defaultdict from colorama import Fore, Back, Style from inotify_simple import INotify, Event as iEvent, flags as iflags, masks as imasks -from execlog import util -from execlog.util.generic import color_text -from execlog.event import FileEvent -from execlog.listener import Listener +from execlib import util +from execlib.util.generic import color_text +from execlib.event import FileEvent +from execlib.listener import Listener logger = logging.getLogger(__name__) diff --git a/execlog/router.py b/execlib/router.py similarity index 99% rename from execlog/router.py rename to execlib/router.py index f58be06..de3eecf 100644 --- a/execlog/router.py +++ b/execlib/router.py @@ -18,9 +18,9 @@ from concurrent.futures import ThreadPoolExecutor, wait, as_completed from tqdm.auto import tqdm -from execlog.event import Event -from execlog.listener import Listener -from execlog.util.generic import color_text, get_func_name +from execlib.event import Event +from execlib.listener import Listener +from execlib.util.generic import color_text, get_func_name logger = logging.getLogger(__name__) diff --git a/execlib/routers/__init__.py b/execlib/routers/__init__.py new file mode 100644 index 0000000..d3861c0 --- /dev/null +++ b/execlib/routers/__init__.py @@ -0,0 +1 @@ +from execlib.routers.path import PathRouter diff --git a/execlog/routers/path.py b/execlib/routers/path.py similarity index 96% rename from execlog/routers/path.py rename to execlib/routers/path.py index 5d9a1f6..8c708a2 100644 --- a/execlog/routers/path.py +++ b/execlib/routers/path.py @@ -2,10 +2,10 @@ import logging from pathlib import Path from typing import Callable -from execlog.router import Router -from execlog.event import FileEvent -from execlog.util.path import glob_match -from execlog.listeners.path import PathListener +from execlib.router import Router +from execlib.event import FileEvent +from execlib.util.path import glob_match +from execlib.listeners.path import PathListener logger = logging.getLogger(__name__) diff --git a/execlog/server.py b/execlib/server.py similarity index 99% rename from execlog/server.py rename to execlib/server.py index afd90f0..0179235 100644 --- a/execlog/server.py +++ b/execlib/server.py @@ -26,8 +26,8 @@ from inotify_simple import flags from fastapi import FastAPI, WebSocket from fastapi.staticfiles import StaticFiles -from execlog.routers.path import PathRouter -from execlog.handler import Handler as LREndpoint +from execlib.routers.path import PathRouter +from execlib.handler import Handler as LREndpoint logger = logging.getLogger(__name__) diff --git a/execlib/syncers/__init__.py b/execlib/syncers/__init__.py new file mode 100644 index 0000000..a3aa68e --- /dev/null +++ b/execlib/syncers/__init__.py @@ -0,0 +1 @@ +from execlib.syncers.router import PathDiffer, PathRouterSyncer diff --git a/execlog/syncers/router.py b/execlib/syncers/router.py similarity index 97% rename from execlog/syncers/router.py rename to execlib/syncers/router.py index 1708360..a50dad1 100644 --- a/execlog/syncers/router.py +++ b/execlib/syncers/router.py @@ -10,10 +10,10 @@ from inotify_simple import flags as iflags from co3.resources import DiskResource from co3 import Differ, Syncer, Database -from execlog.event import Event -from execlog.router import CancelledFrameError -from execlog.routers import PathRouter -from execlog.util.generic import color_text +from execlib.event import Event +from execlib.router import CancelledFrameError +from execlib.routers import PathRouter +from execlib.util.generic import color_text logger = logging.getLogger(__name__) diff --git a/execlib/util/__init__.py b/execlib/util/__init__.py new file mode 100644 index 0000000..2f8faa9 --- /dev/null +++ b/execlib/util/__init__.py @@ -0,0 +1,2 @@ +from execlib.util import path +from execlib.util import generic diff --git a/execlog/util/generic.py b/execlib/util/generic.py similarity index 96% rename from execlog/util/generic.py rename to execlib/util/generic.py index 400c42c..f83848f 100644 --- a/execlog/util/generic.py +++ b/execlib/util/generic.py @@ -46,8 +46,8 @@ class ColorFormatter(logging.Formatter): formatter = self.FORMATS[submodule] name = record.name - if package == 'execlog': - name = f'execlog.{subsubmodule}' + if package == 'execlib': + name = f'execlib.{subsubmodule}' limit = 26 name = name[:limit] diff --git a/execlog/util/path.py b/execlib/util/path.py similarity index 100% rename from execlog/util/path.py rename to execlib/util/path.py diff --git a/execlog/__init__.py b/execlog/__init__.py deleted file mode 100644 index f3fde07..0000000 --- a/execlog/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -from execlog import util -from execlog import routers -from execlog import syncers -from execlog import listeners - -from execlog.server import Server -from execlog.handler import Handler -from execlog.listener import Listener -from execlog.event import Event, FileEvent -from execlog.router import Router, ChainRouter, Event, RouterBuilder, route diff --git a/execlog/listeners/__init__.py b/execlog/listeners/__init__.py deleted file mode 100644 index 0d01181..0000000 --- a/execlog/listeners/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from execlog.listeners.path import PathListener diff --git a/execlog/routers/__init__.py b/execlog/routers/__init__.py deleted file mode 100644 index 3ad6969..0000000 --- a/execlog/routers/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from execlog.routers.path import PathRouter diff --git a/execlog/syncers/__init__.py b/execlog/syncers/__init__.py deleted file mode 100644 index 104dcbb..0000000 --- a/execlog/syncers/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from execlog.syncers.router import PathDiffer, PathRouterSyncer diff --git a/execlog/util/__init__.py b/execlog/util/__init__.py deleted file mode 100644 index 5f3addb..0000000 --- a/execlog/util/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from execlog.util import path -from execlog.util import generic diff --git a/pyproject.toml b/pyproject.toml index 95af36c..2c5eff6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ description = "Lightweight multi-threaded job framework" readme = "README.md" requires-python = ">=3.12" dynamic = ["version"] -license = {file = "LICENSE"} +#license = {file = "LICENSE"} authors = [ { name="Sam Griesemer", email="samgriesemer+git@gmail.com" }, ] @@ -45,12 +45,12 @@ docs = [ ] [project.urls] -Homepage = "https://doc.olog.io/execlog" -Documentation = "https://doc.olog.io/execlog" -Repository = "https://git.olog.io/olog/execlog" -Issues = "https://git.olog.io/olog/execlog/issues" +Homepage = "https://doc.olog.io/execlib" +Documentation = "https://doc.olog.io/execlib" +Repository = "https://git.olog.io/olog/execlib" +Issues = "https://git.olog.io/olog/execlib/issues" [tool.setuptools.packages.find] -include = ["execlog*"] # pattern to match package names +include = ["execlib*"] # pattern to match package names diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index dbdbbfb..0000000 --- a/requirements.txt +++ /dev/null @@ -1,21 +0,0 @@ -# -- package-specific -- -fastapi -starlette -uvicorn -inotify_simple -tqdm -wcmatch -websockets - -# -- logging -- -colorama - -# -- sphinx docs -- -sphinx -sphinx-togglebutton -furo -myst-parser -sphinx-autodoc-typehints - -# -- testing --- -pytest diff --git a/tests/test_listener.py b/tests/test_listener.py index ad5217f..768f6bd 100644 --- a/tests/test_listener.py +++ b/tests/test_listener.py @@ -3,10 +3,10 @@ import logging from pathlib import Path from functools import partial -from execlog import util -from execlog import ChainRouter, Event -from execlog.routers import PathRouter -from execlog.listeners import PathListener +from execlib import util +from execlib import ChainRouter, Event +from execlib.routers import PathRouter +from execlib.listeners import PathListener logger = logging.getLogger() diff --git a/tests/test_router.py b/tests/test_router.py index 9b7d9b0..23427eb 100644 --- a/tests/test_router.py +++ b/tests/test_router.py @@ -3,10 +3,10 @@ from pathlib import Path from functools import partial from concurrent.futures import wait -from execlog import util -from execlog import ChainRouter, Event -from execlog.routers import PathRouter -from execlog.listeners import PathListener +from execlib import util +from execlib import ChainRouter, Event +from execlib.routers import PathRouter +from execlib.listeners import PathListener logger = logging.getLogger() diff --git a/tests/test_server.py b/tests/test_server.py index 9794331..7d6f5e8 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -4,8 +4,8 @@ import threading import logging from pathlib import Path -from execlog import Server -from execlog.routers import PathRouter +from execlib import Server +from execlib.routers import PathRouter logger = logging.getLogger()