Merge pull request #287103 from dotlambda/mdformat-propagate
python311Packages.mdformat-*: propagate dependencies
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
{ lib
|
||||
, python3
|
||||
, runCommand
|
||||
}:
|
||||
|
||||
let
|
||||
python = python3;
|
||||
|
||||
# selector is a function mapping pythonPackages to a list of plugins
|
||||
# e.g. `mdformat.withPlugins (ps: with ps; [ mdformat-footnote ])`
|
||||
withPlugins = selector: runCommand "mdformat-wrapped" {
|
||||
inherit (python.pkgs.mdformat) pname version meta;
|
||||
|
||||
nativeBuildInputs = [
|
||||
python.pkgs.wrapPython
|
||||
];
|
||||
|
||||
plugins = selector python.pkgs;
|
||||
|
||||
passthru = {
|
||||
inherit withPlugins;
|
||||
};
|
||||
} ''
|
||||
buildPythonPath $plugins
|
||||
makeWrapper ${lib.getExe python.pkgs.mdformat} $out/bin/mdformat \
|
||||
--suffix PYTHONPATH : "$program_PYTHONPATH"
|
||||
'';
|
||||
in withPlugins (ps: [ ])
|
||||
@@ -1,54 +1,42 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, flit-core
|
||||
, mdformat
|
||||
, python3
|
||||
, mdit-py-plugins
|
||||
, pytestCheckHook
|
||||
, pythonOlder
|
||||
}:
|
||||
|
||||
let
|
||||
python = python3.override {
|
||||
packageOverrides = self: super: {
|
||||
mdit-py-plugins = super.mdit-py-plugins.overridePythonAttrs (_prev: rec {
|
||||
version = "0.4.0";
|
||||
doCheck = false;
|
||||
src = fetchFromGitHub {
|
||||
owner = "executablebooks";
|
||||
repo = "mdit-py-plugins";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-YBJu0vIOD747DrJLcqiZMHq34+gHdXeGLCw1OxxzIJ0=";
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
in python.pkgs.buildPythonPackage rec {
|
||||
buildPythonPackage rec {
|
||||
pname = "mdformat-admon";
|
||||
version = "1.0.2";
|
||||
format = "pyproject";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
disabled = pythonOlder "3.8";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "KyleKing";
|
||||
repo = pname;
|
||||
repo = "mdformat-admon";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-33Q3Re/axnoOHZ9XYA32mmK+efsSelJXW8sD7C1M/jU=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = with python.pkgs; [
|
||||
nativeBuildInputs = [
|
||||
flit-core
|
||||
];
|
||||
|
||||
buildInputs = with python.pkgs; [
|
||||
propagatedBuildInputs = [
|
||||
mdformat
|
||||
];
|
||||
|
||||
propagatedBuildInputs = with python.pkgs; [
|
||||
mdit-py-plugins
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "mdformat plugin for admonitions";
|
||||
description = "Mdformat plugin for admonitions";
|
||||
homepage = "https://github.com/KyleKing/mdformat-admon";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ aldoborrero ];
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
buildPythonPackage rec {
|
||||
pname = "mdformat-beautysh";
|
||||
version = "0.1.1";
|
||||
format = "pyproject";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
@@ -28,16 +28,13 @@ buildPythonPackage rec {
|
||||
poetry-core
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
propagatedBuildInputs = [
|
||||
beautysh
|
||||
mdformat
|
||||
mdformat-gfm
|
||||
mdit-py-plugins
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
beautysh
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
buildPythonPackage rec {
|
||||
pname = "mdformat-footnote";
|
||||
version = "0.1.1";
|
||||
format = "pyproject";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
@@ -27,7 +27,7 @@ buildPythonPackage rec {
|
||||
flit-core
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
propagatedBuildInputs = [
|
||||
mdformat
|
||||
mdit-py-plugins
|
||||
];
|
||||
|
||||
@@ -28,12 +28,9 @@ buildPythonPackage rec {
|
||||
flit-core
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
propagatedBuildInputs = [
|
||||
mdformat
|
||||
mdit-py-plugins
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
ruamel-yaml
|
||||
];
|
||||
|
||||
@@ -42,7 +39,7 @@ buildPythonPackage rec {
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "mdformat plugin to ensure frontmatter is respected";
|
||||
description = "Mdformat plugin to ensure frontmatter is respected";
|
||||
homepage = "https://github.com/butler54/mdformat-frontmatter";
|
||||
changelog = "https://github.com/butler54/mdformat-frontmatter/blob/v{version}/CHANGELOG.md";
|
||||
license = licenses.mit;
|
||||
|
||||
@@ -29,14 +29,11 @@ buildPythonPackage rec {
|
||||
poetry-core
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
mdformat
|
||||
markdown-it-py
|
||||
mdit-py-plugins
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
markdown-it-py
|
||||
mdformat
|
||||
mdformat-tables
|
||||
mdit-py-plugins
|
||||
linkify-it-py
|
||||
];
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ buildPythonPackage rec {
|
||||
flit-core
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
propagatedBuildInputs = [
|
||||
mdformat
|
||||
mdformat-gfm
|
||||
mdit-py-plugins
|
||||
@@ -42,7 +42,7 @@ buildPythonPackage rec {
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "mdformat plugin for MkDocs";
|
||||
description = "Mdformat plugin for MkDocs";
|
||||
homepage = "https://github.com/KyleKing/mdformat-mkdocs";
|
||||
changelog = "https://github.com/KyleKing/mdformat-mkdocs/releases/tag/v${version}";
|
||||
license = licenses.mit;
|
||||
|
||||
@@ -1,30 +1,37 @@
|
||||
{ lib
|
||||
, alejandra
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, mdformat
|
||||
, poetry-core
|
||||
, pytestCheckHook
|
||||
, pythonOlder
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "mdformat-nix-alejandra";
|
||||
version = "0.1.0";
|
||||
format = "pyproject";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "aldoborrero";
|
||||
repo = pname;
|
||||
rev = "${version}";
|
||||
repo = "mdformat-nix-alejandra";
|
||||
rev = "refs/tags/${version}";
|
||||
hash = "sha256-jUXApGsxCA+pRm4m4ZiHWlxmVkqCPx3A46oQdtyKz5g=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace mdformat_nix_alejandra/__init__.py \
|
||||
--replace-fail '"alejandra"' '"${lib.getExe alejandra}"'
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
poetry-core
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
propagatedBuildInputs = [
|
||||
mdformat
|
||||
];
|
||||
|
||||
@@ -32,6 +39,10 @@ buildPythonPackage rec {
|
||||
"mdformat_nix_alejandra"
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Mdformat plugin format Nix code blocks with alejandra";
|
||||
homepage = "https://github.com/aldoborrero/mdformat-nix-alejandra";
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
buildPythonPackage rec {
|
||||
pname = "mdformat-simple-breaks";
|
||||
version = "0.0.1";
|
||||
format = "pyproject";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
@@ -25,7 +25,7 @@ buildPythonPackage rec {
|
||||
flit-core
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
propagatedBuildInputs = [
|
||||
mdformat
|
||||
];
|
||||
|
||||
@@ -34,7 +34,7 @@ buildPythonPackage rec {
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "mdformat plugin to render thematic breaks using three dashes";
|
||||
description = "Mdformat plugin to render thematic breaks using three dashes";
|
||||
homepage = "https://github.com/csala/mdformat-simple-breaks";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ aldoborrero ];
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
buildPythonPackage rec {
|
||||
pname = "mdformat-tables";
|
||||
version = "0.4.1";
|
||||
format = "pyproject";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
@@ -26,7 +26,7 @@ buildPythonPackage rec {
|
||||
flit-core
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
propagatedBuildInputs = [
|
||||
mdformat
|
||||
];
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
buildPythonPackage rec {
|
||||
pname = "mdformat-toc";
|
||||
version = "0.3.0";
|
||||
format = "pyproject";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
@@ -26,7 +26,7 @@ buildPythonPackage rec {
|
||||
poetry-core
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
propagatedBuildInputs = [
|
||||
mdformat
|
||||
];
|
||||
|
||||
|
||||
@@ -5,99 +5,57 @@
|
||||
, importlib-metadata
|
||||
, makeWrapper
|
||||
, markdown-it-py
|
||||
, poetry-core
|
||||
, pytestCheckHook
|
||||
, python3
|
||||
, pythonOlder
|
||||
, setuptools
|
||||
, tomli
|
||||
, typing-extensions
|
||||
}:
|
||||
|
||||
let
|
||||
withPlugins = plugins: buildPythonApplication {
|
||||
pname = "${package.pname}";
|
||||
inherit (package) version;
|
||||
format = "other";
|
||||
buildPythonPackage rec {
|
||||
pname = "mdformat";
|
||||
version = "0.7.17";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
disabled = pythonOlder "3.8";
|
||||
|
||||
dontUnpack = true;
|
||||
dontBuild = true;
|
||||
doCheck = false;
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
makeWrapper ${package}/bin/mdformat $out/bin/mdformat \
|
||||
--prefix PYTHONPATH : "${package}/${python3.sitePackages}:$PYTHONPATH"
|
||||
ln -sfv ${package}/lib $out/lib
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = package.propagatedBuildInputs ++ plugins;
|
||||
|
||||
passthru = package.passthru // {
|
||||
withPlugins = morePlugins: withPlugins (morePlugins ++ plugins);
|
||||
};
|
||||
|
||||
meta.mainProgram = "mdformat";
|
||||
src = fetchFromGitHub {
|
||||
owner = "executablebooks";
|
||||
repo = "mdformat";
|
||||
rev = "refs/tags/${version}";
|
||||
hash = "sha256-umtfbhN6sDR/rFr1LwmJ21Ph9bK1Qq43bmMVzGCPD5s=";
|
||||
};
|
||||
|
||||
package = buildPythonPackage rec {
|
||||
pname = "mdformat";
|
||||
version = "0.7.17";
|
||||
format = "pyproject";
|
||||
nativeBuildInputs = [
|
||||
setuptools
|
||||
];
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
propagatedBuildInputs = [
|
||||
markdown-it-py
|
||||
] ++ lib.optionals (pythonOlder "3.11") [
|
||||
tomli
|
||||
] ++ lib.optionals (pythonOlder "3.10") [
|
||||
importlib-metadata
|
||||
];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "executablebooks";
|
||||
repo = pname;
|
||||
rev = "refs/tags/${version}";
|
||||
hash = "sha256-umtfbhN6sDR/rFr1LwmJ21Ph9bK1Qq43bmMVzGCPD5s=";
|
||||
};
|
||||
nativeCheckInputs = [
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
poetry-core
|
||||
setuptools
|
||||
];
|
||||
pythonImportsCheck = [
|
||||
"mdformat"
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
markdown-it-py
|
||||
tomli
|
||||
] ++ lib.optionals (pythonOlder "3.10") [
|
||||
importlib-metadata
|
||||
] ++ lib.optionals (pythonOlder "3.7") [
|
||||
typing-extensions
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
disabledTests = [
|
||||
# AssertionError
|
||||
"test_no_codeblock_trailing_newline"
|
||||
# Issue with upper/lower case
|
||||
"default_style.md-options0"
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"mdformat"
|
||||
];
|
||||
|
||||
passthru = { inherit withPlugins; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "CommonMark compliant Markdown formatter";
|
||||
homepage = "https://mdformat.rtfd.io/";
|
||||
changelog = "https://github.com/executablebooks/mdformat/blob/${version}/docs/users/changelog.md";
|
||||
license = with licenses; [ mit ];
|
||||
maintainers = with maintainers; [ fab aldoborrero ];
|
||||
mainProgram = "mdformat";
|
||||
};
|
||||
passthru = {
|
||||
withPlugins = throw "Use pkgs.mdformat.withPlugins, i.e. the top-level attribute.";
|
||||
};
|
||||
in
|
||||
package
|
||||
|
||||
meta = with lib; {
|
||||
description = "CommonMark compliant Markdown formatter";
|
||||
homepage = "https://mdformat.rtfd.io/";
|
||||
changelog = "https://github.com/executablebooks/mdformat/blob/${version}/docs/users/changelog.md";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ fab aldoborrero ];
|
||||
mainProgram = "mdformat";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user