Compare commits

...

2 Commits

Author SHA1 Message Date
54327432fa rename to execlib, update package details 2024-05-14 22:05:02 -07:00
e7b97e8b8c update pyproject.toml 2024-05-14 20:01:06 -07:00
29 changed files with 117 additions and 85 deletions

22
LICENSE Normal file
View File

@ -0,0 +1,22 @@
MIT License
Copyright (c) 2024 Sam Griesemer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -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.

View File

@ -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'

View File

@ -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}

10
execlib/__init__.py Normal file
View File

@ -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

View File

@ -5,7 +5,7 @@ See also:
'''
import threading
from execlog.event import Event
from execlib.event import Event
class Listener[E: Event](threading.Thread):

View File

@ -0,0 +1 @@
from execlib.listeners.path import PathListener

View File

@ -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__)

View File

@ -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__)

View File

@ -0,0 +1 @@
from execlib.routers.path import PathRouter

View File

@ -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__)

View File

@ -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__)

View File

@ -0,0 +1 @@
from execlib.syncers.router import PathDiffer, PathRouterSyncer

View File

@ -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__)

2
execlib/util/__init__.py Normal file
View File

@ -0,0 +1,2 @@
from execlib.util import path
from execlib.util import generic

View File

@ -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]

View File

@ -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

View File

@ -1 +0,0 @@
from execlog.listeners.path import PathListener

View File

@ -1 +0,0 @@
from execlog.routers.path import PathRouter

View File

@ -1 +0,0 @@
from execlog.syncers.router import PathDiffer, PathRouterSyncer

View File

@ -1,2 +0,0 @@
from execlog.util import path
from execlog.util import generic

View File

@ -1,25 +1,56 @@
[build-system]
requires = ["setuptools"]
requires = ["setuptools", "wheel", "setuptools-git-versioning>=2.0,<3"]
build-backend = "setuptools.build_meta"
# populates dynamically set version with latest git tag
[tool.setuptools-git-versioning]
enabled = true
[project]
name = "execlog"
version = "0.4.1"
authors = [
{ name="Sam Griesemer", email="samgriesemer@gmail.com" },
]
name = "execlib"
description = "Lightweight multi-threaded job framework"
readme = "README.md"
requires-python = ">=3.12"
dynamic = ["version"]
#license = {file = "LICENSE"}
authors = [
{ name="Sam Griesemer", email="samgriesemer+git@gmail.com" },
]
keywords = ["concurrent", "async", "inotify"]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
]
dependencies = [
"tqdm"
"tqdm",
"wcmatch",
"uvicorn",
"fastapi",
"colorama",
"starlette",
"inotify_simple",
]
[tool.setuptools.packages.find]
include = ["execlog*"] # pattern to match package names
[project.optional-dependencies]
tests = ["pytest", "websockets"]
docs = [
"sphinx",
"sphinx-togglebutton",
"sphinx-autodoc-typehints",
"furo",
"myst-parser",
]
[project.urls]
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 = ["execlib*"] # pattern to match package names

View File

@ -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

View File

@ -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()

View File

@ -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()

View File

@ -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()