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

python312Packages.markitdown: init at 0-unstable-2024-12-18 #365681

Merged
merged 6 commits into from
Dec 18, 2024
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
51 changes: 51 additions & 0 deletions pkgs/development/python-modules/cobble/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
pytestCheckHook,
gitUpdater,
}:

buildPythonPackage rec {
pname = "cobble";
version = "0.1.4";
pyproject = true;

src = fetchFromGitHub {
owner = "mwilliamson";
repo = "python-cobble";
tag = version;
hash = "sha256-xi6cCSUnMYc5Tp6+TQlC9Oo9kpam5C7QGCul/IoTW1k=";
};

build-system = [ setuptools ];

pythonImportsCheck = [ "cobble" ];

nativeCheckInputs = [
pytestCheckHook
];

pytestFlagsArray = [ "tests.py" ];

disabledTests = [
# Broken tests
#
# left = "Can't instantiate abstract class Evaluator with abstract method visit_add"
# right = "Can't instantiate abstract class Evaluator without an implementation for abstract method 'visit_add'"
"test_error_if_visitor_is_missing_methods"
# left = "Can't instantiate abstract class Evaluator with abstract method visit_literal"
# right = "Can't instantiate abstract class Evaluator without an implementation for abstract method 'visit_literal'"
"test_sub_sub_classes_are_included_in_abc"
];

passthru.updateScripts = gitUpdater { };

drupol marked this conversation as resolved.
Show resolved Hide resolved
meta = {
description = "Create Python data objects";
homepage = "https://github.com/mwilliamson/python-cobble";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ drupol ];
};
}
40 changes: 40 additions & 0 deletions pkgs/development/python-modules/funk/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
precisely,
gitUpdater,
}:

buildPythonPackage rec {
pname = "funk";
version = "0.5.0";
pyproject = true;

src = fetchFromGitHub {
owner = "mwilliamson";
repo = "funk";
tag = version;
hash = "sha256-dEq3zyA8rtNt0sui2TfQ3OUSCZ0XDMOdthcqt/QrCsU=";
};

build-system = [ setuptools ];

dependencies = [ precisely ];

pythonImportsCheck = [ "funk" ];

# Disabling tests, they rely on Nose which is outdated and not supported
doCheck = false;

passthru.updateScripts = gitUpdater { };

drupol marked this conversation as resolved.
Show resolved Hide resolved
meta = {
description = "A mocking framework for Python, influenced by JMock";
homepage = "https://github.com/mwilliamson/funk";
changelog = "https://github.com/mwilliamson/funk/blob/${src.tag}/NEWS";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ drupol ];
};
}
57 changes: 57 additions & 0 deletions pkgs/development/python-modules/mammoth/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
cobble,
funk,
pytestCheckHook,
spur,
tempman,
gitUpdater,
}:

buildPythonPackage rec {
pname = "mammoth";
version = "1.8.0";
pyproject = true;

src = fetchFromGitHub {
owner = "mwilliamson";
repo = "python-mammoth";
tag = version;
hash = "sha256-mIvzEyKpy1j7tZti+QTXgsbqqZAhYs7N+p5sQFsLhBg=";
};

postPatch = ''
substituteInPlace setup.py \
--replace-fail 'read("README")' '""'
'';

build-system = [ setuptools ];

dependencies = [ cobble ];

pythonImportsCheck = [ "mammoth" ];

nativeCheckInputs = [
funk
pytestCheckHook
spur
tempman
];

preCheck = ''
export PATH=$out/bin:$PATH
'';

drupol marked this conversation as resolved.
Show resolved Hide resolved
passthru.updateScripts = gitUpdater { };

meta = {
description = "Convert Word documents (.docx files) to HTML";
homepage = "https://github.com/mwilliamson/python-mammoth";
changelog = "https://github.com/mwilliamson/python-mammoth/blob/${src.tag}/NEWS";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ drupol ];
};
}
76 changes: 76 additions & 0 deletions pkgs/development/python-modules/markitdown/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
hatchling,
beautifulsoup4,
ffmpeg-headless,
mammoth,
markdownify,
numpy,
openai,
openpyxl,
pandas,
pathvalidate,
pdfminer-six,
puremagic,
pydub,
python-pptx,
requests,
speechrecognition,
youtube-transcript-api,
pytestCheckHook,
gitUpdater,
}:

