python3Packages.gradio-pdf: init at 0.0.3

This commit is contained in:
Peder Bergebakken Sundt 2023-12-17 00:16:26 +01:00 committed by Martin Weinelt
parent ed2cb7927b
commit 6722aa294f
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759
4 changed files with 73 additions and 23 deletions

View File

@ -0,0 +1,50 @@
{ lib
, buildPythonPackage
, fetchPypi
, hatch-fancy-pypi-readme
, hatch-requirements-txt
, hatchling
, gradio
, gradio-client
}:
buildPythonPackage rec {
pname = "gradio-pdf";
version = "0.0.3";
format = "pyproject";
src = fetchPypi {
pname = "gradio_pdf";
inherit version;
hash = "sha256-l9bcH/6paEdKk9Q7HM3ap9MI1Qi7rPZ/ucAibBUEPKI=";
};
nativeBuildInputs = [
hatch-fancy-pypi-readme
hatch-requirements-txt
hatchling
];
propagatedBuildInputs = [
gradio-client
];
buildInputs = [
gradio.sans-reverse-dependencies
];
disallowedReferences = [
gradio.sans-reverse-dependencies
];
pythonImportsCheck = [ "gradio_pdf" ];
# tested in `gradio`
doCheck = false;
meta = with lib; {
description = "Python library for easily interacting with trained machine learning models";
homepage = "https://pypi.org/project/gradio-pdf/";
license = licenses.asl20;
maintainers = with maintainers; [ pbsds ];
};
}

View File

@ -25,24 +25,6 @@
, gradio
}:
let
# Cyclic dependencies are fun!
# This is gradio without gradio-client, only needed for checkPhase
gradio' = (gradio.override (old: {
gradio-client = null;
})).overridePythonAttrs (old: {
pname = old.pname + "-sans-client";
nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ pythonRelaxDepsHook ];
pythonRemoveDeps = (old.pythonRemoveDeps or []) ++ [ "gradio-client" ];
doInstallCheck = false;
doCheck = false;
pythonImportsCheck = null;
dontCheckRuntimeDeps = true;
});
in
buildPythonPackage rec {
pname = "gradio-client";
version = "0.7.3";
@ -87,17 +69,16 @@ buildPythonPackage rec {
websockets
];
nativeCheckInputs =[
nativeCheckInputs = [
pytestCheckHook
pytest-asyncio
pydub
rich
tomlkit
gradio'
];
disallowedReferences = [
gradio' # ensuring we don't propagate this intermediate build
gradio.sans-reverse-dependencies
];
# ensuring we don't propagate this intermediate build
disallowedReferences = [ gradio.sans-reverse-dependencies ];
# Add a pytest hook skipping tests that access network, marking them as "Expected fail" (xfail).
preCheck = ''

View File

@ -3,6 +3,7 @@
, fetchPypi
, pythonOlder
, pythonRelaxDepsHook
, gradio
# pyproject
, hatchling
@ -165,6 +166,22 @@ buildPythonPackage rec {
pythonImportsCheck = [ "gradio" ];
# Cyclic dependencies are fun!
# This is gradio without gradio-client and gradio-pdf
passthru = {
sans-reverse-dependencies = (gradio.override (old: {
gradio-client = null;
})).overridePythonAttrs (old: {
pname = old.pname + "-sans-client";
nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ pythonRelaxDepsHook ];
pythonRemoveDeps = (old.pythonRemoveDeps or []) ++ [ "gradio-client" ];
doInstallCheck = false;
doCheck = false;
pythonImportsCheck = null;
dontCheckRuntimeDeps = true;
});
};
meta = with lib; {
homepage = "https://www.gradio.app/";
description = "Python library for easily interacting with trained machine learning models";

View File

@ -4821,6 +4821,8 @@ self: super: with self; {
gradio-client = callPackage ../development/python-modules/gradio/client.nix { };
gradio-pdf = callPackage ../development/python-modules/gradio-pdf { };
grafanalib = callPackage ../development/python-modules/grafanalib/default.nix { };
grammalecte = callPackage ../development/python-modules/grammalecte { };