Unverified Commit 44588aa5 authored by kirillrdy's avatar kirillrdy Committed by GitHub
Browse files

calibre-web: 0.6.22 -> 0.6.24 (#356882)

parents ad9f5104 4b3bacf9
Loading
Loading
Loading
Loading
+112 −48
Original line number Diff line number Diff line
{ lib
, fetchFromGitHub
, nixosTests
, nix-update-script
, python3
{
  lib,
  stdenv,
  fetchFromGitHub,
  nix-update-script,
  nixosTests,
  python3Packages,
}:

let
  python = python3.override {
    self = python;
    packageOverrides = self: super: {
      sqlalchemy = super.sqlalchemy_1_4;
    };
  };
in
python.pkgs.buildPythonApplication rec {
python3Packages.buildPythonApplication rec {
  pname = "calibre-web";
  version = "0.6.22";
  version = "0.6.24";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "janeczku";
    repo = "calibre-web";
    rev = version;
    hash = "sha256-nWZmDasBH+DW/+Cvw510mOv11CXorRnoBwNFpoKPErY=";
    tag = version;
    hash = "sha256-DYhlD3ly6U/e5cDlsubDyW1uKeCtB+HrpagJlNDJhyI=";
  };

  propagatedBuildInputs = with python.pkgs; [
    advocate
  patches = [
    # default-logger.patch switches default logger to /dev/stdout. Otherwise calibre-web tries to open a file relative
    # to its location, which can't be done as the store is read-only. Log file location can later be configured using UI
    # if needed.
    ./default-logger.patch
    # DB migrations adds an env var __RUN_MIGRATIONS_ANDEXIT that, when set, instructs calibre-web to run DB migrations
    # and exit. This is gonna be used to configure calibre-web declaratively, as most of its configuration parameters
    # are stored in the DB.
    ./db-migrations.patch
  ];

  # calibre-web doesn't follow setuptools directory structure.
  postPatch = ''
    mkdir -p src/calibreweb
    mv cps.py src/calibreweb/__init__.py
    mv cps src/calibreweb

    substituteInPlace pyproject.toml \
      --replace-fail 'cps = "calibreweb:main"' 'calibre-web = "calibreweb:main"'
  '';

  build-system = [ python3Packages.setuptools ];

  dependencies = with python3Packages; [
    apscheduler
    babel
    bleach
    chardet
    cryptography
    flask
    flask-babel
    flask-httpauth
    flask-limiter
    flask-login
    flask-principal
    flask-simpleldap
    flask-wtf
    iso-639
    jsonschema
    lxml
    netifaces-plus
    pycountry
    pypdf
    python-magic
    pytz
@@ -48,45 +66,91 @@ python.pkgs.buildPythonApplication rec {
    sqlalchemy
    tornado
    unidecode
    urllib3
    wand
    werkzeug
  ];

  patches = [
    # default-logger.patch switches default logger to /dev/stdout. Otherwise calibre-web tries to open a file relative
    # to its location, which can't be done as the store is read-only. Log file location can later be configured using UI
    # if needed.
    ./default-logger.patch
    # DB migrations adds an env var __RUN_MIGRATIONS_ANDEXIT that, when set, instructs calibre-web to run DB migrations
    # and exit. This is gonna be used to configure calibre-web declaratively, as most of its configuration parameters
    # are stored in the DB.
    ./db-migrations.patch
  optional-dependencies = {
    comics = with python3Packages; [
      comicapi
      natsort
    ];

  # calibre-web doesn't follow setuptools directory structure.
  postPatch = ''
    mkdir -p src/calibreweb
    mv cps.py src/calibreweb/__init__.py
    mv cps src/calibreweb
    gdrive = with python3Packages; [
      gevent
      google-api-python-client
      greenlet
      httplib2
      oauth2client
      pyasn1-modules
      # https://github.com/NixOS/nixpkgs/commit/bf28e24140352e2e8cb952097febff0e94ea6a1e
      # pydrive2
      pyyaml
      rsa
      uritemplate
    ];

    substituteInPlace setup.cfg \
      --replace-fail "cps = calibreweb:main" "calibre-web = calibreweb:main"
  '';
    gmail = with python3Packages; [
      google-api-python-client
      google-auth-oauthlib
    ];

    # We don't support the goodreads feature, as the `goodreads` package is
    # archived and depends on other long unmaintained packages (rauth & nose)
    # goodreads = [ ];

    kobo = with python3Packages; [ jsonschema ];

    ldap = with python3Packages; [
      flask-simpleldap
      python-ldap
    ];

    metadata = with python3Packages; [
      faust-cchardet
      html2text
      markdown2
      mutagen
      py7zr
      pycountry
      python-dateutil
      rarfile
      scholarly
    ];

    oauth = with python3Packages; [
      flask-dance
      sqlalchemy-utils
    ];
  };

  pythonRelaxDeps = [
    "apscheduler"
    "bleach"
    "cryptography"
    "flask"
    "flask-limiter"
    "lxml"
    "pypdf"
    "regex"
  ];

  nativeCheckInputs = lib.flatten (lib.attrValues optional-dependencies);

  # Upstream repo doesn't provide any tests.
  doCheck = false;
  pythonImportsCheck = [ "calibreweb" ];

  passthru = {
    tests.calibre-web = nixosTests.calibre-web;
    tests = lib.optionalAttrs stdenv.hostPlatform.isLinux { inherit (nixosTests) calibre-web; };
    updateScript = nix-update-script { };
  };

  meta = with lib; {
  meta = {
    description = "Web app for browsing, reading and downloading eBooks stored in a Calibre database";
    homepage = "https://github.com/janeczku/calibre-web";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ pborzenkov ];
    platforms = platforms.all;
    changelog = "https://github.com/janeczku/calibre-web/releases/tag/${src.tag}";
    license = lib.licenses.gpl3Plus;
    maintainers = with lib.maintainers; [ pborzenkov ];
    mainProgram = "calibre-web";
    platforms = lib.platforms.all;
  };
}
+83 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,
  importlib-metadata,
  natsort,
  pillow,
  py7zr,
  pycountry,
  pyicu,
  pytestCheckHook,
  pythonOlder,
  rapidfuzz,
  rarfile,
  setuptools,
  setuptools-scm,
  text2digits,
  wheel,
  wordninja,
}:

buildPythonPackage rec {
  pname = "comicapi";
  version = "3.2.0";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "comictagger";
    repo = "comicapi";
    rev = "2bf8332114e49add0bbc0fd3d85bdbba02de3d1a";
    hash = "sha256-Cd3ILy/4PqWUj1Uu9of9gCpdVp2R6CXjPOuSXgrB894=";
  };

  build-system = [
    setuptools
    setuptools-scm
    wheel
  ];

  dependencies = [
    importlib-metadata
    natsort
    pillow
    pycountry
    rapidfuzz
    text2digits
    wordninja
  ];

  optional-dependencies = {
    _7z = [ py7zr ];

    all = [
      py7zr
      rarfile
    ] ++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isLinux) pyicu;

    cbr = [ rarfile ];

    icu = lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isLinux) pyicu;
  };

  nativeCheckInputs = [ pytestCheckHook ] ++ lib.flatten (lib.attrValues optional-dependencies);

  pythonRelaxDeps = [ "pycountry" ];

  disabledTests = [
    # AssertionError
    "test_copy_from_archive"
  ];

  pythonImportsCheck = [ "comicapi" ];

  meta = {
    description = "Comic archive (cbr/cbz/cbt) and metadata utilities";
    homepage = "https://github.com/comictagger/comicapi";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ getchoo ];
  };
}
+95 −0
Original line number Diff line number Diff line
{
  lib,
  betamax,
  blinker,
  buildPythonPackage,
  coverage,
  fetchFromGitHub,
  flask,
  flask-caching,
  flask-login,
  flask-sqlalchemy,
  flit,
  freezegun,
  oauthlib,
  pallets-sphinx-themes,
  pillow,
  pytest,
  pytest-mock,
  pytestCheckHook,
  requests,
  requests-oauthlib,
  responses,
  sphinx,
  sphinxcontrib-seqdiag,
  sphinxcontrib-spelling,
  sqlalchemy,
  urlobject,
  werkzeug,
}:

