Compare commits
50 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5dd208a100 | ||
| 18b7e10631 | |||
| 07106f1816 | |||
|
115deaab4b
|
|||
|
8d2b8f9519
|
|||
|
f365139e9f
|
|||
|
cc6b650f5c
|
|||
|
faf1f4eeee
|
|||
|
61a607c20e
|
|||
|
fe7d78c1c8
|
|||
|
cee30251dd
|
|||
|
721ab87e71
|
|||
|
1211ca2029
|
|||
|
5024862165
|
|||
|
6f5fa33a12
|
|||
|
f0eeeb79a1
|
|||
|
|
6ef3f58d73 | ||
| 8f97bea0e9 | |||
| a2d1669179 | |||
|
66db11c40b
|
|||
|
d96fec0222
|
|||
|
6bbb152ae1
|
|||
|
b14541ea83
|
|||
|
7d36e6e431
|
|||
|
98c49b1d0d
|
|||
|
377a846c59
|
|||
|
a27b5b1275
|
|||
|
19aa80a08e
|
|||
|
a1b28faa9f
|
|||
|
df0b19d943
|
|||
|
b68c755c45
|
|||
|
0d074adc0d
|
|||
|
f2b4811145
|
|||
|
2922123a70
|
|||
|
d5985cf594
|
|||
|
b9fd84d08f
|
|||
|
f7f6f19808
|
|||
|
ac7799213c
|
|||
|
54512d8393
|
|||
|
c0ad91b22f
|
|||
|
b9a7c2bdaf
|
|||
|
ac66ce1999
|
|||
|
2ecd32decc
|
|||
|
1c96390f3c
|
|||
|
c0cacfad2d
|
|||
|
cafef5ed93
|
|||
|
b5670e5d2c
|
|||
|
639e1f73a0
|
|||
|
4e16a70174
|
|||
|
4aa2ca426c
|
84
CHANGELOG.md
84
CHANGELOG.md
@@ -2,6 +2,90 @@
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [0.4.0] - 2025-11-30
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- [`115deaa`](https://github.com/pufereq/template-repo/commit/115deaab4b0aaa9f0d3577be56e64fa3bb03f76b) **backend_server.py**: use unused `packet_size` argument to `_receive_inbound()`
|
||||
- [`cc6b650`](https://github.com/pufereq/template-repo/commit/cc6b650f5cd1f3889c251fbe7b36c681be48b2a0) **backend_server.py**: import Any from typing
|
||||
- [`5024862`](https://github.com/pufereq/template-repo/commit/50248621650590c17fcf96c0cec9618a2b0dd07c) **backend_server.py**: add 1ms sleep to prevent 100% CPU usage in `_loop()`
|
||||
- [`f0eeeb7`](https://github.com/pufereq/template-repo/commit/f0eeeb79a188548c3f306f4bc875bacc6fd89588) **backend_server.py**: handle unregister exceptions
|
||||
|
||||
### Features
|
||||
|
||||
- [`6f5fa33`](https://github.com/pufereq/template-repo/commit/6f5fa33a122e9ebdf9df91628be67721cfc031e3) **backend_server.py**: handle all other client Exceptions in `_handle_connection()`
|
||||
|
||||
### Refactor
|
||||
|
||||
- [`8d2b8f9`](https://github.com/pufereq/template-repo/commit/8d2b8f9519bb809df45ba79ea53f12775c3097d4) **backend_server.py**: change log levels
|
||||
- [`faf1f4e`](https://github.com/pufereq/template-repo/commit/faf1f4eeee341f5f8d234dc7d93ae5c86e276217) **backend_server.py**: remove unused argument in `BackendServer._send_outbound()`
|
||||
- [`61a607c`](https://github.com/pufereq/template-repo/commit/61a607c20e205c18e60a9b26f6fb3c37a47d6a55) wip
|
||||
|
||||
### Styling
|
||||
|
||||
- [`f365139`](https://github.com/pufereq/template-repo/commit/f365139e9f064de309f655296b99868833ba7dce) **backend_server.py**: ignore type error in `_handle_connection()`
|
||||
|
||||
### Build
|
||||
|
||||
- [`fe7d78c`](https://github.com/pufereq/template-repo/commit/fe7d78c1c8cd1d0e13276ce82549ee97b896aff0) **uv.lock**: update judas_protocol to 0.5.0
|
||||
- [`cee3025`](https://github.com/pufereq/template-repo/commit/cee30251ddb87b1f3ca84d0f3c8cf40fb37debcc) **uv.lock**: update judas_protocol to 0.4.3
|
||||
- [`721ab87`](https://github.com/pufereq/template-repo/commit/721ab87e7156045703f55ecefc6ed3e15ffa36aa) **uv.lock**: update judas_protocol to 0.3.0
|
||||
- [`1211ca2`](https://github.com/pufereq/template-repo/commit/1211ca20294dcc3907dbadfee4b294cf7e24a8f9) **uv.lock**: update judas_protocol to 0.2.0
|
||||
|
||||
## [0.3.0] - 2025-09-19
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- [`b68c755`](https://github.com/pufereq/template-repo/commit/b68c755c450c7b13f95b335fc93810847306708c) **backend_server.py**: send ack on connect
|
||||
- [`2922123`](https://github.com/pufereq/template-repo/commit/2922123a7050a9438b024067ebad2901adb84fe3) **backend/__init__.py**: fix backend_server import
|
||||
- [`c0cacfa`](https://github.com/pufereq/template-repo/commit/c0cacfad2d13799d3472a5d033ae15fd668401f9) **backend_server.py**: fix server waiting for closed socket to dissapear by reusing it in `__init__()`
|
||||
|
||||
### Documentation
|
||||
|
||||
- [`b9a7c2b`](https://github.com/pufereq/template-repo/commit/b9a7c2bdaf4be8dcea4c6f3196a6092f76eac183) **backend_server.py**: add TODO in `_handle_connection()`
|
||||
|
||||
### Features
|
||||
|
||||
- [`df0b19d`](https://github.com/pufereq/template-repo/commit/df0b19d94361f63d7ae3def51e3f9360242755b7) **routes/api.py**: support mulitple clients correctly
|
||||
- [`f2b4811`](https://github.com/pufereq/template-repo/commit/f2b4811145a0a45b2a866aefb095f833c8cb50ae) **backend_server.py**: add `BackendServer._send_ack()` helper method
|
||||
- [`d5985cf`](https://github.com/pufereq/template-repo/commit/d5985cf5945a304505546ef733631bc33d004621) **__main__.py**: display ascii judas splash screen on launch
|
||||
- [`b9fd84d`](https://github.com/pufereq/template-repo/commit/b9fd84d08f24bb21e51b48b529f62bfe2671c895) **gaga.py**: add Lady Gaga's Born This Way album art ASCII
|
||||
- [`c0ad91b`](https://github.com/pufereq/template-repo/commit/c0ad91b22f0e011da1021ead1c126a94aaf90f44) **backend_server.py**: re-add the `get_client_data()` method
|
||||
- [`2ecd32d`](https://github.com/pufereq/template-repo/commit/2ecd32decce95e6aec74433ef3255bc4cf3c3988) **client.py**: add `Client` class
|
||||
- [`1c96390`](https://github.com/pufereq/template-repo/commit/1c96390f3cade804b2667bb69bec4419703a6d56) **backend_server.py**: add error handling for HELLO message handler in `_accept_connection()`
|
||||
- [`639e1f7`](https://github.com/pufereq/template-repo/commit/639e1f73a07286bce1a1ef227d216a722e3fa214) **server.py**: add socket-based communication
|
||||
|
||||
### Miscellaneous Tasks
|
||||
|
||||
- [`54512d8`](https://github.com/pufereq/template-repo/commit/54512d8393a32f59a9aaddf5a52cb18ee9986fdf) **routes/api.py**: adapt `emit_polled_data()` for `Client` class
|
||||
- [`ac66ce1`](https://github.com/pufereq/template-repo/commit/ac66ce19998a4518a346b6608645486121cd2123) **backend_server.py**: set `Client.last_seen` on message receive
|
||||
|
||||
### Refactor
|
||||
|
||||
- [`0d074ad`](https://github.com/pufereq/template-repo/commit/0d074adc0d441428baac6858ff57717f3164cf6a) **backend_server.py**: use `_send_ack()` in `_handle_connection()`
|
||||
- [`ac77992`](https://github.com/pufereq/template-repo/commit/ac7799213cba82dbb189919873130647d7c87a78) **__main__.py**: provide `host` and `port` args to `BackendServer` explicitly
|
||||
- [`b5670e5`](https://github.com/pufereq/template-repo/commit/b5670e5d2cf08a031b99478de57aa53cba78bd5b) **server.py**: rename `server.py` to `backend_server.py` for clarity
|
||||
|
||||
### Styling
|
||||
|
||||
- [`6bbb152`](https://github.com/pufereq/template-repo/commit/6bbb152ae1b1178aa77cf54c6e0f544a0fed66ef) **panel.py**: order imports
|
||||
- [`b14541e`](https://github.com/pufereq/template-repo/commit/b14541ea8302679091b519e3b6f630fabc0ce476) **index.py**: order imports
|
||||
- [`7d36e6e`](https://github.com/pufereq/template-repo/commit/7d36e6e43132a687d0494f14f36d9b4dc357abaf) **auth.py**: order imports
|
||||
- [`98c49b1`](https://github.com/pufereq/template-repo/commit/98c49b1d0d9bb7653a12c7558b5e6daf62a7762b) **api.py**: order imports
|
||||
- [`377a846`](https://github.com/pufereq/template-repo/commit/377a846c5982be129724a84b4b77a6fb69fd03df) **client.py**: order imports
|
||||
- [`a27b5b1`](https://github.com/pufereq/template-repo/commit/a27b5b1275fadfb2049fa5e5c535b6667ae37ab5) **backend_server.py**: order imports
|
||||
- [`19aa80a`](https://github.com/pufereq/template-repo/commit/19aa80a08ebe65685209678b5daf061ffbf19840) **__main__.py**: order imports
|
||||
- [`f7f6f19`](https://github.com/pufereq/template-repo/commit/f7f6f19808b19ae95bc361d00123a13c4afd344d) **__main__.py**: organize imports
|
||||
- [`cafef5e`](https://github.com/pufereq/template-repo/commit/cafef5ed932ea5456260398b44e42d71702a386a) **backend_server.py**: remove unused imports
|
||||
|
||||
### Build
|
||||
|
||||
- [`66db11c`](https://github.com/pufereq/template-repo/commit/66db11c40b34d5315eda2a7dc19cd8ae428ae862) add ruff lint depedency
|
||||
- [`d96fec0`](https://github.com/pufereq/template-repo/commit/d96fec0222bbf707bc1aa48a6d215dbfec93f159) **web_server.py**: order imports
|
||||
- [`a1b28fa`](https://github.com/pufereq/template-repo/commit/a1b28faa9ff30ddf9da4e882c0bbac27f4863480) add isort as lint depedency
|
||||
- [`4e16a70`](https://github.com/pufereq/template-repo/commit/4e16a70174a4492ec59a2ff356deddd758e3e6e1) **uv.lock**: add depedency on judas_protocol
|
||||
- [`4aa2ca4`](https://github.com/pufereq/template-repo/commit/4aa2ca426c2ae3ac29724f70aa9a07e7eb5a723b) **pyproject.toml**: add depedency on judas_protocol
|
||||
|
||||
## [0.2.0] - 2025-08-26
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
||||
|
||||
[project]
|
||||
name = "judas_server"
|
||||
version = "0.2.0"
|
||||
version = "0.4.0"
|
||||
description = "The backbone of the remote PC fleet management system."
|
||||
readme = "README.md"
|
||||
authors = []
|
||||
@@ -13,11 +13,16 @@ dependencies = [
|
||||
"flask>=3.1.1",
|
||||
"flask-login>=0.6.3",
|
||||
"flask-socketio>=5.5.1",
|
||||
"judas-protocol",
|
||||
]
|
||||
license = { text = "GPL-3.0+" }
|
||||
|
||||
[dependency-groups]
|
||||
bump = ["git-cliff>=2.9.1", "python-semantic-release>=10.2.0"]
|
||||
lint = [
|
||||
"isort>=6.0.1",
|
||||
"ruff>=0.13.1",
|
||||
]
|
||||
test = [
|
||||
"pytest>=4.2.1",
|
||||
"pytest-cov>=6.2.1",
|
||||
@@ -85,3 +90,6 @@ allowed_tags = [
|
||||
minor_tags = ["feat"]
|
||||
patch_tags = ["fix", "perf"]
|
||||
default_bump_level = 0
|
||||
|
||||
[tool.uv.sources]
|
||||
judas-protocol = { git = "https://gitea.pufereq.pl/judas/judas_protocol.git" }
|
||||
|
||||
@@ -3,15 +3,22 @@
|
||||
import logging as lg
|
||||
|
||||
if __name__ == "__main__":
|
||||
from judas_server.web.web_server import JudasWebServer
|
||||
from judas_server.backend import BackendServer
|
||||
from judas_server.gaga import LADY_GAGA
|
||||
from judas_server.web.web_server import JudasWebServer
|
||||
|
||||
lg.basicConfig(
|
||||
level=lg.DEBUG,
|
||||
format="%(asctime)s : [%(levelname)s] : %(threadName)s : %(name)s :: %(message)s",
|
||||
)
|
||||
|
||||
backend_server: BackendServer = BackendServer()
|
||||
ladygaga_logger = lg.getLogger(f"{__name__}.LAGA_DYGA")
|
||||
ladygaga_logger.info(LADY_GAGA)
|
||||
|
||||
backend_server: BackendServer = BackendServer(
|
||||
host="0.0.0.0",
|
||||
port=3692,
|
||||
)
|
||||
backend_server.run()
|
||||
|
||||
web_server: JudasWebServer = JudasWebServer(
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
from .server import BackendServer
|
||||
from .backend_server import BackendServer
|
||||
|
||||
__all__ = ["BackendServer"]
|
||||
|
||||
269
src/judas_server/backend/backend_server.py
Normal file
269
src/judas_server/backend/backend_server.py
Normal file
@@ -0,0 +1,269 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import annotations
|
||||
|
||||
import logging as lg
|
||||
import selectors
|
||||
import socket
|
||||
import threading
|
||||
import time
|
||||
|
||||
from typing import Any
|
||||
|
||||
from judas_protocol import Category, ControlAction, Message
|
||||
|
||||
from judas_server.backend.client import Client
|
||||
|
||||
|
||||
class BackendServer:
|
||||
def __init__(self, host: str = "0.0.0.0", port: int = 3692) -> None:
|
||||
"""Initialize the backend server.
|
||||
|
||||
Args:
|
||||
host (str): The host IP address to bind the server to.
|
||||
port (int): The port number to bind the server to.
|
||||
"""
|
||||
self.logger: lg.Logger = lg.getLogger(
|
||||
f"{__name__}.{self.__class__.__name__}"
|
||||
)
|
||||
self.logger.debug("Initializing Server...")
|
||||
|
||||
self.selector = selectors.DefaultSelector()
|
||||
self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
self.server_socket.setsockopt(
|
||||
socket.SOL_SOCKET, socket.SO_REUSEADDR, 1
|
||||
)
|
||||
self._bind_socket(host, port)
|
||||
self.server_socket.listen()
|
||||
self.server_socket.setblocking(False)
|
||||
self.selector.register(
|
||||
self.server_socket, selectors.EVENT_READ, data=None
|
||||
)
|
||||
|
||||
self.clients: dict[str, Client] = {}
|
||||
|
||||
self.running: bool = False
|
||||
|
||||
def _bind_socket(self, host: str, port: int) -> None:
|
||||
"""Bind the server socket to the specified host and port.
|
||||
|
||||
Args:
|
||||
host (str): The host IP address to bind the server to.
|
||||
port (int): The port number to bind the server to.
|
||||
"""
|
||||
self.logger.debug(f"Binding socket to {host}:{port}")
|
||||
while True:
|
||||
try:
|
||||
self.server_socket.bind((host, port))
|
||||
self.logger.debug(f"Socket bound to {host}:{port}")
|
||||
break
|
||||
except OSError as e:
|
||||
self.logger.error(
|
||||
f"Failed to bind socket to {host}:{port}, retrying...: {e}"
|
||||
)
|
||||
time.sleep(1)
|
||||
|
||||
def _send_ack(self, client: Client, target_id: str) -> None:
|
||||
"""Send an ACK message to a client.
|
||||
|
||||
Args:
|
||||
client (Client): The client to send the ACK to.
|
||||
target_id (str): The id of the ACK'd message.
|
||||
"""
|
||||
ack: bytes = Message.ack(target_id=target_id).to_bytes()
|
||||
self.logger.info(f"[>] Sending ACK to {client}")
|
||||
client.outbound += ack
|
||||
|
||||
def _accept_connection(self, sock: socket.socket) -> None:
|
||||
"""Accept a new client connection.
|
||||
|
||||
Args:
|
||||
sock (socket.socket): The selected socket.
|
||||
"""
|
||||
conn, addr = sock.accept()
|
||||
self.logger.info(f"[+] Accepted connection from {addr}")
|
||||
|
||||
client = Client(mac_id=None, addr=addr, socket=conn)
|
||||
|
||||
events = selectors.EVENT_READ | selectors.EVENT_WRITE
|
||||
self.selector.register(conn, events, data=client)
|
||||
|
||||
self.logger.info(f"[+] Registered client {client}, HELLO pending...")
|
||||
|
||||
def _disconnect(self, client: Client) -> None:
|
||||
"""Disconnect a client and clean up resources.
|
||||
|
||||
Args:
|
||||
sock (socket.socket): The client socket to disconnect.
|
||||
"""
|
||||
self.logger.info(f"[-] Disconnecting {client}...")
|
||||
self.logger.debug("[*] Sending DNR message...")
|
||||
|
||||
try:
|
||||
self.selector.unregister(client.socket)
|
||||
except Exception as e:
|
||||
self.logger.error(f"Error unregistering client {client}: {e}")
|
||||
|
||||
client.disconnect()
|
||||
|
||||
def _send_outbound(self, sock: socket.socket, client: Client) -> None:
|
||||
"""Queue data to be sent to a client.
|
||||
|
||||
Args:
|
||||
client (Client): The client to send data to.
|
||||
"""
|
||||
self.logger.debug(f"[>] Sending data to {client}: {client.outbound!r}")
|
||||
sent = sock.send(client.outbound)
|
||||
|
||||
client.outbound = client.outbound[sent:]
|
||||
|
||||
def _receive_inbound(
|
||||
self, sock: socket.socket, client: Client, packet_size: int = 4096
|
||||
) -> None:
|
||||
"""Receive data from a client socket.
|
||||
|
||||
Args:
|
||||
sock (socket.socket): The client socket to receive data from.
|
||||
client (Client): The client object.
|
||||
packet_size (int): The maximum amount of data to be received at once.
|
||||
Returns:
|
||||
bytes: The received data.
|
||||
"""
|
||||
recv_data = sock.recv(packet_size)
|
||||
if recv_data:
|
||||
self.logger.debug(
|
||||
f"[<] Received data from {client}: {recv_data!r}"
|
||||
)
|
||||
client.inbound += recv_data
|
||||
|
||||
# set last seen
|
||||
client.last_seen = time.time()
|
||||
else:
|
||||
self._disconnect(client)
|
||||
|
||||
def _handle_connection(
|
||||
self, key: selectors.SelectorKey, mask: int
|
||||
) -> None:
|
||||
"""Handle a client connection.
|
||||
|
||||
Args:
|
||||
key (selectors.SelectorKey): The selector key for the client.
|
||||
mask (int): The event mask.
|
||||
"""
|
||||
sock: socket.socket = key.fileobj # type: ignore
|
||||
client = key.data
|
||||
|
||||
try:
|
||||
if mask & selectors.EVENT_READ:
|
||||
self._receive_inbound(sock, client)
|
||||
if client.inbound:
|
||||
if client.mac_id is None:
|
||||
# expect HELLO message
|
||||
try:
|
||||
msg = Message.from_bytes(client.inbound)
|
||||
if (
|
||||
msg.category == Category.CONTROL
|
||||
and msg.action == ControlAction.HELLO
|
||||
and msg.payload.get("mac") is not None
|
||||
):
|
||||
client.mac_id = msg.payload["mac"]
|
||||
if (
|
||||
client.mac_id in self.clients
|
||||
and self.clients[client.mac_id].status
|
||||
== "connected"
|
||||
):
|
||||
old_client: Client = self.clients[
|
||||
client.mac_id
|
||||
]
|
||||
self.logger.warning(
|
||||
f"Client {client.mac_id} is already connected from {old_client.addr}, disconnecting old client..."
|
||||
)
|
||||
self._disconnect(old_client)
|
||||
# TODO: tell client not to reconnect
|
||||
self.clients[client.mac_id] = client
|
||||
self.logger.info(
|
||||
f"[+] Registered new client {client}"
|
||||
)
|
||||
else:
|
||||
self.logger.error(
|
||||
f"Expected HELLO message from {client}, got {msg}"
|
||||
)
|
||||
self._disconnect(client)
|
||||
return
|
||||
except Exception as e:
|
||||
self.logger.error(
|
||||
f"Failed to parse HELLO message from {client}: {e}"
|
||||
)
|
||||
self._disconnect(client)
|
||||
return
|
||||
|
||||
while b"\n" in client.inbound:
|
||||
line, client.inbound = client.inbound.split(b"\n", 1)
|
||||
self.logger.debug(
|
||||
f"[<] Complete message from {client}: {line!r}"
|
||||
)
|
||||
try:
|
||||
msg = Message.from_bytes(line)
|
||||
self.logger.info(f"[.] Parsed message {msg.id}")
|
||||
if msg.ack_required:
|
||||
self._send_ack(client, target_id=msg.id)
|
||||
|
||||
except Exception as e:
|
||||
self.logger.error(
|
||||
f"Failed to parse message from {client}: {e}"
|
||||
)
|
||||
self._disconnect(client)
|
||||
return
|
||||
|
||||
else:
|
||||
self._disconnect(client)
|
||||
|
||||
if mask & selectors.EVENT_WRITE:
|
||||
if client.outbound:
|
||||
self._send_outbound(sock, client)
|
||||
|
||||
except ConnectionResetError as e:
|
||||
self.logger.error(f"Connection reset by {client}, disconnect: {e}")
|
||||
self._disconnect(client)
|
||||
except Exception as e:
|
||||
self.logger.error(f"Connection error for {client}: {e}")
|
||||
self._disconnect(client)
|
||||
|
||||
def run(self) -> None:
|
||||
"""Start the backend server."""
|
||||
self.running = True
|
||||
threading.Thread(
|
||||
name="BackendServer thread", target=self._loop, daemon=True
|
||||
).start()
|
||||
|
||||
def _loop(self) -> None:
|
||||
"""Main server loop to handle incoming connections and data."""
|
||||
self.logger.info("Server is running...")
|
||||
try:
|
||||
while self.running:
|
||||
events = self.selector.select(timeout=1)
|
||||
for key, mask in events:
|
||||
if key.data is None:
|
||||
self._accept_connection(key.fileobj) # type: ignore
|
||||
else:
|
||||
self._handle_connection(key, mask)
|
||||
time.sleep(0.001) # prevent 100% CPU usage
|
||||
|
||||
except Exception as e:
|
||||
self.logger.error(f"Server error: {e}")
|
||||
raise e
|
||||
finally:
|
||||
self.selector.close()
|
||||
self.server_socket.close()
|
||||
self.logger.info("Server has stopped.")
|
||||
|
||||
def get_client_data(self, client_id: str) -> dict[str, Any] | None:
|
||||
client: Client | None = self.clients.get(client_id, None)
|
||||
if client is None:
|
||||
self.logger.warning(f"Client {client_id} not found")
|
||||
return None
|
||||
return {
|
||||
"id": client.mac_id,
|
||||
"addr": client.addr,
|
||||
"last_seen": client.last_seen,
|
||||
"status": client.status,
|
||||
}
|
||||
58
src/judas_server/backend/client.py
Normal file
58
src/judas_server/backend/client.py
Normal file
@@ -0,0 +1,58 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Client representation."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging as lg
|
||||
import socket
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class ClientStatus(str, Enum):
|
||||
CONNECTED = "connected"
|
||||
DISCONNECTED = "disconnected"
|
||||
|
||||
|
||||
class Client:
|
||||
"""Represents a client."""
|
||||
|
||||
def __init__(
|
||||
self, mac_id: str | None, addr: tuple[str, int], socket: socket.socket
|
||||
) -> None:
|
||||
"""Initialize the client.
|
||||
|
||||
Args:
|
||||
mac_id (str | None): The unique identifier for the client.
|
||||
Can be None if not yet assigned.
|
||||
addr (tuple[str, int]): The (IP, port) address of the client.
|
||||
socket (socket.socket): The socket object for communication.
|
||||
"""
|
||||
self.logger: lg.Logger = lg.getLogger(
|
||||
f"{__name__}.{self.__class__.__name__}"
|
||||
)
|
||||
self.logger.debug(f"Initializing Client {addr}...")
|
||||
|
||||
self.mac_id: str | None = mac_id
|
||||
self.last_seen: float = 0.0 # unix timestanp of last inbound message
|
||||
self.status: ClientStatus = ClientStatus.CONNECTED
|
||||
|
||||
self.socket: socket.socket = socket
|
||||
self.addr: tuple[str, int] = addr
|
||||
self.inbound: bytes = b""
|
||||
self.outbound: bytes = b""
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"Client({self.mac_id} ({self.addr[0]}:{self.addr[1]}))"
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"Client({self.mac_id}, {self.addr})"
|
||||
|
||||
def disconnect(self) -> None:
|
||||
"""Disconnect the client and close the socket."""
|
||||
self.logger.debug(f"Disconnecting Client {self}...")
|
||||
try:
|
||||
self.socket.close()
|
||||
except Exception as e:
|
||||
self.logger.error(f"Error closing socket for Client {self}: {e}")
|
||||
self.status = ClientStatus.DISCONNECTED
|
||||
self.logger.info(f"Client {self} disconnected.")
|
||||
@@ -1,54 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
import logging as lg
|
||||
import random as rn
|
||||
import threading
|
||||
import time
|
||||
|
||||
|
||||
class BackendServer:
|
||||
def __init__(self) -> None:
|
||||
self.logger: lg.Logger = lg.getLogger(
|
||||
f"{__name__}.{self.__class__.__name__}"
|
||||
)
|
||||
self.logger.debug("Initializing Server...")
|
||||
|
||||
# TODO: add socket logic here
|
||||
|
||||
self.clients: dict[str, dict[str, dict[str, Any]]] = {
|
||||
"C_01": {
|
||||
"one_time": {
|
||||
"hostname": "mock-host",
|
||||
"platform": "windows 11",
|
||||
"cpu_info": "i7",
|
||||
},
|
||||
"polled": {"cpu_usage": 0, "ram_usage": 0},
|
||||
"ondemand": {},
|
||||
}
|
||||
}
|
||||
|
||||
self.running: bool = False
|
||||
|
||||
def run(self) -> None:
|
||||
self.running = True
|
||||
threading.Thread(
|
||||
name="BackendServer thread", target=self._loop, daemon=True
|
||||
).start()
|
||||
|
||||
def _loop(self) -> None:
|
||||
self.logger.info("Starting server loop...")
|
||||
while self.running:
|
||||
for client in self.clients.values():
|
||||
client["polled"]["cpu_usage"] = round(rn.uniform(0, 100), 1)
|
||||
client["polled"]["ram_usage"] = round(rn.uniform(0, 100), 1)
|
||||
time.sleep(1)
|
||||
|
||||
self.logger.info("Server loop stopped.")
|
||||
|
||||
def get_client_data(
|
||||
self, client_id: str
|
||||
) -> dict[str, dict[str, Any]] | None:
|
||||
return self.clients.get(client_id, None)
|
||||
43
src/judas_server/gaga.py
Normal file
43
src/judas_server/gaga.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""ASCII art of Lady Gaga's Born This Way album cover."""
|
||||
|
||||
from judas_server import __version__
|
||||
|
||||
LADY_GAGA: str = """
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢔⢑⠔⡁⡂⢅⠢⠃⢆⢊⠜⡩⠳⣕⣙⡪⡪⡢⣫⢺⢔⢵⢱⢕⢮⢮⢺⡢⢕⠕⡽⣘⢜⠳⣌⢢⠀⠀⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⢰⣶⣆⢰⠰⡄⢢⣶⣶⢐⠂⡑⡐⢆⢊⠔⠌⢌⢂⠢⠡⢂⠅⢍⢲⣉⡙⢜⡘⢎⣗⢵⢕⡕⡧⡳⡹⣮⣫⢺⢼⡪⣮⡳⡜⡮⡙⠤⠄⢂⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠈⠉⢽⡫⠉⡏⡏⠉⠍⡏⡉⢋⡍⣇⢕⢨⡈⡔⡠⠁⠕⡀⡈⠄⠠⡀⠍⠜⠜⡪⣚⡎⢏⢯⢞⡽⣺⡺⡮⡷⣝⣗⢽⢽⣽⢽⢶⢦⡨⠌⢔⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⡠⠨⡪⡹⡸⡑⡕⡑⢄⠕⠄⠔⡈⠜⡈⡂⡂⢅⠁⢂⢅⡪⡨⠒⡜⡾⣘⡪⡣⡻⣷⡻⣯⢿⡺⣗⡿⣽⢽⡽⣞⡽⡫⢷⣆⠑⡄⢀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⡀⠄⡕⣪⢞⢜⠌⡎⢜⠔⡡⢊⢰⢌⠎⡐⢄⢎⢢⡁⣂⠥⣌⢪⢪⡱⡹⡵⣎⢮⢯⡸⢝⣾⡽⣞⣿⠺⢝⣯⣿⢯⡳⡝⣄⠊⠻⢬⡢⣑⡀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠠⡐⣼⣪⢯⢽⠢⡃⢊⠊⠜⢬⡢⣟⢮⡣⣕⢵⣱⢵⢵⣳⢯⡷⣯⣞⣞⡮⡯⣗⡯⡪⡫⣎⢷⣻⣿⣺⡿⣼⡿⣝⢽⡷⣝⢆⠁⠀⠈⠝⣖⢦⠀⠀
|
||||
⠀⠀⠀⠀⢀⠨⠰⡱⡵⣯⢿⡝⢌⢐⠀⠂⠨⡠⢹⣺⡵⣳⢕⣯⢾⣻⡯⣿⣻⣿⣽⣾⣟⣿⣯⢿⡽⣳⢵⢕⡯⡿⣾⡮⣿⡿⣮⡫⣷⡻⣟⣧⡑⡐⢀⠐⡸⣕⡇⠠
|
||||
⠀⠀⡀⠐⠄⠅⢕⢝⣽⣻⣯⡇⢅⠢⣁⡊⠆⢜⣮⡺⡽⣺⢽⣞⣿⣽⣟⣯⣿⣾⢿⣾⣿⣽⣾⣿⡽⣯⢿⢽⣯⣻⡽⣿⣟⣿⡸⡹⣷⣯⣟⣯⣷⡄⡂⠀⡍⡖⡷⠀
|
||||
⠐⠀⠀⠨⠀⡘⡌⡇⡗⣟⡾⡊⢔⠅⡆⡌⡪⡘⣮⣞⢿⢽⢽⣺⡿⣾⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⡽⣯⣟⡾⣜⣿⣿⢽⣺⣇⠢⡙⣽⣾⣟⣿⣟⣆⠢⡸⡵⢼⣂
|
||||
⠀⠀⢀⠠⠁⢜⠌⢌⠪⢪⡫⣎⢆⢇⢧⠪⡐⡘⡮⡿⡽⠹⡙⢕⣛⢿⣻⣿⢿⣻⣽⣿⣿⢿⣿⠿⣟⣿⢵⣷⣻⣪⣾⣟⡿⣯⣷⢑⢸⢸⡽⣿⣜⡿⣟⣞⠁⣳⢽⢯
|
||||
⠀⠀⠀⠠⢨⢪⢈⠄⡑⡑⣕⢇⢇⢇⢧⢣⡓⣌⠊⡁⠀⠀⡈⢄⠀⠛⡾⡽⣻⣿⣻⣻⣺⠋⠁⠁⠀⠀⢏⢺⣾⣼⡏⡾⣿⣽⣾⢯⡢⡱⡱⣻⣧⢻⣿⣿⡜⣜⢿⡧
|
||||
⠀⠀⡈⡌⡌⡂⡢⢐⢈⠆⡣⢪⢮⢣⡣⢇⢯⡪⡲⣐⠐⠝⡌⣎⠾⠦⠭⡎⣗⣷⡃⢧⠥⠺⠪⢅⠝⠂⢹⣨⣷⣿⣳⢝⣽⣿⣽⣯⣗⣗⢕⢯⣿⡸⣿⣿⢿⣇⣻⣇
|
||||
⢠⢧⣫⢵⢕⢗⡊⢆⠢⡊⠔⣹⢪⣳⢱⢩⢇⢯⡳⣝⢽⣳⣖⣶⢽⡯⣗⢕⣗⣟⡮⡪⣺⣻⣷⣶⢶⡿⣽⣳⣿⣿⣧⣛⣾⣿⣷⣟⣷⣯⣳⡺⣿⡥⢼⣿⣿⣷⢸⣷
|
||||
⢯⢿⢽⣝⢵⢱⣱⠵⡑⡌⢎⡞⡕⡵⡱⡑⡭⡳⡹⡮⣳⢳⣟⣾⣿⣯⡟⡮⣞⣯⣿⢜⠮⣷⣿⣾⣿⣿⣿⣯⣿⡿⣿⣶⢫⣿⣿⣽⣿⣷⣗⢿⣿⡗⡒⣿⣿⣻⣿⣿
|
||||
⣻⡫⣳⢕⡷⡝⡎⡮⡪⡊⢢⠱⡱⢱⢱⠱⡸⡸⣕⢝⢮⡳⣻⣿⣷⣿⢽⡺⣻⡿⣟⢷⢽⣽⣿⣷⣿⠿⣽⣾⢿⣿⣯⣿⡯⣿⣿⢿⣿⣿⣿⣟⣿⣷⡐⡼⣿⡯⣿⣿
|
||||
⡒⡕⡇⡯⡪⡎⡭⡪⡒⢌⠂⢕⠸⡨⡣⢣⠱⡱⡱⡳⣹⡪⣳⣿⣿⣻⡯⣟⣶⣿⣿⣽⣟⣾⣿⣿⣿⢿⣿⢯⣻⣿⣿⣿⣿⣻⣿⣯⢿⣿⣿⣿⣿⣿⣷⢏⢿⣿⢿⣿
|
||||
⡈⡖⡝⣼⢝⢜⡸⡸⡨⡠⡑⡅⢇⠎⣊⢪⢊⢎⢪⢺⢸⢜⢮⢿⣯⡯⠏⡣⡑⡥⠣⠐⡨⠘⢾⢿⣿⣟⡿⣯⣻⣿⣿⢿⣯⣿⣿⣯⢯⢿⣿⣻⣿⡷⣿⣗⢽⢽⢿⣿
|
||||
⠌⣮⡾⡳⡕⢝⡔⣕⢎⣪⢪⢪⢢⢃⢎⢎⡮⡺⣨⢳⣹⢸⢸⡻⣗⡏⠌⣶⣶⣾⣿⣿⡷⡕⠸⣟⣯⣿⣿⣳⢯⣿⣿⡿⣿⢷⣻⣿⣝⢝⣽⣿⣿⣟⡽⣾⡕⠝⡯⣿
|
||||
⡨⡮⡳⡩⡸⡲⣹⣵⣟⡮⡺⢸⡰⡫⣸⢜⢮⢺⡸⡸⡜⡌⢎⢎⢗⠕⡨⢒⢜⢭⢗⢕⡰⡜⢼⢿⣿⣻⡾⣽⣎⣿⣿⣿⣽⢿⣗⢿⣽⡮⡪⣾⣟⡷⡍⢿⣣⢘⢮⡿
|
||||
⠹⡜⡑⡬⡲⡽⣯⣷⢟⢔⢜⡴⡵⢏⢇⣣⢗⡇⢇⠎⡎⡎⡎⡜⢬⡣⠀⣧⣷⣽⣮⣯⡦⡩⣸⡿⣽⣯⢿⠕⢜⣽⣿⣽⡾⡯⣿⡞⣞⡯⡷⡿⣽⣟⠌⣞⣿⢨⢑⣿
|
||||
⠮⡱⡱⣱⢽⣽⢿⢕⣯⠢⡃⡣⢑⣔⣗⠯⢓⠨⢢⢣⠣⡓⣝⢮⡘⣞⢄⠄⣽⠚⡙⠡⡈⣢⣷⢿⣻⡽⠃⢹⢔⠼⣾⢿⣿⡹⡵⣿⢺⡪⢪⡻⡮⣗⠧⡱⣿⡄⣫⡗
|
||||
⢽⢸⡹⣕⣟⡞⣕⢯⣯⡇⡂⡢⢓⠌⡢⢨⢂⢕⠕⢅⠣⡊⢎⢗⢳⢸⣝⣗⣷⣶⣶⣷⣿⣟⣿⣻⢝⡮⡅⢂⠯⡪⣯⣿⢿⣎⢺⣽⣯⣻⣜⢜⢜⢜⣱⢱⣯⣏⢷⡯
|
||||
⣏⢮⡪⡞⣃⢂⢪⢽⡾⣯⢂⢊⠢⡑⢅⠇⡊⠢⡑⢅⠇⢊⠔⣕⡕⡏⣿⡽⣿⣿⣿⣿⣟⣿⢝⡮⣷⢙⢌⠢⡩⡯⣷⣻⣿⣿⣔⢵⣿⡺⣟⣜⢮⢪⢎⡮⣾⣇⢽⡣
|
||||
⢾⡫⡫⡊⡖⡜⡎⣕⢏⠯⣇⠪⡪⡂⡅⢂⠂⢕⠱⡑⡁⠅⡗⢱⣝⣾⡳⣹⢻⡯⡷⢿⢻⢱⣝⣞⢝⢴⡱⠀⢈⢹⣳⢽⢾⣻⣷⢕⢽⣿⢽⣞⢽⢺⢜⢮⣻⢮⢺⡸
|
||||
⣣⣣⡳⣵⢽⣺⢽⣳⢱⡩⡪⡪⣐⠹⡸⡲⡸⡨⠬⠨⢰⢰⡱⡵⢻⢺⡺⣵⢻⣜⢮⡳⣽⢵⡣⣇⠣⡵⣫⡂⠰⠨⡷⣻⢽⣻⡾⣿⡸⣿⡽⣗⡝⡧⡳⡱⣻⢯⡣⣗
|
||||
⣾⣺⡽⡯⣿⣝⡽⡪⡪⡂⢊⠪⡢⢣⠨⡂⣕⣔⡬⠮⠫⠓⠉⣐⢨⠚⡙⡎⡷⣕⣗⢯⡳⣝⢕⢕⣕⢯⠃⠈⡬⡨⡏⡽⣝⢷⣻⣽⣟⡾⣻⣽⣎⢯⡲⡸⣽⢗⣇⠧
|
||||
⣳⢿⢽⢭⢺⣺⡪⡇⡗⡈⠢⡨⡨⡸⡸⣚⠮⡲⠭⠳⠒⠘⠉⠀⠀⠁⠀⡀⠱⣳⢽⣹⢹⢜⢕⢝⣜⠊⡀⠐⠀⢪⢻⡜⣝⢽⢽⣾⣻⣿⣽⡷⣗⢷⠱⡕⡽⢧⡳⣝
|
||||
⡽⡽⡱⢱⢽⢮⣻⢊⢮⠠⠄⡀⠈⠀⠀⠀⠀⠈⠨⠀⠀⡀⠀⠀⠀⠀⠂⠀⠈⢘⢓⠕⠕⠡⠁⠁⠂⠀⠀⠀⠀⠀⢏⢷⡸⡜⡜⣷⡯⣷⣿⣽⣯⠫⠣⡯⣣⡣⡯⣞
|
||||
⡎⠣⣝⣮⣟⣯⢷⡱⡑⠄⠀⠀⠑⠂⠆⢄⠀⠀⠀⠀⠀⠀⠄⢀⠀⠀⠀⠀⠉⠀⠠⠀⠂⠡⠀⠀⠀⠀⠀⠀⠀⠀⠨⢝⢷⡱⡱⢽⣻⢽⡾⣗⣯⢝⢌⡽⣧⠾⡽⣞
|
||||
⠀⠈⢚⣞⡾⡯⡳⡕⡹⣆⠀⠄⡀⠀⠀⠀⠈⠑⠀⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⡀⠂⠯⣷⢝⢎⡯⡗⣿⣻⢽⠍⠭⠚⢽⡕⣰⢝
|
||||
"""
|
||||
|
||||
# add centered subtitle
|
||||
width: int = LADY_GAGA.index("\n", 1)
|
||||
subtitle: str = f"judas_server {__version__}"
|
||||
padding: int = (width - len(subtitle)) // 2
|
||||
LADY_GAGA += " " * padding + subtitle + "\n"
|
||||
@@ -1,12 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import annotations
|
||||
|
||||
import threading
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import flask
|
||||
import flask_login
|
||||
import threading
|
||||
import logging as lg
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from werkzeug.wrappers import Response
|
||||
@@ -52,8 +51,10 @@ def emit_polled_data(app, socketio):
|
||||
import time
|
||||
|
||||
while True:
|
||||
for client_id, data in backend.clients.items():
|
||||
socketio.emit("update_data", {client_id: data})
|
||||
data = {}
|
||||
for client_id in backend.clients.keys():
|
||||
data[client_id] = backend.get_client_data(client_id)
|
||||
socketio.emit("update_data", data)
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import flask
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import flask
|
||||
import flask_login
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from werkzeug.wrappers import Response
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ from __future__ import annotations
|
||||
import flask
|
||||
import flask_login
|
||||
|
||||
|
||||
panel_bp: flask.Blueprint = flask.Blueprint(
|
||||
"panel", __name__, url_prefix="/panel"
|
||||
)
|
||||
|
||||
@@ -53,12 +53,7 @@ class JudasWebServer:
|
||||
|
||||
def init_routes(self) -> None:
|
||||
self.logger.debug("Initializing routes...")
|
||||
from judas_server.web.routes import (
|
||||
auth_bp,
|
||||
index_bp,
|
||||
panel_bp,
|
||||
api,
|
||||
)
|
||||
from judas_server.web.routes import api, auth_bp, index_bp, panel_bp
|
||||
|
||||
self.app.register_blueprint(index_bp)
|
||||
self.app.register_blueprint(auth_bp)
|
||||
|
||||
52
uv.lock
generated
52
uv.lock
generated
@@ -287,6 +287,15 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/2c/e1/e6716421ea10d38022b952c159d5161ca1193197fb744506875fbb87ea7b/iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760", size = 6050, upload-time = "2025-03-19T20:10:01.071Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "isort"
|
||||
version = "6.0.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b8/21/1e2a441f74a653a144224d7d21afe8f4169e6c7c20bb13aec3a2dc3815e0/isort-6.0.1.tar.gz", hash = "sha256:1cb5df28dfbc742e490c5e41bad6da41b805b0a8be7bc93cd0fb2a8a890ac450", size = 821955, upload-time = "2025-02-26T21:13:16.955Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/c1/11/114d0a5f4dabbdcedc1125dee0888514c3c3b16d3e9facad87ed96fad97c/isort-6.0.1-py3-none-any.whl", hash = "sha256:2dc5d7f65c9678d94c88dfc29161a320eec67328bc97aad576874cb4be1e9615", size = 94186, upload-time = "2025-02-26T21:13:14.911Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itsdangerous"
|
||||
version = "2.2.0"
|
||||
@@ -308,14 +317,20 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "judas-protocol"
|
||||
version = "0.5.0"
|
||||
source = { git = "https://gitea.pufereq.pl/judas/judas_protocol.git#c48b69ecee16f5824ffd8bce8921341d5fa326b7" }
|
||||
|
||||
[[package]]
|
||||
name = "judas-server"
|
||||
version = "0.2.0"
|
||||
version = "0.4.0"
|
||||
source = { editable = "." }
|
||||
dependencies = [
|
||||
{ name = "flask" },
|
||||
{ name = "flask-login" },
|
||||
{ name = "flask-socketio" },
|
||||
{ name = "judas-protocol" },
|
||||
]
|
||||
|
||||
[package.dev-dependencies]
|
||||
@@ -323,6 +338,10 @@ bump = [
|
||||
{ name = "git-cliff" },
|
||||
{ name = "python-semantic-release" },
|
||||
]
|
||||
lint = [
|
||||
{ name = "isort" },
|
||||
{ name = "ruff" },
|
||||
]
|
||||
test = [
|
||||
{ name = "pytest" },
|
||||
{ name = "pytest-cov" },
|
||||
@@ -335,6 +354,7 @@ requires-dist = [
|
||||
{ name = "flask", specifier = ">=3.1.1" },
|
||||
{ name = "flask-login", specifier = ">=0.6.3" },
|
||||
{ name = "flask-socketio", specifier = ">=5.5.1" },
|
||||
{ name = "judas-protocol", git = "https://gitea.pufereq.pl/judas/judas_protocol.git" },
|
||||
]
|
||||
|
||||
[package.metadata.requires-dev]
|
||||
@@ -342,6 +362,10 @@ bump = [
|
||||
{ name = "git-cliff", specifier = ">=2.9.1" },
|
||||
{ name = "python-semantic-release", specifier = ">=10.2.0" },
|
||||
]
|
||||
lint = [
|
||||
{ name = "isort", specifier = ">=6.0.1" },
|
||||
{ name = "ruff", specifier = ">=0.13.1" },
|
||||
]
|
||||
test = [
|
||||
{ name = "pytest", specifier = ">=4.2.1" },
|
||||
{ name = "pytest-cov", specifier = ">=6.2.1" },
|
||||
@@ -624,6 +648,32 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/e3/30/3c4d035596d3cf444529e0b2953ad0466f6049528a879d27534700580395/rich-14.1.0-py3-none-any.whl", hash = "sha256:536f5f1785986d6dbdea3c75205c473f970777b4a0d6c6dd1b696aa05a3fa04f", size = 243368, upload-time = "2025-07-25T07:32:56.73Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ruff"
|
||||
version = "0.13.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/ab/33/c8e89216845615d14d2d42ba2bee404e7206a8db782f33400754f3799f05/ruff-0.13.1.tar.gz", hash = "sha256:88074c3849087f153d4bb22e92243ad4c1b366d7055f98726bc19aa08dc12d51", size = 5397987, upload-time = "2025-09-18T19:52:44.33Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/f3/41/ca37e340938f45cfb8557a97a5c347e718ef34702546b174e5300dbb1f28/ruff-0.13.1-py3-none-linux_armv6l.whl", hash = "sha256:b2abff595cc3cbfa55e509d89439b5a09a6ee3c252d92020bd2de240836cf45b", size = 12304308, upload-time = "2025-09-18T19:51:56.253Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ff/84/ba378ef4129415066c3e1c80d84e539a0d52feb250685091f874804f28af/ruff-0.13.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:4ee9f4249bf7f8bb3984c41bfaf6a658162cdb1b22e3103eabc7dd1dc5579334", size = 12937258, upload-time = "2025-09-18T19:52:00.184Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8d/b6/ec5e4559ae0ad955515c176910d6d7c93edcbc0ed1a3195a41179c58431d/ruff-0.13.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:5c5da4af5f6418c07d75e6f3224e08147441f5d1eac2e6ce10dcce5e616a3bae", size = 12214554, upload-time = "2025-09-18T19:52:02.753Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/70/d6/cb3e3b4f03b9b0c4d4d8f06126d34b3394f6b4d764912fe80a1300696ef6/ruff-0.13.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:80524f84a01355a59a93cef98d804e2137639823bcee2931f5028e71134a954e", size = 12448181, upload-time = "2025-09-18T19:52:05.279Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d2/ea/bf60cb46d7ade706a246cd3fb99e4cfe854efa3dfbe530d049c684da24ff/ruff-0.13.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ff7f5ce8d7988767dd46a148192a14d0f48d1baea733f055d9064875c7d50389", size = 12104599, upload-time = "2025-09-18T19:52:07.497Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2d/3e/05f72f4c3d3a69e65d55a13e1dd1ade76c106d8546e7e54501d31f1dc54a/ruff-0.13.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c55d84715061f8b05469cdc9a446aa6c7294cd4bd55e86a89e572dba14374f8c", size = 13791178, upload-time = "2025-09-18T19:52:10.189Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/81/e7/01b1fc403dd45d6cfe600725270ecc6a8f8a48a55bc6521ad820ed3ceaf8/ruff-0.13.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:ac57fed932d90fa1624c946dc67a0a3388d65a7edc7d2d8e4ca7bddaa789b3b0", size = 14814474, upload-time = "2025-09-18T19:52:12.866Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fa/92/d9e183d4ed6185a8df2ce9faa3f22e80e95b5f88d9cc3d86a6d94331da3f/ruff-0.13.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c366a71d5b4f41f86a008694f7a0d75fe409ec298685ff72dc882f882d532e36", size = 14217531, upload-time = "2025-09-18T19:52:15.245Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3b/4a/6ddb1b11d60888be224d721e01bdd2d81faaf1720592858ab8bac3600466/ruff-0.13.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f4ea9d1b5ad3e7a83ee8ebb1229c33e5fe771e833d6d3dcfca7b77d95b060d38", size = 13265267, upload-time = "2025-09-18T19:52:17.649Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/81/98/3f1d18a8d9ea33ef2ad508f0417fcb182c99b23258ec5e53d15db8289809/ruff-0.13.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b0f70202996055b555d3d74b626406476cc692f37b13bac8828acff058c9966a", size = 13243120, upload-time = "2025-09-18T19:52:20.332Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8d/86/b6ce62ce9c12765fa6c65078d1938d2490b2b1d9273d0de384952b43c490/ruff-0.13.1-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:f8cff7a105dad631085d9505b491db33848007d6b487c3c1979dd8d9b2963783", size = 13443084, upload-time = "2025-09-18T19:52:23.032Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a1/6e/af7943466a41338d04503fb5a81b2fd07251bd272f546622e5b1599a7976/ruff-0.13.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:9761e84255443316a258dd7dfbd9bfb59c756e52237ed42494917b2577697c6a", size = 12295105, upload-time = "2025-09-18T19:52:25.263Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3f/97/0249b9a24f0f3ebd12f007e81c87cec6d311de566885e9309fcbac5b24cc/ruff-0.13.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:3d376a88c3102ef228b102211ef4a6d13df330cb0f5ca56fdac04ccec2a99700", size = 12072284, upload-time = "2025-09-18T19:52:27.478Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f6/85/0b64693b2c99d62ae65236ef74508ba39c3febd01466ef7f354885e5050c/ruff-0.13.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:cbefd60082b517a82c6ec8836989775ac05f8991715d228b3c1d86ccc7df7dae", size = 12970314, upload-time = "2025-09-18T19:52:30.212Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/96/fc/342e9f28179915d28b3747b7654f932ca472afbf7090fc0c4011e802f494/ruff-0.13.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:dd16b9a5a499fe73f3c2ef09a7885cb1d97058614d601809d37c422ed1525317", size = 13422360, upload-time = "2025-09-18T19:52:32.676Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/37/54/6177a0dc10bce6f43e392a2192e6018755473283d0cf43cc7e6afc182aea/ruff-0.13.1-py3-none-win32.whl", hash = "sha256:55e9efa692d7cb18580279f1fbb525146adc401f40735edf0aaeabd93099f9a0", size = 12178448, upload-time = "2025-09-18T19:52:35.545Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/64/51/c6a3a33d9938007b8bdc8ca852ecc8d810a407fb513ab08e34af12dc7c24/ruff-0.13.1-py3-none-win_amd64.whl", hash = "sha256:3a3fb595287ee556de947183489f636b9f76a72f0fa9c028bdcabf5bab2cc5e5", size = 13286458, upload-time = "2025-09-18T19:52:38.198Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fd/04/afc078a12cf68592345b1e2d6ecdff837d286bac023d7a22c54c7a698c5b/ruff-0.13.1-py3-none-win_arm64.whl", hash = "sha256:c0bae9ffd92d54e03c2bf266f466da0a65e145f298ee5b5846ed435f6a00518a", size = 12437893, upload-time = "2025-09-18T19:52:41.283Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "shellingham"
|
||||
version = "1.5.4"
|
||||
|
||||
Reference in New Issue
Block a user