Skip to content

Commit

Permalink
Adapt PyNinja naming project-wide
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Aug 10, 2024
1 parent 4a0b3a9 commit 59a7049
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 21 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# service-monitor
Service monitor for Linux and macOS
# PyNinja
Light weight OS agnostic service monitoring API
6 changes: 3 additions & 3 deletions monitor/__init__.py → pyninja/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import click

from monitor.main import start # noqa: F401
from pyninja.main import start # noqa: F401

version = "0.0.0-a"

Expand All @@ -21,7 +21,7 @@
help="Environment configuration filepath.",
)
def commandline(*args, **kwargs) -> None:
"""Starter function to invoke service-monitor via CLI commands.
"""Starter function to invoke PyNinja via CLI commands.
**Flags**
- ``--version | -V``: Prints the version.
Expand All @@ -46,7 +46,7 @@ def commandline(*args, **kwargs) -> None:
for k, v in options.items()
)
if kwargs.get("version"):
click.echo(f"service-monitor {version}")
click.echo(f"PyNinja {version}")
sys.exit(0)
if kwargs.get("help"):
click.echo(
Expand Down
2 changes: 1 addition & 1 deletion monitor/auth.py → pyninja/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from fastapi import Depends
from fastapi.security import HTTPBasicCredentials, HTTPBearer

from monitor import exceptions, squire
from pyninja import exceptions, squire

SECURITY = HTTPBearer()

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion monitor/main.py → pyninja/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import uvicorn
from fastapi import FastAPI

from monitor import router, squire
from pyninja import router, squire


def start(env_file: str = None) -> None:
Expand Down
8 changes: 4 additions & 4 deletions monitor/router.py → pyninja/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
from fastapi.responses import RedirectResponse
from fastapi.routing import APIRoute

from monitor import auth, exceptions, service
from pyninja import auth, exceptions, service

logging.getLogger("uvicorn.access").disabled = True
LOGGER = logging.getLogger("uvicorn.error")


async def service_monitor(service_name: str):
async def service_status(service_name: str):
"""API function to monitor a service."""
service_status = service.get_service_status(service_name)
LOGGER.info(
Expand All @@ -32,8 +32,8 @@ async def docs():

routes = [
APIRoute(
path="/service-monitor",
endpoint=service_monitor,
path="/status",
endpoint=service_status,
methods=["GET"],
dependencies=[Depends(auth.authenticator)],
),
Expand Down
2 changes: 1 addition & 1 deletion monitor/service.py → pyninja/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import psutil

from monitor import exceptions, squire
from pyninja import exceptions, squire

current_os = platform.system()

Expand Down
File renamed without changes.
19 changes: 10 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "PyNinja"
dynamic = ["version", "dependencies"]
description = "OS agnostic service monitoring API"
description = "Light weight OS agnostic service monitoring API"
readme = "README.md"
authors = [{ name = "Vignesh Rao", email = "[email protected]" }]
license = { file = "LICENSE" }
Expand All @@ -12,31 +12,32 @@ classifiers = [
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Topic :: System :: Monitoring",
]
keywords = ["service-monitor"]
keywords = ["service-monitor", "PyNinja"]
requires-python = ">=3.10"

[tool.setuptools]
packages = ["monitor"]

[tool.setuptools.dynamic]
version = {attr = "monitor.version"}
version = {attr = "pyninja.version"}
dependencies = { file = ["requirements.txt"] }

[project.optional-dependencies]
dev = ["sphinx==5.1.1", "pre-commit", "recommonmark", "gitverse"]

[project.scripts]
# sends all the args to commandline function, where the arbitary commands as processed accordingly
monitor = "monitor:commandline"
pyninja = "pyninja:commandline"

[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project.urls]
Homepage = "https://github.com/thevickypedia/service-monitor"
Docs = "https://thevickypedia.github.io/service-monitor"
Source = "https://github.com/thevickypedia/service-monitor"
"Bug Tracker" = "https://github.com/thevickypedia/service-monitor/issues"
"Release Notes" = "https://github.com/thevickypedia/service-monitor/blob/main/release_notes.rst"
Homepage = "https://github.com/thevickypedia/PyNinja"
Docs = "https://thevickypedia.github.io/PyNinja"
Source = "https://github.com/thevickypedia/PyNinja"
"Bug Tracker" = "https://github.com/thevickypedia/PyNinja/issues"
"Release Notes" = "https://github.com/thevickypedia/PyNinja/blob/main/release_notes.rst"

0 comments on commit 59a7049

Please sign in to comment.