depot/third_party/nixpkgs/pkgs/development/python-modules/htmldate/default.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

78 lines
1.7 KiB
Nix

{
lib,
backports-datetime-fromisoformat,
buildPythonPackage,
charset-normalizer,
dateparser,
faust-cchardet,
fetchFromGitHub,
lxml,
pytestCheckHook,
python-dateutil,
pythonOlder,
setuptools,
urllib3,
}:
buildPythonPackage rec {
pname = "htmldate";
version = "1.9.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "adbar";
repo = "htmldate";
rev = "refs/tags/v${version}";
hash = "sha256-sddPlVaYenR8sQG/ronkYIcVH5nyQzcjF8rfeMr5I78=";
};
build-system = [ setuptools ];
dependencies = [
charset-normalizer
dateparser
lxml
python-dateutil
urllib3
];
passthru.optional-dependencies = {
speed =
[
faust-cchardet
urllib3
]
++ lib.optionals (pythonOlder "3.11") [ backports-datetime-fromisoformat ]
++ urllib3.optional-dependencies.brotli;
all =
[
faust-cchardet
urllib3
]
++ lib.optionals (pythonOlder "3.11") [ backports-datetime-fromisoformat ]
++ urllib3.optional-dependencies.brotli;
};
nativeCheckInputs = [ pytestCheckHook ];
disabledTests = [
# Tests that require an internet connection
"test_input"
"test_cli"
"test_download"
"test_readme_examples"
];
pythonImportsCheck = [ "htmldate" ];
meta = with lib; {
description = "Module for the extraction of original and updated publication dates from URLs and web pages";
homepage = "https://htmldate.readthedocs.io";
changelog = "https://github.com/adbar/htmldate/blob/v${version}/CHANGELOG.md";
license = licenses.asl20;
maintainers = with maintainers; [ jokatzke ];
mainProgram = "htmldate";
};
}