buildPythonPackage {
pname = "markitdown";
version = "unstable-2024-12-18";
pyproject = true;

src = fetchFromGitHub {
owner = "microsoft";
repo = "markitdown";
rev = "3ce21a47abed0e4db162de1088d661887ae076ff";
hash = "sha256-5YafFL8OHNcGgB/qH6CmX0rTith1ZSRNIa+ktl4Ffvg=";
};

build-system = [ hatchling ];

dependencies = [
beautifulsoup4
ffmpeg-headless
mammoth
markdownify
numpy
openai
openpyxl
pandas
pathvalidate
pdfminer-six
puremagic
pydub
python-pptx
requests
speechrecognition
youtube-transcript-api
];

pythonImportsCheck = [ "markitdown" ];

nativeCheckInputs = [ pytestCheckHook ];

disabledTests = [
# Require network access
"test_markitdown_remote"
drupol marked this conversation as resolved.
Show resolved Hide resolved
];

drupol marked this conversation as resolved.
Show resolved Hide resolved
passthru.updateScripts = gitUpdater { };

meta = {
description = "Python tool for converting files and office documents to Markdown";
homepage = "https://github.com/microsoft/markitdown";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ drupol ];
};
}
37 changes: 37 additions & 0 deletions pkgs/development/python-modules/precisely/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
pytestCheckHook,
gitUpdater,
}:

buildPythonPackage rec {
pname = "precisely";
version = "0.1.9";
pyproject = true;

src = fetchFromGitHub {
owner = "mwilliamson";
repo = "python-precisely";
tag = version;
hash = "sha256-jvvRreSGpRgDk1bbqC8Z/UEfvxwKilfc/sm7nxdJU6k=";
};

build-system = [ setuptools ];

pythonImportsCheck = [ "precisely" ];

# Tests are outdated and based on Nose, which is not supported anymore.
doCheck = false;

passthru.updateScripts = gitUpdater { };

drupol marked this conversation as resolved.
Show resolved Hide resolved
meta = {
description = "Matcher library for Python";
homepage = "https://github.com/mwilliamson/python-precisely";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ drupol ];
};
}
42 changes: 42 additions & 0 deletions pkgs/development/python-modules/tempman/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
pytestCheckHook,
gitUpdater,
}:

buildPythonPackage rec {
pname = "tempman";
version = "0.1.3";
pyproject = true;

src = fetchFromGitHub {
owner = "mwilliamson";
repo = "python-tempman";
tag = version;
hash = "sha256-EHTnlT3vcmyjyyS3QCJXjAuZqOEc0i11rEb6zfX6rDY=";
};

postPatch = ''
substituteInPlace setup.py \
--replace-fail 'read("README")' '""'
'';

build-system = [ setuptools ];

pythonImportsCheck = [ "tempman" ];

# Disabling tests, they rely on dependencies that are outdated and not supported
doCheck = false;

passthru.updateScripts = gitUpdater { };

drupol marked this conversation as resolved.
Show resolved Hide resolved
meta = {
description = "Create and clean up temporary directories";
homepage = "https://github.com/mwilliamson/python-tempman";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ drupol ];
};
}
12 changes: 12 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2480,6 +2480,8 @@ self: super: with self; {

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

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

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

cocotb = callPackage ../development/python-modules/cocotb { };
Expand Down Expand Up @@ -4965,6 +4967,8 @@ self: super: with self; {

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

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

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

furl = callPackage ../development/python-modules/furl { };
Expand Down Expand Up @@ -7803,6 +7807,8 @@ self: super: with self; {

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

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

mamba-ssm = callPackage ../development/python-modules/mamba-ssm { };

managesieve = callPackage ../development/python-modules/managesieve { };
Expand Down Expand Up @@ -7863,6 +7869,8 @@ self: super: with self; {

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

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

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

markupsafe = callPackage ../development/python-modules/markupsafe { };
Expand Down Expand Up @@ -10404,6 +10412,8 @@ self: super: with self; {

ppk2-api = callPackage ../development/python-modules/ppk2-api { };

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

primp = callPackage ../development/python-modules/primp {
inherit (pkgs.darwin.apple_sdk.frameworks) SystemConfiguration;
};
Expand Down Expand Up @@ -15749,6 +15759,8 @@ self: super: with self; {

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

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

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

tenacity = callPackage ../development/python-modules/tenacity { };
Expand Down
Loading