Compare commits

...

7 Commits

Author SHA1 Message Date
benex
54044f9527 chore: bump version (v2.7.6) 2024-11-17 18:46:42 +03:00
benex
1e5c039ece chore: update flake.nix 2024-11-17 18:45:32 +03:00
benex
15555759dc feat: ask user if they want to update on new release 2024-11-17 18:45:17 +03:00
benex
0ed51e05cc chore: fix error is in flake.nix 2024-11-17 17:23:41 +03:00
benex
634ef6febf chore: update lock file 2024-11-17 14:28:02 +03:00
benex
bda4b2dbe1 chore: add flake.nix 2024-11-17 14:27:41 +03:00
benex
f015305e7c chore: add shell.nix 2024-11-17 14:27:32 +03:00
6 changed files with 94 additions and 9 deletions

View File

@@ -6,7 +6,7 @@ if sys.version_info < (3, 10):
) # noqa: F541
__version__ = "v2.7.5"
__version__ = "v2.7.6"
APP_NAME = "FastAnime"
AUTHOR = "Benex254"

View File

@@ -228,14 +228,32 @@ def run_cli(
ctx.obj = Config()
if ctx.obj.check_for_updates:
from .app_updater import check_for_updates
import time
is_latest = check_for_updates()
is_latest, github_release_data = check_for_updates()
if not is_latest:
print(
"You are running an older version of fastanime please update to get the latest features"
)
time.sleep(10)
from rich.console import Console
from rich.markdown import Markdown
from .app_updater import update_app
from rich.prompt import Confirm
def _print_release(release_data):
console = Console()
body = Markdown(release_data["body"])
tag = github_release_data["tag_name"]
tag_title = release_data["name"]
github_page_url = release_data["html_url"]
console.print(f"Release Page: {github_page_url}")
console.print(f"Tag: {tag}")
console.print(f"Title: {tag_title}")
console.print(body)
if Confirm.ask(
"A new version of fastanime is available, would you like to update?"
):
_, release_json = update_app()
print("Successfully updated")
_print_release(release_json)
exit(0)
ctx.obj.manga = manga
if log:

49
flake.nix Normal file
View File

@@ -0,0 +1,49 @@
{
description = "FastAnime Project Flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
python = pkgs.python310;
pythonPackages = python.pkgs;
fastanimeEnv = pythonPackages.buildPythonApplication {
pname = "fastanime";
version = "2.7.5";
src = ./.;
# Add runtime dependencies
propagatedBuildInputs = with pythonPackages; [
click
inquirerpy
requests
rich
thefuzz
yt-dlp
dbus-python
hatchling
];
# Ensure compatibility with the pyproject.toml
format = "pyproject";
};
in
{
packages.default = fastanimeEnv;
# DevShell for development
devShells.default = pkgs.mkShell {
buildInputs = [
fastanimeEnv
pythonPackages.hatchling
];
};
});
}

View File

@@ -1,6 +1,6 @@
[project]
name = "fastanime"
version = "2.7.5"
version = "2.7.6"
description = "A browser anime site experience from the terminal"
license = "UNLICENSE"
readme = "README.md"

18
shell.nix Normal file
View File

@@ -0,0 +1,18 @@
let
pkgs = import <nixpkgs> {};
in pkgs.mkShell {
packages = [
(pkgs.python3.withPackages (python-pkgs: [
python-pkgs.yt-dlp
python-pkgs.dbus-python
python-pkgs.requests
python-pkgs.rich
python-pkgs.click
python-pkgs.inquirerpy
python-pkgs.mpv
python-pkgs.fastapi
python-pkgs.thefuzz
python-pkgs.plyer
]))
];
}

2
uv.lock generated
View File

@@ -170,7 +170,7 @@ wheels = [
[[package]]
name = "fastanime"
version = "2.7.4"
version = "2.7.5"
source = { editable = "." }
dependencies = [
{ name = "click" },