From 5a3ffb00eed1114b7329d45e4b7dc779cf480116 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Mon, 25 Nov 2024 15:47:52 +0000 Subject: [PATCH] Fix for latest ruff --- pyproject.toml | 2 +- ruff.toml | 2 -- src/ibex_bluesky_core/callbacks/file_logger.py | 2 +- src/ibex_bluesky_core/log.py | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b1d25b26..a6af8c0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,7 @@ doc = [ ] dev = [ "ibex_bluesky_core[doc]", - "ruff>=0.6", + "ruff>=0.8", "pyright", "pytest", "pytest-asyncio", diff --git a/ruff.toml b/ruff.toml index 09ae3d9d..6323b8e3 100644 --- a/ruff.toml +++ b/ruff.toml @@ -19,8 +19,6 @@ extend-select = [ ignore = [ "D406", # Section name should end with a newline ("{name}") "D407", # Missing dashed underline after section ("{name}") - "ANN101", # ignore this until its removed in future versions - "ANN102", # ignore this until its removed in future versions "D213", # Incompatible with D212 "D203", # Incompatible with D211 ] diff --git a/src/ibex_bluesky_core/callbacks/file_logger.py b/src/ibex_bluesky_core/callbacks/file_logger.py index c0b2c6f2..e059c910 100644 --- a/src/ibex_bluesky_core/callbacks/file_logger.py +++ b/src/ibex_bluesky_core/callbacks/file_logger.py @@ -5,13 +5,13 @@ from datetime import datetime from pathlib import Path from typing import Optional +from zoneinfo import ZoneInfo from bluesky.callbacks import CallbackBase from event_model.documents.event import Event from event_model.documents.event_descriptor import EventDescriptor from event_model.documents.run_start import RunStart from event_model.documents.run_stop import RunStop -from zoneinfo import ZoneInfo logger = logging.getLogger(__name__) diff --git a/src/ibex_bluesky_core/log.py b/src/ibex_bluesky_core/log.py index 19f0f4f9..ea1db386 100644 --- a/src/ibex_bluesky_core/log.py +++ b/src/ibex_bluesky_core/log.py @@ -5,14 +5,14 @@ logger and the bluesky logger. """ -import logging.config +import logging import os import sys from functools import cache from logging import Formatter from logging.handlers import TimedRotatingFileHandler -__all__ = ["setup_logging", "set_bluesky_log_levels", "file_handler"] +__all__ = ["file_handler", "set_bluesky_log_levels", "setup_logging"] DEFAULT_LOG_FOLDER = os.path.join("C:\\", "instrument", "var", "logs", "bluesky")