From a457d05aaa8785a100a1678716ebf20ff5f0aa5d Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Fri, 23 Feb 2024 23:59:31 +0800 Subject: [PATCH] lastversion, python3Packages.lastversion: init at 3.5.0 Co-authored-by: Anderson Torres Co-authored-by: Arne Keller <2012gdwu+github@posteo.de> Co-authored-by: Sandro --- pkgs/by-name/la/lastversion/package.nix | 4 + .../python-modules/lastversion/default.nix | 86 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 92 insertions(+) create mode 100644 pkgs/by-name/la/lastversion/package.nix create mode 100644 pkgs/development/python-modules/lastversion/default.nix diff --git a/pkgs/by-name/la/lastversion/package.nix b/pkgs/by-name/la/lastversion/package.nix new file mode 100644 index 000000000000..a9d3aef43c5d --- /dev/null +++ b/pkgs/by-name/la/lastversion/package.nix @@ -0,0 +1,4 @@ +{ python3Packages }: + +with python3Packages; +toPythonApplication lastversion diff --git a/pkgs/development/python-modules/lastversion/default.nix b/pkgs/development/python-modules/lastversion/default.nix new file mode 100644 index 000000000000..8e5e2d28d876 --- /dev/null +++ b/pkgs/development/python-modules/lastversion/default.nix @@ -0,0 +1,86 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pythonOlder, + # nativeBuildInputs + setuptools, + # nativeCheckInputs + pytestCheckHook, + # install_requires + appdirs, + beautifulsoup4, + cachecontrol, + distro, + feedparser, + packaging, + python-dateutil, + pyyaml, + requests, + tqdm, + urllib3, +}: + +buildPythonPackage rec { + pname = "lastversion"; + version = "3.5.0"; + pyproject = true; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "dvershinin"; + repo = "lastversion"; + rev = "v${version}"; + hash = "sha256-SeDLpMP8cF6CC3qJ6V8dLErl6ihpnl4lHeBkp7jtQgI="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + appdirs + beautifulsoup4 + cachecontrol + distro + feedparser + packaging + python-dateutil + pyyaml + requests + tqdm + urllib3 + ] ++ cachecontrol.optional-dependencies.filecache; + + pythonRelaxDeps = [ + "cachecontrol" # Use newer cachecontrol that uses filelock instead of lockfile + "urllib3" # The cachecontrol and requests incompatibility issue is closed + ]; + + pythonRemoveDeps = [ + "lockfile" # "cachecontrol" now uses filelock + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pytestFlags = [ + "tests/test_cli.py" + "-k" + "test_cli_format" + ]; + + # CLI tests expect the output bin/ in PATH + preCheck = '' + PATH="$out/bin:$PATH" + ''; + + pythonImportsCheck = [ "lastversion" ]; + + meta = { + description = "Find the latest release version of an arbitrary project"; + homepage = "https://github.com/dvershinin/lastversion"; + changelog = "https://github.com/dvershinin/lastversion/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ ShamrockLee ]; + mainProgram = "lastversion"; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 628f6135a4bd..2ccd4e0c526e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7235,6 +7235,8 @@ self: super: with self; { laspy = callPackage ../development/python-modules/laspy { }; + lastversion = callPackage ../development/python-modules/lastversion { }; + laszip = callPackage ../development/python-modules/laszip { inherit (pkgs) cmake ninja; inherit (pkgs.__splicedPackages) laszip;