1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, sphinx
5, matplotlib
6, pytestCheckHook
7, pythonOlder
8, beautifulsoup4
9, setuptools-scm
10}:
11
12buildPythonPackage rec {
13 pname = "sphinxext-opengraph";
14 version = "0.9.0";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.8";
18
19 src = fetchFromGitHub {
20 owner = "wpilibsuite";
21 repo = "sphinxext-opengraph";
22 rev = "refs/tags/v${version}";
23 hash = "sha256-ZLIxbFgayG+WVvSXu74eZJ/PbSHg6dzkkIr1OBry4DE=";
24 };
25
26 SETUPTOOLS_SCM_PRETEND_VERSION = version;
27
28 nativeBuildInputs = [
29 setuptools-scm
30 ];
31
32 passthru.optional-dependencies = {
33 social_cards_generation = [
34 matplotlib
35 ];
36 };
37
38 propagatedBuildInputs = [
39 sphinx
40 ];
41
42 nativeCheckInputs = [
43 pytestCheckHook
44 beautifulsoup4
45 ] ++ passthru.optional-dependencies.social_cards_generation;
46
47 pythonImportsCheck = [ "sphinxext.opengraph" ];
48
49 meta = with lib; {
50 description = "Sphinx extension to generate unique OpenGraph metadata";
51 homepage = "https://github.com/wpilibsuite/sphinxext-opengraph";
52 changelog = "https://github.com/wpilibsuite/sphinxext-opengraph/releases/tag/v${version}";
53 license = licenses.mit;
54 maintainers = with maintainers; [ Luflosi ];
55 };
56}