Unverified Commit dd51a39c authored by Bruno BELANYI's avatar Bruno BELANYI Committed by GitHub
Browse files

nemorosa: init at 0.3.0 (#451915)

parents e4e70495 32257c8e
Loading
Loading
Loading
Loading
+65 −0
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  python3Packages,
}:

python3Packages.buildPythonApplication rec {
  pname = "nemorosa";
  version = "0.3.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "KyokoMiki";
    repo = "nemorosa";
    tag = version;
    hash = "sha256-UBvtff5fU3kH/+Kw426+yyoyJ3aASBIYDPX+X5jqkA8=";
  };

  # Upstream uses overly strict, fresh version specifiers
  pythonRelaxDeps = true;

  # `build-system` requirements are seemingly not covered by pythonRelaxDeps
  postPatch = ''
    sed -i 's/requires = \["uv_build.*"\]/requires = ["uv_build"]/' pyproject.toml
  '';

  build-system = with python3Packages; [ uv-build ];

  dependencies =
    with python3Packages;
    [
      aiolimiter
      apscheduler
      beautifulsoup4
      defusedxml
      deluge-client
      fastapi
      httpx
      humanfriendly
      msgspec
      platformdirs
      qbittorrent-api
      reflink-copy
      sqlalchemy
      torf
      transmission-rpc
      uvicorn
      uvloop
    ]
    ++ beautifulsoup4.optional-dependencies.lxml
    ++ msgspec.optional-dependencies.yaml
    ++ sqlalchemy.optional-dependencies.aiosqlite
    ++ uvicorn.optional-dependencies.standard;

  pythonImportsCheck = [ "nemorosa" ];

  meta = {
    description = "Specialized cross-seeding tool designed for music torrents";
    homepage = "https://github.com/KyokoMiki/nemorosa";
    changelog = "https://github.com/KyokoMiki/nemorosa/releases";
    license = lib.licenses.gpl3Plus;
    maintainers = with lib.maintainers; [ ambroisie ];
    mainProgram = "nemorosa";
  };
}
+45 −0
Original line number Diff line number Diff line
@@ -3,7 +3,22 @@
  buildPythonPackage,
  fetchFromGitHub,
  pythonOlder,
  attrs,
  coverage,
  furo,
  ipython,
  msgpack,
  mypy,
  pre-commit,
  pyright,
  pytest,
  pyyaml,
  setuptools,
  sphinx,
  sphinx-copybutton,
  sphinx-design,
  tomli,
  tomli-w,
}:

buildPythonPackage rec {
@@ -26,6 +41,36 @@ buildPythonPackage rec {

  build-system = [ setuptools ];

  optional-dependencies = {
    dev = [
      coverage
      mypy
      pre-commit
      pyright
    ]
    ++ optional-dependencies.doc
    ++ optional-dependencies.test;
    doc = [
      furo
      ipython
      sphinx
      sphinx-copybutton
      sphinx-design
    ];
    test = [
      attrs
      msgpack
      pytest
    ]
    ++ optional-dependencies.yaml
    ++ optional-dependencies.toml;
    toml = [
      tomli-w
    ]
    ++ lib.optional (pythonOlder 3.11) tomli;
    yaml = [ pyyaml ];
  };

  # Requires libasan to be accessible
  doCheck = false;

+41 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  rustPlatform,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "reflink-copy";
  version = "0.3.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "iterative";
    repo = "reflink-copy";
    tag = version;
    hash = "sha256-HxUAsqV5kjstfBfY/nEGJ3epUVT5WXoTqKerUggKDyo=";
  };

  cargoDeps = rustPlatform.fetchCargoVendor {
    inherit pname version src;
    hash = "sha256-TBKVf0kRRYn+1aYvhQHCHmJEsT0khFxp8iuyEWX9xyI=";
  };

  nativeBuildInputs = with rustPlatform; [
    cargoSetupHook
    maturinBuildHook
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "reflink_copy" ];

  meta = with lib; {
    description = "Python wrapper for reflink_copy Rust library";
    homepage = "https://github.com/iterative/reflink-copy";
    license = licenses.asl20;
    maintainers = with maintainers; [ ambroisie ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -15916,6 +15916,8 @@ self: super: with self; {
  reflink = callPackage ../development/python-modules/reflink { };
  reflink-copy = callPackage ../development/python-modules/reflink-copy { };
  refoss-ha = callPackage ../development/python-modules/refoss-ha { };
  regenmaschine = callPackage ../development/python-modules/regenmaschine { };