buildPythonPackage rec {
  pname = "flask-dance";
  version = "7.1.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "singingwolfboy";
    repo = "flask-dance";
    tag = "v${version}";
    hash = "sha256-rKHC0G5S7l52QSrbbweMii68AZuBAgf6tYsJdPKIeUk=";
  };

  build-system = [ flit ];

  dependencies = [
    flask
    oauthlib
    requests
    requests-oauthlib
    urlobject
    werkzeug
  ];

  optional-dependencies = {
    docs = [
      betamax
      pallets-sphinx-themes
      pillow
      sphinx
      sphinxcontrib-seqdiag
      sphinxcontrib-spelling
      sqlalchemy
    ];

    signals = [ blinker ];

    sqla = [ sqlalchemy ];

    test = [
      betamax
      coverage
      flask-caching
      flask-login
      flask-sqlalchemy
      freezegun
      oauthlib
      pytest
      pytest-mock
      responses
      sqlalchemy
    ];
  };

  nativeCheckInputs = [ pytestCheckHook ] ++ lib.flatten (lib.attrValues optional-dependencies);

  pythonImportsCheck = [ "flask_dance" ];

  meta = {
    description = "Doing the OAuth dance with style using Flask, requests, and oauthlib";
    homepage = "https://github.com/singingwolfboy/flask-dance";
    changelog = "https://github.com/singingwolfboy/flask-dance/releases/tag/${src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ getchoo ];
  };
}
+37 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pythonOlder,
  setuptools,
  wheel,
}:

