15
0
forked from pool/python-tablib

- Update to 3.9.0

* Add dataset title adjustment for xls format (#627)
  * Support column_width in xlsx format for databook exports (#624)
  * Add sql export format (#619)
  * Add support for Python 3.14 (#607)
  * Improve comprehensions (#620)
  * Fix bug in ODS import where headers are not set on Dataset (#614)
  * Fix bug in ODS import regarding cells with empty strings (#613)
  * Remove outdated Python support from docs (#611)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tablib?expand=0&rev=32
This commit is contained in:
2025-10-29 18:20:35 +00:00
committed by Git OBS Bridge
commit 1ac098b165
7 changed files with 400 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

239
python-tablib.changes Normal file
View File

@@ -0,0 +1,239 @@
-------------------------------------------------------------------
Wed Oct 29 14:05:15 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Update to 3.9.0
* Add dataset title adjustment for xls format (#627)
* Support column_width in xlsx format for databook exports (#624)
* Add sql export format (#619)
* Add support for Python 3.14 (#607)
* Improve comprehensions (#620)
* Fix bug in ODS import where headers are not set on Dataset (#614)
* Fix bug in ODS import regarding cells with empty strings (#613)
* Remove outdated Python support from docs (#611)
-------------------------------------------------------------------
Fri Feb 14 12:32:37 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Update to 3.8.0
* Add support for exporting XLSX with column width (#516)
* Remove redundant check from `Dataset.load()` (#604)
-------------------------------------------------------------------
Mon Jan 20 20:14:38 UTC 2025 - Ben Greiner <code@bnavigator.de>
- Fix dependencies: None of the supported packages are hard
requirements.
- Remove xlwt from build set: Not maintained for 7+ years
* Add tablib-tests-noxls.patch
-------------------------------------------------------------------
Sat Jan 18 11:31:03 UTC 2025 - ecsos <ecsos@opensuse.org>
- Add %{?sle15_python_module_pythons}
-------------------------------------------------------------------
Wed Nov 13 01:55:10 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 3.7.0:
* Add support for Python 3.13
* Drop support for Python 3.8
* feat: xls: add styling for date/time types
* feat: ods: add style to datetime, date and time values
* Avoid normalizing input twice in import_set/book
* Exclude bots from generated release notes
* Fix ods datetime and time export and import
* Add optional requirement specifier "html" back
* Replace MarkupPy by ElementTree for html conversion
* Support import_set for html input
* Clean up some IDE warnings
* feat: transpose support dataset with no headers
* Fix crash when loading databook from XLS
* fix(ods): None values are not displayed as string
* Avoid skipping entire tests when pandas is not installed
* Allow appending rows after a dynamic column was inserted
* Removed OrderedDict usage
* Do not mutate data in place when applying formatters
* Allow inserting columns for dataset with headers and no values
* Add support for Python 3.12
* Drop support for EOL Python 3.7
* Allow importing 'ragged' .xlsx files through dataset
* Release: replace deprecated repository_url with repository-url
* Tests: Generalized calling open() on path objects directly
* Fix linting issues raised by flake8
* Add tags to html output
* Escape formulae on export
* Move more setup stuff to pyproject.toml
-------------------------------------------------------------------
Tue Dec 13 17:21:30 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
- Update to version 3.3.0
* Add support for Python 3.11 (#525).
* ODS export: integers/floats/decimals are exported as numbers (#527).
-------------------------------------------------------------------
Tue Oct 11 07:35:41 UTC 2022 - John Vandenberg <jayvdb@gmail.com>
- Update to v3.2.1
* Support solo CR in text input imports
- from v3.2.0
* Dropped Python 3.6 support
* Corrected order of arguments to a regex call in safe_xlsx_sheet_title
- from v3.1.0
* Add support for Python 3.10
* The csv, xls, and xlsx formats gained support for the skip_lines
keyword argument for their import_set() method to be able to skip
the nth first lines of a read file
* Avoided mutable parameter defaults
* Specify build backend for editable installs
* Doubled sample size passed to csv.Sniffer() in _csv.detect()
-------------------------------------------------------------------
Fri Apr 23 21:58:39 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Skip python36 build: no pandas
- Update URL
-------------------------------------------------------------------
Tue Jan 12 11:24:13 UTC 2021 - John Vandenberg <jayvdb@gmail.com>
- Update to v3.0.0
* Dropped Python 3.5 support
* JSON-exported data is no longer forced to ASCII characters
* YAML-exported data is no longer forced to ASCII characters
* Added Python 3.9 support
* Added read_only option to xlsx file reader
* Prevented crash in rst export with only-space strings
-------------------------------------------------------------------
Fri Jul 24 14:13:26 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- Update to 2.0.0
* The `Row.lpush/rpush` logic was reversed. `lpush` was appending while `rpush`
and `append` were prepending. This was fixed (reversed behavior). If you
counted on the broken behavior, please update your code (#453).
* Fixed minimal openpyxl dependency version to 2.6.0 (#457).
* Dates from xls files are now read as Python datetime objects (#373).
* Allow import of "ragged" xlsx files (#465).
* When importing an xlsx file, Tablib will now read cell values instead of formulas (#462).
-------------------------------------------------------------------
Mon Apr 20 09:06:13 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Remove py2 dependencies as the package is py3 only
-------------------------------------------------------------------
Tue Feb 25 05:52:59 UTC 2020 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 1.1.0:
* Tablib is now able to import CSV content where not all rows have the same length. Missing columns on any line receive the empty string (#226).
* Dropped Python 2 support
* Formats can now be dynamically registered through the tablib.formats.registry.refister API (#256).
* Tablib methods expecting data input (detect_format, import_set, Dataset.load, Databook.load) now accepts file-like objects in addition to raw strings and bytestrings (#440).
* Fixed a crash when exporting an empty string with the ReST format (#368)
* Error cells from imported .xls files contain now the error string (#202)
- Add BuildRequires on python-tabulate.
-------------------------------------------------------------------
Mon Dec 2 16:03:37 UTC 2019 - Todd R <toddrme2178@gmail.com>
- Drop python2 support due to dependencies dropping python2 support
- Update to 0.14.0
+ Deprecations
* The 0.14.x series will be the last to support Python 2
+ Breaking changes
* Dropped Python 3.4 support
+ Improvements
* Added Python 3.7 and 3.8 support
* The project is now maintained by the Jazzband team, https://jazzband.co
* Improved format autodetection and added autodetection for the odf format.
* Added search to all documentation pages
* Open xlsx workbooks in read-only mode
* Unpin requirements
* Only install backports.csv on Python 2
+ Bugfixes
* Fixed `DataBook().load` parameter ordering (first stream, then format).
* Fixed a regression for xlsx exports where non-string values were forced to
strings
* Fixed xlsx format detection (which was often detected as `xls` format)
-------------------------------------------------------------------
Sat Apr 6 15:07:34 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Remove egg-info requires.txt entry for backports.csv as it isnt
a dependency on Python 3.
- Remove build and runtime dependency on unicodecsv, which was
replaced with backports.csv in the last release.
-------------------------------------------------------------------
Tue Mar 26 10:26:24 UTC 2019 - pgajdos@suse.com
- version update to 0.13.0
* no upstream changelog (HISTORY.rst outdated), see git log
- deleted patches
- openpyxl-usage-fix.patch (upstreamed)
-------------------------------------------------------------------
Thu Mar 7 06:40:43 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Add openpyxl-usage-fix.patch to workaround incompatibility with
current releases of openpyxl
- Add HISTORY.rst to %doc
- Add minimum versions of dependencies from upstream
- Use %license
- Update to v0.12.1
- Add Pandas DataFrame support
-------------------------------------------------------------------
Thu Aug 24 05:12:52 UTC 2017 - tbechtold@suse.com
- update to 0.11.5:
- Use ``yaml.safe_load`` for importing yaml.
- Use built-in `json` package if available
- Support Python 3.5+ in classifiers
- Fixed textual representation for Dataset with no headers
- Handle decimal types
- Release fix.
- Fix export only formats.
- Fix for xlsx output.
- Fixed packaging error on Python 3.
- Added LaTeX table export format (``Dataset.latex``).
- Support for dBase (DBF) files (``Dataset.dbf``).
- New import/export interface (``Dataset.export()``, ``Dataset.load()``).
- CSV custom delimiter support (``Dataset.export('csv', delimiter='$')``).
- Adding ability to remove duplicates to all rows in a dataset (``Dataset.remove_duplicates()``).
- Added a mechanism to avoid ``datetime.datetime`` issues when serializing data.
- New ``detect_format()`` function (mostly for internal use).
- Update the vendored unicodecsv to fix ``None`` handling.
- Only freeze the headers row, not the headers columns (xls).
- ``detect()`` function removed.
- Fix XLSX import.
- Bugfix for ``Dataset.transpose().transpose()``.
- convert to singlespec
-------------------------------------------------------------------
Fri Jul 24 21:47:30 UTC 2015 - seife+obs@b1-systems.com
- fix RHEL build by ignoring bytecompile-errors
-------------------------------------------------------------------
Thu May 14 09:25:23 UTC 2015 - benoit.monin@gmx.fr
- update to version 0.10.0:
* Unicode Column Headers
* ALL the bugfixes!
- add fdupes as BuildRequires and call it after install
- remove shebang in every python files
- remove useless CFLAGS declaration
- run the tests during build with test_tablib.py
-------------------------------------------------------------------
Thu Oct 24 11:15:40 UTC 2013 - speilicke@suse.com
- Require python-setuptools instead of distribute (upstreams merged)
-------------------------------------------------------------------
Fri Jul 27 10:36:10 UTC 2012 - saschpe@suse.de
- Initial version

93
python-tablib.spec Normal file
View File

@@ -0,0 +1,93 @@
#
# spec file for package python-tablib
#
# Copyright (c) 2025 SUSE LLC
#
# 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/
#
%if 0%{?rhel}
# I get syntax errors in the brp-python-bytecompile step...
%define _python_bytecompile_errors_terminate_build 0
%endif
%{?sle15_python_module_pythons}
Name: python-tablib
Version: 3.9.0
Release: 0
Summary: Format agnostic tabular data library (XLS, JSON, YAML, CSV)
License: MIT
URL: https://github.com/jazzband/tablib
Source: https://files.pythonhosted.org/packages/source/t/tablib/tablib-%{version}.tar.gz
# PATCH-FEATURE-OPENSUSE tablib-tests-noxls.patch -- disable tests that require xlwt, code@bnavigator.de
Patch0: tablib-tests-noxls.patch
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module base >= 3.9}
BuildRequires: %{python_module odfpy}
BuildRequires: %{python_module openpyxl >= 2.6.0}
BuildRequires: %{python_module pandas}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module tabulate}
BuildRequires: %{python_module wheel}
BuildRequires: %{python_module xlrd}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Suggests: python-PyYAML
Suggests: python-odfpy
Suggests: python-openpyxl >= 2.6.0
Suggests: python-tabulate
Suggests: python-xlrd
Suggests: python-xlwt
Suggests: python-pandas
BuildArch: noarch
%python_subpackages
%description
Tablib is a format-agnostic tabular dataset library, written in Python.
Output formats supported:
- Excel (Sets + Books)
- JSON (Sets + Books)
- YAML (Sets + Books)
- HTML (Sets)
- TSV (Sets)
- CSV (Sets)
%prep
%autosetup -p1 -n tablib-%{version}
# Remove shebang lines from non-executable scripts:
find src -name "*.py" | xargs sed -i '1 { /^#!/ d }'
sed -i '/addopts/ d' pytest.ini
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# v3.2.1: test_cli_export_github fails on Leap 15.3 & .4 due to minor differences in output
donttest="test_cli_export_github"
%pytest -k "not ($donttest)"
%files %{python_files}
%license LICENSE
%doc AUTHORS README.md HISTORY.md
%{python_sitelib}/tablib
%{python_sitelib}/tablib-%{version}.dist-info
%changelog

3
tablib-3.8.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:94d8bcdc65a715a0024a6d5b701a5f31e45bd159269e62c73731de79f048db2b
size 122247

3
tablib-3.9.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1b6abd8edb0f35601e04c6161d79660fdcde4abb4a54f66cc9f9054bd55d5fe2
size 125565

38
tablib-tests-noxls.patch Normal file
View File

@@ -0,0 +1,38 @@
diff -ur tablib-3.7.0/tests/test_tablib.py tablib-3.7.0.patched/tests/test_tablib.py
--- tablib-3.7.0/tests/test_tablib.py 2024-10-08 15:11:38.000000000 +0200
+++ tablib-3.7.0.patched/tests/test_tablib.py 2025-01-20 21:38:50.331022734 +0100
@@ -16,6 +16,7 @@
import xlrd
from odf import opendocument, table
from openpyxl.reader.excel import load_workbook
+import pytest
import tablib
from tablib.core import Row, detect_format
@@ -53,7 +54,7 @@
def _test_export_data_in_all_formats(self, dataset, exclude=()):
all_formats = [
- 'json', 'yaml', 'csv', 'tsv', 'xls', 'xlsx', 'ods', 'html', 'jira',
+ 'json', 'yaml', 'csv', 'tsv', 'xlsx', 'ods', 'html', 'jira',
'latex', 'df', 'rst',
]
for format_ in all_formats:
@@ -400,9 +401,6 @@
"""Test auto format detection."""
# html, jira, latex, rst are export only.
- _xls = self.founders.export('xls')
- self.assertEqual(tablib.detect_format(_xls), 'xls')
-
_xlsx = self.founders.export('xlsx')
self.assertEqual(tablib.detect_format(_xlsx), 'xlsx')
@@ -1280,6 +1278,7 @@
self.assertEqual(cells[2].getAttribute('datevalue'), '2019-10-04T12:30:08')
+@pytest.mark.skip("No XLS support without xlwt")
class XLSTests(BaseTestCase):
def test_xls_format_detect(self):
"""Test the XLS format detection."""