nixpkgs/pkgs/development/python-modules/snscrape/default.nix

54 lines
1.1 KiB
Nix
Raw Normal View History

2018-12-24 10:42:06 +00:00
{ lib
2021-09-01 17:33:56 +01:00
, beautifulsoup4
2018-12-24 10:42:06 +00:00
, buildPythonPackage
2021-09-01 17:33:56 +01:00
, fetchFromGitHub
2018-12-24 10:42:06 +00:00
, lxml
2021-09-01 17:33:56 +01:00
, pythonOlder
, pytz
, requests
, setuptools-scm
2018-12-24 10:42:06 +00:00
}:
buildPythonPackage rec {
pname = "snscrape";
2021-09-01 17:33:56 +01:00
version = "unstable-2021-08-30";
2018-12-24 10:42:06 +00:00
2021-09-01 17:33:56 +01:00
disabled = pythonOlder "3.8";
2018-12-24 10:42:06 +00:00
2021-09-01 17:33:56 +01:00
src = fetchFromGitHub {
owner = "JustAnotherArchivist";
repo = pname;
rev = "c76f1637ce1d7a154af83495b67ead2559cd5715";
sha256 = "01x4961fxj1p98y6fcyxw5sv8fa87x41fdx9p31is12bdkmqxi6v";
2018-12-24 10:42:06 +00:00
};
2021-09-01 17:33:56 +01:00
SETUPTOOLS_SCM_PRETEND_VERSION = version;
nativeBuildInputs = [
setuptools-scm
];
propagatedBuildInputs = [
beautifulsoup4
lxml
requests
] ++ lib.optionals (pythonOlder "3.9") [
pytz
];
2018-12-24 10:42:06 +00:00
# There are no tests; make sure the executable works.
checkPhase = ''
export PATH=$PATH:$out/bin
snscrape --help
'';
2021-09-01 17:33:56 +01:00
pythonImportsCheck = [ "snscrape" ];
2018-12-24 10:42:06 +00:00
meta = with lib; {
2020-04-01 05:59:09 +01:00
homepage = "https://github.com/JustAnotherArchivist/snscrape";
2018-12-24 10:42:06 +00:00
description = "A social networking service scraper in Python";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ ivan ];
};
}