diff --git a/pkgs_wip/qbit-manage.nix b/pkgs_wip/qbit-manage.nix index ae4ef9c..189a5b2 100644 --- a/pkgs_wip/qbit-manage.nix +++ b/pkgs_wip/qbit-manage.nix @@ -7,16 +7,20 @@ python3.pkgs.buildPythonApplication rec { pname = "qbit-manage"; - version = "4.1.14"; + version = "4.3.0"; pyproject = true; src = fetchFromGitHub { owner = "StuffAnThings"; repo = "qbit_manage"; rev = "v${version}"; - hash = "sha256-JTQZlJ2d0oOpT8lIf9mgQ/onTs5jiWfvzFx0XBjbCQo="; + hash = "sha256-Wj1s11PwHfH4hDGEn0jW/REO2gI7+AGyb2B/QKUhlyk="; }; + postPatch = '' + rm LICENSE + ''; + build-system = [ python3.pkgs.setuptools python3.pkgs.wheel @@ -27,12 +31,27 @@ python3.pkgs.buildPythonApplication rec { gitpython humanize pytimeparse2 - qbittorrent-api + bencode-py requests retrying ruamel-yaml schedule - (callPackage ./bencodepy.nix { }) + (callPackage ./qbittorrent-api.nix { + inherit lib; + inherit (python3.pkgs) + buildPythonPackage + fetchPypi + + # build-system + setuptools + setuptools-scm + + # dependencies + packaging + requests + urllib3 + ; + }) ]; meta = { diff --git a/pkgs_wip/qbit-manage.patch b/pkgs_wip/qbit-manage.patch new file mode 100644 index 0000000..130485e --- /dev/null +++ b/pkgs_wip/qbit-manage.patch @@ -0,0 +1,25 @@ +diff --git a/modules/logs.py b/modules/logs.py +index 1234567..abcdef0 100644 +--- a/modules/logs.py ++++ b/modules/logs.py +@@ class MyLogger: + def __init__( + self, logger_name, log_file, log_level, default_dir, screen_width, separating_character, ignore_ghost, log_size, log_count + ): +- self.log_dir = os.path.join(default_dir, LOG_DIR) +- self.main_log = log_file if os.path.exists(os.path.dirname(log_file)) else os.path.join(self.log_dir, log_file) ++ self.log_dir = None ++ self.main_log = log_file + self.main_handler = None + self.save_errors = False + self.saved_errors = [] + self.config_handlers = {} + self.secrets = set() + self.spacing = 0 + self.log_size = log_size + self.log_count = log_count +- os.makedirs(self.log_dir, exist_ok=True) + + self._logger = logging.getLogger(self.logger_name) + logging.DRYRUN = DRYRUN + logging.addLevelName(DRYRUN, "DRYRUN") diff --git a/pkgs_wip/qbittorrent-api.nix b/pkgs_wip/qbittorrent-api.nix new file mode 100644 index 0000000..0601a32 --- /dev/null +++ b/pkgs_wip/qbittorrent-api.nix @@ -0,0 +1,50 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + + # build-system + setuptools, + setuptools-scm, + + # dependencies + packaging, + requests, + urllib3, +}: + +buildPythonPackage rec { + pname = "qbittorrent-api"; + version = "2025.5.0"; + pyproject = true; + + src = fetchPypi { + pname = "qbittorrent_api"; + inherit version; + hash = "sha256-NKD5weGufhbeUOlGUXUsjZejz1TCo+GgXGqDdzmaDjA="; + }; + + build-system = [ + setuptools + setuptools-scm + ]; + + dependencies = [ + packaging + requests + urllib3 + ]; + + # Tests require internet access + doCheck = false; + + pythonImportsCheck = [ "qbittorrentapi" ]; + + meta = { + description = "Python client implementation for qBittorrent's Web API"; + homepage = "https://github.com/rmartin16/qbittorrent-api"; + changelog = "https://github.com/rmartin16/qbittorrent-api/blob/v${version}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ savyajha ]; + }; +}