2024-09-17 12:32:11 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package python-camelot-py
|
|
|
|
|
#
|
2025-06-17 09:25:18 +00:00
|
|
|
# Copyright (c) 2025 SUSE LLC
|
2024-09-17 12:32:11 +00:00
|
|
|
#
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
2025-06-17 09:25:18 +00:00
|
|
|
%bcond_without libalternatives
|
2024-09-17 12:32:11 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
|
|
|
|
Name: python-camelot-py
|
|
|
|
|
Version: 0.11.0
|
|
|
|
|
Release: 0
|
|
|
|
|
Summary: PDF Table Extraction for Humans
|
|
|
|
|
License: MIT
|
|
|
|
|
URL: https://github.com/camelot-dev/camelot
|
|
|
|
|
Source: https://github.com/camelot-dev/camelot/archive/refs/tags/v%{version}.tar.gz#/camelot-%{version}.tar.gz
|
|
|
|
|
BuildRequires: %{python_module chardet >= 3.0.4}
|
|
|
|
|
BuildRequires: %{python_module click >= 6.7}
|
|
|
|
|
BuildRequires: %{python_module ghostscript >= 0.7}
|
|
|
|
|
BuildRequires: %{python_module numpy >= 1.13.3}
|
|
|
|
|
BuildRequires: %{python_module opencv >= 3.4.2.17}
|
|
|
|
|
BuildRequires: %{python_module openpyxl >= 2.5.8}
|
|
|
|
|
BuildRequires: %{python_module pandas >= 0.23.4}
|
|
|
|
|
BuildRequires: %{python_module pdfminer.six >= 20200726}
|
2025-06-17 09:25:18 +00:00
|
|
|
BuildRequires: %{python_module pip}
|
2024-09-17 12:32:11 +00:00
|
|
|
BuildRequires: %{python_module pypdf >= 3.0.0}
|
2025-06-17 09:25:18 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2024-09-17 12:32:11 +00:00
|
|
|
BuildRequires: %{python_module tabulate >= 0.8.9}
|
2025-06-17 09:25:18 +00:00
|
|
|
BuildRequires: alts
|
2024-09-17 12:32:11 +00:00
|
|
|
BuildRequires: fdupes
|
2025-06-17 09:25:18 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
|
Requires: alts
|
2024-09-17 12:32:11 +00:00
|
|
|
Requires: python-chardet >= 3.0.4
|
|
|
|
|
Requires: python-click >= 6.7
|
|
|
|
|
Requires: python-numpy >= 1.13.3
|
|
|
|
|
Requires: python-openpyxl >= 2.5.8
|
|
|
|
|
Requires: python-pandas >= 0.23.4
|
|
|
|
|
Requires: python-pdfminer.six >= 20200726
|
|
|
|
|
Requires: python-pypdf >= 3.0.0
|
|
|
|
|
Requires: python-tabulate >= 0.8.9
|
2025-06-17 09:25:18 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
|
# SECTION test requirements
|
|
|
|
|
BuildRequires: %{python_module pytest >= 5.4.3}
|
|
|
|
|
BuildRequires: %{python_module pytest-cov >= 2.10.0}
|
|
|
|
|
BuildRequires: %{python_module pytest-mpl >= 0.11}
|
|
|
|
|
BuildRequires: %{python_module typing_extensions}
|
|
|
|
|
# /SECTION
|
2024-09-17 12:32:11 +00:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
Camelot is a Python library that can help you extract tables from PDFs!
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n camelot-%{version}
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%pyproject_wheel
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%pyproject_install
|
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/camelot
|
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
2025-06-17 09:25:18 +00:00
|
|
|
%pre
|
|
|
|
|
%python_libalternatives_reset_alternative camelot
|
2024-09-17 12:32:11 +00:00
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
# Disable tests that require network connection
|
|
|
|
|
donttest="test_url_poppler or test_url_ghostscript or test_pages_poppler or test_pages_ghostscript"
|
|
|
|
|
# Disable tests that require pdftopng package
|
|
|
|
|
donttest+=" or test_repr_poppler or test_lattice_contour_plot_poppler or test_line_plot_poppler or test_joint_plot_poppler or test_grid_plot_poppler"
|
2025-06-17 09:25:18 +00:00
|
|
|
# Disable test failing due to issue https://github.com/camelot-dev/camelot/issues/480
|
2024-09-17 12:32:11 +00:00
|
|
|
donttest+=" or test_cli_output_format"
|
2025-06-17 09:25:18 +00:00
|
|
|
# Disable tests that fail due to small differences caused by ghostscript version
|
2024-09-17 12:32:11 +00:00
|
|
|
# (https://github.com/camelot-dev/camelot/pull/356#issuecomment-1474776857)
|
|
|
|
|
donttest+=" or test_lattice_contour_plot_ghostscript or test_joint_plot_ghostscript"
|
|
|
|
|
%pytest -k "not ($donttest)"
|
|
|
|
|
|
|
|
|
|
%files %{python_files}
|
|
|
|
|
%doc README.md
|
|
|
|
|
%license LICENSE
|
|
|
|
|
%python_alternative %{_bindir}/camelot
|
|
|
|
|
%{python_sitelib}/camelot
|
|
|
|
|
%{python_sitelib}/camelot_py-%{version}.dist-info
|
|
|
|
|
|
|
|
|
|
%changelog
|