10 Commits

Author SHA1 Message Date
Safihre
0950393b82 Correctly format tests based on new rules and remove star imports 2026-06-05 14:34:17 +02:00
Safihre
d5700bf8a3 Apply C4 linter rules for collection usage
Refactors collection initializations and comprehensions to use more concise and idiomatic Python syntax, such as set literals (`{...}`) instead of `set([...])`, empty dictionary literals (`{}`) instead of `dict()`, and `dict.fromkeys` for `str.maketrans`.
Also removes unnecessary list creation within `any()` calls.
2026-06-05 09:04:05 +02:00
Safihre
c1096dc0ab Update type hints to use native union syntax and TypeAlias
Migrate to `A | B` syntax for unions (PEP 604) and introduce `typing.TypeAlias` for complex types, leveraging features available in Python 3.10+. This also updates `socket.timeout` to `TimeoutError` and adds `UP045` to Ruff ignores.
2026-05-26 16:44:49 +02:00
Safihre
7b2e139e45 Update ruff target Python version to 3.10 2026-05-26 15:54:35 +02:00
Safihre
80840ce743 Modernize Python type hints and enable Pyupgrade checks
Enable Pyupgrade (`UP`) checks in Ruff, which drives the modernization of type hints.
This includes replacing `typing.Deque` with `collections.deque` and `typing.Tuple` with built-in `tuple` where applicable, improving consistency and adhering to modern Python conventions.
2026-05-13 22:09:24 +02:00
Safihre
0434dca45f Enable additional Ruff checks and implement fixes 2026-05-13 21:50:32 +02:00
Safihre
81bc2a384f Add F401 unused imports check
This change enables `F401` (unused import) checks in Ruff and configures per-file ignores for intentional top-level imports. The newly enforced check led to the removal of several unused imports across the codebase.

Additionally, the module existence check for `certifi` was modernized to use `importlib.util.find_spec` for a more efficient and robust approach.
2026-05-13 20:37:55 +02:00
mnightingale
2184964d78 Reduce time to test (#3412)
* Remove UI delays

* Everything using set_config, set_platform, or pyfakefs

* tmp_path

* Scroll to top seems unnecessary but make it wait until it's done

* Remove sleep from test_rss_basic_flow

* Remove sleeps from test_daemonizing

* Define pytest markers

* Reduce sleep in test_queue_repair

* Remove sleeps from clean_cache_dir

* Suppress failures to connect during startup

* Reduce cache sleeps

* Reduce sleeps checking app started

* Reduce sleep removing cache dir
2026-05-13 18:49:41 +02:00
Safihre
b942e06297 Introduce Ruff linter for improved code quality
Integrates the Ruff linter into the CI workflow alongside Black. This enhances code quality and consistency by catching common issues. Addresses an initial `F821` (undefined name) finding in `__init__.py` identified by Ruff, ensuring explicit module referencing.
2026-05-13 14:25:06 +02:00
Safihre
7abb39d02d Move black config to pyproject
So later we can also add ruff
2026-05-10 12:00:01 +02:00