Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3.pkgs.sphinxcontrib-openapi: unbreak, switch to cilium fork #188280

Merged
merged 3 commits into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions pkgs/development/python-modules/picobox/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, flask
, isPy27
, pytestCheckHook
, pythonAtLeast
, setuptools-scm
}:

buildPythonPackage rec {
pname = "picobox";
version = "2.2.0";

disabled = isPy27;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be pythonOlder "3.7"


src = fetchFromGitHub {
owner = "ikalnytskyi";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-B2A8GMhBFU/mb/JiiqtP+HvpPj5FYwaYO3gQN2QI6z0=";
};

patches = [
(fetchpatch {
# already in master, but no new release yet.
# https://github.com/ikalnytskyi/picobox/issues/55
url = "https://github.com/ikalnytskyi/picobox/commit/1fcc4a0c26a7cd50ee3ef6694139177b5dfb2be0.patch";
hash = "sha256-/NIEzTFlZ5wG7jHT/YdySYoxT/UhSk29Up9/VqjG/jg=";
includes = [
"tests/test_box.py"
"tests/test_stack.py"
];
})
];

SETUPTOOLS_SCM_PRETEND_VERSION = version;

nativeBuildInputs = [
setuptools-scm
];

checkInputs = [
flask
pytestCheckHook
];

pythonImportsCheck = [
"picobox"
];

meta = with lib; {
description = "Opinionated dependency injection framework";
homepage = "https://github.com/ikalnytskyi/picobox";
license = licenses.mit;
maintainers = with maintainers; [ flokli ];
};
}
41 changes: 41 additions & 0 deletions pkgs/development/python-modules/sphinx-mdinclude/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{ lib
, buildPythonPackage
, fetchpatch
, fetchPypi
, flit-core
, docutils
, mistune
, pygments
}:

buildPythonPackage rec {
pname = "sphinx-mdinclude";
version = "0.5.2";
format = "flit";

src = fetchPypi {
pname = "sphinx_mdinclude";
inherit version;
hash = "sha256-F7UVe1xNrz+vCbJOCxwyJQoxfwSCORW+qu9vDH7oEPc=";
};

nativeBuildInputs = [ flit-core ];
propagatedBuildInputs = [ mistune docutils ];

checkInputs = [ pygments ];

meta = with lib; {
homepage = "https://github.com/miyakogi/m2r";
description = "Sphinx extension for including or writing pages in Markdown format.";
longDescription = ''
A simple Sphinx extension that enables including Markdown documents from within
reStructuredText.
It provides the .. mdinclude:: directive, and automatically converts the content of
Markdown documents to reStructuredText format.

sphinx-mdinclude is a fork of m2r and m2r2, focused only on providing a Sphinx extension.
'';
license = licenses.mit;
maintainers = with maintainers; [ flokli ];
};
}
37 changes: 28 additions & 9 deletions pkgs/development/python-modules/sphinxcontrib-openapi/default.nix
Original file line number Diff line number Diff line change
@@ -1,26 +1,46 @@
{ lib
, buildPythonPackage
, fetchPypi
, deepmerge
, fetchFromGitHub
, fetchpatch
, isPy27
, setuptools-scm
, m2r
, pyyaml
, jsonschema
, picobox
, pyyaml
, sphinx-mdinclude
, sphinxcontrib_httpdomain
}:

buildPythonPackage rec {
pname = "sphinxcontrib-openapi";
version = "0.7.0";
version = "unstable-2022-08-26";
disabled = isPy27;
flokli marked this conversation as resolved.
Show resolved Hide resolved

src = fetchPypi {
inherit pname version;
sha256 = "1c1bd10d7653912c59a42f727c62cbb7b75f7905ddd9ccc477ebfd1bc69f0cf3";
# Switch to Cilums' fork of openapi, which uses m2r instead of mdinclude,
# as m2r is unmaintained and incompatible with the version of mistune.
# See
# https://github.com/cilium/cilium/commit/b9862461568dd41d4dc8924711d4cc363907270b and
# https://github.com/cilium/openapi/commit/cd829a05caebd90b31e325d4c9c2714b459d135f
# for details.
src = fetchFromGitHub {
owner = "cilium";
repo = "openapi";
rev = "0ea3332fa6482114f1a8248a32a1eacb61aebb69";
hash = "sha256-a/oVMg9gGTD+NClfpC2SpjbY/mIcZEVLLOR0muAg5zY=";
};

nativeBuildInputs = [ setuptools-scm ];
propagatedBuildInputs = [ pyyaml jsonschema m2r sphinxcontrib_httpdomain ];
propagatedBuildInputs = [
deepmerge
jsonschema
picobox
pyyaml
sphinx-mdinclude
sphinxcontrib_httpdomain
];

SETUPTOOLS_SCM_PRETEND_VERSION = version;

doCheck = false;

Expand All @@ -29,5 +49,4 @@ buildPythonPackage rec {
description = "OpenAPI (fka Swagger) spec renderer for Sphinx";
license = licenses.bsd0;
flokli marked this conversation as resolved.
Show resolved Hide resolved
};

}
4 changes: 4 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6736,6 +6736,8 @@ in {

pickleshare = callPackage ../development/python-modules/pickleshare { };

picobox = callPackage ../development/python-modules/picobox { };

picos = callPackage ../development/python-modules/picos { };

pid = callPackage ../development/python-modules/pid { };
Expand Down Expand Up @@ -10348,6 +10350,8 @@ in {

sphinx-navtree = callPackage ../development/python-modules/sphinx-navtree { };

sphinx-mdinclude = callPackage ../development/python-modules/sphinx-mdinclude { };

sphinx_pypi_upload = callPackage ../development/python-modules/sphinx_pypi_upload { };

sphinx-rtd-theme = callPackage ../development/python-modules/sphinx-rtd-theme { };
Expand Down