From 6b0b9774e2401aba3e82ebba89a9f2b9e0002e0d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 1 Sep 2021 18:33:56 +0200 Subject: [PATCH] snscrape: 0.3.4 -> unstable-2021-08-30 --- .../python-modules/snscrape/default.nix | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/snscrape/default.nix b/pkgs/development/python-modules/snscrape/default.nix index a8f565aa3533..98933759f0bb 100644 --- a/pkgs/development/python-modules/snscrape/default.nix +++ b/pkgs/development/python-modules/snscrape/default.nix @@ -1,33 +1,48 @@ { lib -, buildPythonPackage -, isPy3k -, fetchPypi -, setuptools-scm -, setuptools -, requests -, lxml , beautifulsoup4 +, buildPythonPackage +, fetchFromGitHub +, lxml +, pythonOlder +, pytz +, requests +, setuptools-scm }: buildPythonPackage rec { pname = "snscrape"; - version = "0.3.4"; + version = "unstable-2021-08-30"; - disabled = !isPy3k; + disabled = pythonOlder "3.8"; - src = fetchPypi { - inherit pname version; - sha256 = "36ba7f95c8bf5202749189f760e591952f19c849379c35ff598aafafe5d0cfef"; + src = fetchFromGitHub { + owner = "JustAnotherArchivist"; + repo = pname; + rev = "c76f1637ce1d7a154af83495b67ead2559cd5715"; + sha256 = "01x4961fxj1p98y6fcyxw5sv8fa87x41fdx9p31is12bdkmqxi6v"; }; + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ + setuptools-scm + ]; + + propagatedBuildInputs = [ + beautifulsoup4 + lxml + requests + ] ++ lib.optionals (pythonOlder "3.9") [ + pytz + ]; + # There are no tests; make sure the executable works. checkPhase = '' export PATH=$PATH:$out/bin snscrape --help ''; - nativeBuildInputs = [ setuptools-scm ]; - propagatedBuildInputs = [ setuptools requests lxml beautifulsoup4 ]; + pythonImportsCheck = [ "snscrape" ]; meta = with lib; { homepage = "https://github.com/JustAnotherArchivist/snscrape";