From aca2ed897385f619370e69d7d92aec3f483353c7 Mon Sep 17 00:00:00 2001 From: Sam <30577766+Samasaur1@users.noreply.github.com> Date: Sat, 6 Jul 2024 21:39:29 -0700 Subject: [PATCH] fichub-cli: init at 0.10.3 --- pkgs/by-name/fi/fichub-cli/package.nix | 62 ++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 pkgs/by-name/fi/fichub-cli/package.nix diff --git a/pkgs/by-name/fi/fichub-cli/package.nix b/pkgs/by-name/fi/fichub-cli/package.nix new file mode 100644 index 000000000000..3d62d7b2a304 --- /dev/null +++ b/pkgs/by-name/fi/fichub-cli/package.nix @@ -0,0 +1,62 @@ +{ lib, python3Packages, fetchPypi }: + +python3Packages.buildPythonApplication rec { + pname = "fichub-cli"; + version = "0.10.3"; + pyproject = true; + + src = fetchPypi { + pname = "fichub_cli"; + inherit version; + hash = "sha256-MTExXpuCwi/IfNDUVLMcxfFRwHHNfGJerHkHnh6/hls="; + }; + + build-system = with python3Packages; [ + setuptools + ]; + + dependencies = with python3Packages; [ + platformdirs + beautifulsoup4 + click + click-plugins + colorama + loguru + requests + tqdm + typer + ]; + + pythonImportsCheck = [ + "fichub_cli" + ]; + + nativeCheckInputs = with python3Packages; [ + pytestCheckHook + ]; + + # The package tries to create a file under the home directory on import + preCheck = '' + export HOME=$(mktemp -d) + ''; + + pytestFlagsArray = [ + # pytest exits with a code of 5 if no tests are selected. + # handle this specific case as not an error + "|| ([ $? = 5 ] || exit $?)" + ]; + + disabledTestPaths = [ + # Loading tests tries to download something from pypi.org + "tests/test_cli.py" + ]; + + meta = { + description = "CLI for the fichub.net API"; + changelog = "https://github.com/FicHub/fichub-cli/releases/tag/v${version}"; + mainProgram = "fichub_cli"; + homepage = "https://github.com/FicHub/fichub-cli"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.samasaur ]; + }; +}