Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfiles/murfey-instrument-server
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN apt-get update && \
pip \
build \
importlib-metadata && \
/venv/bin/python -m pip install /python-murfey[client,instrument-server]
/venv/bin/python -m pip install /python-murfey[client]


# Transfer completed Murfey build to base image
Expand Down
14 changes: 3 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ classifiers = [
"Programming Language :: Python :: 3.12",
]
dependencies = [
"aiohttp",
"defusedxml", # For safely parsing XML files
"fastapi[standard-no-fastapi-cloud-cli]>=0.116.0",
"pydantic>=2",
"pydantic-settings",
"python-jose",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be python-jose[cryptography] like it was before or is that not needed any more?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a look at the original repo, and the cryptography optional dependency installs only cryptography. python-jose can thus be safely moved under our general dependencies.

"requests",
"rich",
"werkzeug",
Expand All @@ -42,7 +45,6 @@ cicd = [
"pytest-cov", # Used for generating PyTest coverage reports
]
client = [
"textual==0.42.0",
"websocket-client",
]
developer = [
Expand All @@ -52,15 +54,8 @@ developer = [
"pytest", # Test code functionality
"pytest-mock", # Additional mocking tools for unit tests
]
instrument-server = [
"aiohttp",
"fastapi[standard-no-fastapi-cloud-cli]>=0.116.0",
"python-jose",
]
server = [
"aiohttp",
"cryptography",
"fastapi[standard-no-fastapi-cloud-cli]>=0.116.0",
"graypy",
"ispyb>=10.2.4", # Responsible for setting requirements for SQLAlchemy and mysql-connector-python;
"jinja2",
Expand All @@ -70,7 +65,6 @@ server = [
"passlib",
"pillow",
"prometheus_client",
"python-jose[cryptography]",
"sqlalchemy[postgresql]", # Add as explicit dependency
"sqlmodel",
"stomp-py>8.1.1", # 8.1.1 (released 2024-04-06) doesn't work with our project
Expand All @@ -82,7 +76,6 @@ Documentation = "https://github.com/DiamondLightSource/python-murfey"
GitHub = "https://github.com/DiamondLightSource/python-murfey"
[project.scripts]
"murfey.add_user" = "murfey.cli.add_user:run"
"murfey.client" = "murfey.client.tui.main:run"
"murfey.create_db" = "murfey.cli.create_db:run"
"murfey.db_sql" = "murfey.cli.murfey_db_sql:run"
"murfey.decrypt_password" = "murfey.cli.decrypt_db_password:run"
Expand Down Expand Up @@ -121,7 +114,6 @@ include-package-data = true
zip-safe = false

[tool.setuptools.package-data]
"murfey.client.tui" = ["*.css"]
"murfey.util" = ["route_manifest.yaml"]

[tool.setuptools.packages.find]
Expand Down
24 changes: 0 additions & 24 deletions src/murfey/client/customlogging.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
import json
import logging

from rich.logging import RichHandler

from murfey.client.tui.screens import LogBook

logger = logging.getLogger("murfey.client.customlogging")


Expand All @@ -30,23 +26,3 @@ def emit(self, record):
self._callback(self.prepare(record))
except Exception:
self.handleError(record)


class DirectableRichHandler(RichHandler):
def __init__(self, text_log: LogBook | None = None, **kwargs):
super().__init__(**kwargs)
self.text_log = text_log
self.redirect = False
self._last_time = None

def emit(self, record):
try:
if self.text_log:
message = self.format(record)
message_renderable = self.render_message(record, message)
log_renderable = self.render(
record=record, traceback=None, message_renderable=message_renderable
)
self.text_log.post_message(self.text_log.Log(log_renderable))
except Exception:
self.handleError(record)
13 changes: 0 additions & 13 deletions src/murfey/client/rsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from typing import Awaitable, Callable, List, NamedTuple
from urllib.parse import ParseResult

from murfey.client.tui.status_bar import StatusBar
from murfey.util.client import Observer

logger = logging.getLogger("murfey.client.rsync")
Expand Down Expand Up @@ -59,7 +58,6 @@ def __init__(
server_url: ParseResult,
stop_callback: Callable = lambda *args, **kwargs: None,
local: bool = False,
status_bar: StatusBar | None = None,
do_transfer: bool = True,
remove_files: bool = False,
required_substrings_for_removal: List[str] = [],
Expand Down Expand Up @@ -107,7 +105,6 @@ def __init__(
)
self._stopping = False
self._halt_thread = False
self._statusbar = status_bar

def __repr__(self) -> str:
return f"<RSyncer ({self._basepath} → {self._remote}) [{self.status}]"
Expand All @@ -116,15 +113,12 @@ def __repr__(self) -> str:
def from_rsyncer(cls, rsyncer: RSyncer, **kwargs):
kwarguments_from_rsyncer = {
"local": rsyncer._local,
"status_bar": rsyncer._statusbar,
"do_transfer": rsyncer._do_transfer,
"remove_files": rsyncer._remove_files,
"notify": rsyncer._notify,
}
kwarguments_from_rsyncer.update(kwargs)
assert isinstance(kwarguments_from_rsyncer["local"], bool)
if kwarguments_from_rsyncer["status_bar"] is not None:
assert isinstance(kwarguments_from_rsyncer["status_bar"], StatusBar)
assert isinstance(kwarguments_from_rsyncer["do_transfer"], bool)
assert isinstance(kwarguments_from_rsyncer["remove_files"], bool)
assert isinstance(kwarguments_from_rsyncer["notify"], bool)
Expand All @@ -134,7 +128,6 @@ def from_rsyncer(cls, rsyncer: RSyncer, **kwargs):
rsyncer._rsync_module,
rsyncer._server_url,
local=kwarguments_from_rsyncer["local"],
status_bar=kwarguments_from_rsyncer["status_bar"],
do_transfer=kwarguments_from_rsyncer["do_transfer"],
remove_files=kwarguments_from_rsyncer["remove_files"],
notify=kwarguments_from_rsyncer["notify"],
Expand Down Expand Up @@ -398,12 +391,6 @@ def parse_stdout(line: str):
return

self._files_transferred += 1
if self._statusbar:
with self._statusbar.lock:
self._statusbar.transferred = [
self._statusbar.transferred[0] + 1,
self._statusbar.transferred[1],
]
current_outstanding = self.queue.unfinished_tasks - (
self._files_transferred - previously_transferred
)
Expand Down
Empty file removed src/murfey/client/tui/__init__.py
Empty file.
Loading