feat: migrate to bbpb and platformdirs, add dependency version constraints

- Migrate from blackboxprotobuf to bbpb (new PyPI package name)
  - Update pyproject.toml and shell.nix dependencies
  - Import name remains 'blackboxprotobuf' (no code changes)
- Migrate from appdirs to platformdirs
  - Replace deprecated appdirs with actively maintained platformdirs
  - Update grawlix/config.py to use platformdirs.user_config_dir
  - Update dependency declarations in pyproject.toml and shell.nix
- Add minimum version constraints for all dependencies
  - Set requires-python = ">=3.9" (required by httpx and importlib.resources.files())
  - Add Python version classifiers (3.9-3.13)
  - Specify minimum versions: beautifulsoup4>=4.9.0, bbpb>=1.0.0,
    EbookLib>=0.17, httpx>=0.23.0, importlib-resources>=5.0,
    lxml>=4.6.0, platformdirs>=3.0.0, pycryptodome>=3.10.0, rich>=10.0.0
  - Make tomli conditional: only required for Python < 3.11
- Update shell.nix with correct SHA256 hash for bbpb 1.4.2
These changes ensure all dependencies meet minimum version requirements
for Python 3.9+ compatibility and replace deprecated packages with
actively maintained alternatives.
This commit is contained in:
^_^ 2025-10-29 12:39:41 +01:00
parent 4efb963168
commit 08af04ab32
2 changed files with 18 additions and 12 deletions

View File

@ -1,7 +1,7 @@
from dataclasses import dataclass from dataclasses import dataclass
from typing import Optional from typing import Optional
import tomli import tomli
import appdirs from platformdirs import user_config_dir
import os import os
@ -26,7 +26,7 @@ def load_config() -> Config:
:returns: Config object :returns: Config object
""" """
config_dir = appdirs.user_config_dir("grawlix", "jo1gi") config_dir = user_config_dir("grawlix", "jo1gi")
config_file = os.path.join(config_dir, "grawlix.toml") config_file = os.path.join(config_dir, "grawlix.toml")
if os.path.exists(config_file): if os.path.exists(config_file):
try: try:

View File

@ -6,21 +6,27 @@ authors = [
description = "CLI tool for downloading ebooks" description = "CLI tool for downloading ebooks"
readme = "README.md" readme = "README.md"
keywords = ["ebook", "cli", "downloader"] keywords = ["ebook", "cli", "downloader"]
requires-python = ">=3.9"
classifiers = [ classifiers = [
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
] ]
dependencies = [ dependencies = [
"appdirs", "beautifulsoup4>=4.9.0",
"beautifulsoup4", "bbpb>=1.0.0",
"blackboxprotobuf", "EbookLib>=0.17",
"EbookLib", "httpx>=0.23.0",
"httpx", "importlib-resources>=5.0",
"importlib-resources", "lxml>=4.6.0",
"lxml", "platformdirs>=3.0.0",
"pycryptodome", "pycryptodome>=3.10.0",
"rich", "rich>=10.0.0",
"tomli", "tomli>=1.0.0; python_version<'3.11'",
] ]
dynamic = ["version"] dynamic = ["version"]