buildPythonPackage rec {
  pname = "netifaces-plus";
  version = "0.12.4";
  pyproject = true;

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "tsukumijima";
    repo = "netifaces-plus";
    tag = "release_${lib.replaceStrings [ "." ] [ "_" ] version}";
    hash = "sha256-3CYAe0doWMagcUIN9+ikH9gEST9AqglSQDlZsKOMnC8=";
  };

  build-system = [
    setuptools
    wheel
  ];

  pythonImportsCheck = [ "netifaces" ];

  meta = {
    description = "Portable network interface information";
    homepage = "https://github.com/tsukumijima/netifaces-plus";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ getchoo ];
  };
}
+69 −0
Original line number Diff line number Diff line
{
  lib,
  arrow,
  beautifulsoup4,
  bibtexparser,
  buildPythonPackage,
  deprecated,
  fake-useragent,
  fetchFromGitHub,
  free-proxy,
  httpx,
  python-dotenv,
  requests,
  selenium,
  setuptools,
  sphinx-rtd-theme,
  stem,
  typing-extensions,
  wheel,
}:

buildPythonPackage rec {
  pname = "scholarly";
  version = "1.7.11";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "scholarly-python-package";
    repo = "scholarly";
    tag = "v${version}";
    hash = "sha256-yvew63tGwSjwseHK7wDqm26xiyCztUzxMqBpwwLD798=";
  };

  build-system = [
    setuptools
    wheel
  ];

  dependencies = [
    arrow
    beautifulsoup4
    bibtexparser
    deprecated
    fake-useragent
    free-proxy
    httpx
    python-dotenv
    requests
    selenium
    sphinx-rtd-theme
    typing-extensions
  ];

  optional-dependencies = {
    tor = [ stem ];
  };

  nativeCheckInputs = lib.flatten (lib.attrValues optional-dependencies);

  pythonImportsCheck = [ "scholarly" ];

  meta = {
    description = "Retrieve author and publication information from Google Scholar";
    homepage = "https://scholarly.readthedocs.io/";
    changelog = "https://github.com/scholarly-python-package/scholarly/releases/tag/${src.tag}";
    license = lib.licenses.unlicense;
    maintainers = with lib.maintainers; [ getchoo ];
  };
}
Loading