chore: bump dependencies

This commit is contained in:
Jacob Bachmann 2024-05-21 15:31:49 +02:00
parent db9b2cfa0c
commit 49bb59b7f4
Signed by: bchmnn
GPG key ID: 732A612DAD28067D
2 changed files with 46 additions and 88 deletions

18
flake.lock generated
View file

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1715486357, "lastModified": 1715930644,
"narHash": "sha256-4pRuzsHZOW5W4CsXI9uhKtiJeQSUoe1d2M9mWU98HC4=", "narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "44677a1c96810a8e8c4ffaeaad10c842402647c1", "rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -22,11 +22,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1715148395, "lastModified": 1716173274,
"narHash": "sha256-lRxjTxY3103LGMjWdVqntKZHhlmMX12QUjeFrQMmGaE=", "narHash": "sha256-FC21Bn4m6ctajMjiUof30awPBH/7WjD0M5yqrWepZbY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "a4e2b7909fc1bdf30c30ef21d388fde0b5cdde4a", "rev": "d9e0b26202fd500cf3e79f73653cce7f7d541191",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -38,11 +38,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1715787315, "lastModified": 1716137900,
"narHash": "sha256-cYApT0NXJfqBkKcci7D9Kr4CBYZKOQKDYA23q8XNuWg=", "narHash": "sha256-sowPU+tLQv8GlqtVtsXioTKeaQvlMz/pefcdwg8MvfM=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "33d1e753c82ffc557b4a585c77de43d4c922ebb5", "rev": "6c0b7a92c30122196a761b440ac0d46d3d9954f1",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,93 +1,30 @@
{ lib { pkgs
, lib
, buildPythonApplication , buildPythonApplication
, fetchPypi , fetchPypi
, cryptography , python3Packages
, requests , withFFmpeg ? false
, pyyaml
, packaging
, colorama
, pyinotify
, distro
, psutil
}: }:
let
remove-completion-patch = builtins.toFile "remove-completion-patch" ''
diff --git a/src/isisdl/utils.py b/src/isisdl/utils.py
index 691e18f..8597bf0 100644
--- a/src/isisdl/utils.py
+++ b/src/isisdl/utils.py
@@ -399,55 +399,6 @@ def startup() -> None:
with open(config_file_location, "w") as f:
f.write(f"# You probably want to start by copying {example_config_file_location} and adapting it.\n")
- if not is_windows and not is_static:
- # Install completions if they don't exist already
- user_dir = os.path.expanduser("~")
-
- if shutil.which("zsh") is not None:
- default_path = f"{user_dir}/.local/share/zsh/site-functions"
- whitelist_paths = [
- f"{user_dir}/.oh-my-zsh/completions",
- f"{user_dir}/.oh-my-zsh/custom/plugins/zsh-completions/src",
- ]
-
- # Since the session is interactive it might contain stuff like neofetch etc.
- rand_string = "".join(random.choice(string.ascii_letters) for _ in range(32))
- fpath = subprocess.check_output(["zsh", "-c", "-i", f"echo {rand_string}; echo $FPATH"]) \
- .decode().split(rand_string)[-1].strip().split(":")
-
- # 1. Find install path (default .local/share/zsh/site-functions or .local/share/isisdl/)
- # 2. copy _isisdl there
-
- # 3. Export this path to $FPATH via .zshrc (make this transparent to user)
- # 4. autoload [path]/_isisdl
-
- for final_path in whitelist_paths:
- for p in fpath:
- if final_path == p and not (os.path.exists(final_path) and not os.access(final_path, os.W_OK | os.X_OK)):
- break
-
- else:
- final_path = default_path
-
- # Here the file is always copied to the destination dir.
- # This is fine since the Filesystem will (hopefully) realize that the files are the same and thus ignore it.
- os.makedirs(final_path, exist_ok=True)
-
- completion_source = source_code_location.joinpath("resources", "completions", "zsh", "_isisdl")
- if completion_source.exists():
- shutil.copy(completion_source, final_path)
-
- # TODO: Also tag this file as autoloadable
-
- if shutil.which("fish") is not None:
- # TODO
- pass
-
- if shutil.which("bash") is not None:
- final_path = f"{user_dir}/.local/share/bash-completion/completions"
- os.makedirs(final_path, exist_ok=True)
- shutil.copy(source_code_location.joinpath("resources", "completions", "zsh", "_isisdl"), final_path)
-
def clear() -> None:
if is_windows:
'';
in
buildPythonApplication rec { buildPythonApplication rec {
pname = "isisdl"; pname = "isisdl";
version = "1.3.19"; version = "1.3.20";
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
hash = "sha256-VcqaFqcoH+d1NpKq7QBVbXcbe0HfZ67kStGFiYmr/kE="; hash = "sha256-s0vGCJVSa6hf6/sIhzmaxpziP4izoRwcZfxvm//5inY=";
}; };
patches = [ pyproject = true;
remove-completion-patch
build-system = with python3Packages; [
setuptools
]; ];
propagatedBuildInputs = [ nativeBuildInputs = with python3Packages; [
pythonRelaxDepsHook
];
dependencies = with python3Packages; [
cryptography cryptography
requests requests
pyyaml pyyaml
@ -98,11 +35,32 @@ buildPythonApplication rec {
psutil psutil
]; ];
pythonRelaxDeps = [
"cryptography"
"requests"
"packaging"
"distro"
];
buildInputs = [
pkgs.util-linux # for runtime dependency `lsblk`
] ++ lib.optionals withFFmpeg [
pkgs.ffmpeg
];
# disable tests since they require valid login credentials
doCheck = false; doCheck = false;
meta = with lib; { meta = with lib; {
homepage = "https://github.com/Emily3403/isisdl"; homepage = "https://github.com/Emily3403/isisdl";
description = "A downloader for ISIS of TU-Berlin"; description = "A downloader for ISIS of TU-Berlin";
license = licenses.mit; longDescription = ''
A downloading utility for ISIS of TU-Berlin.
Download all your files and videos from ISIS.
'';
license = licenses.gpl3;
maintainers = with maintainers; [ bchmnn ];
mainProgram = "isisdl";
platforms = platforms.linux;
}; };
} }