Skip to content

Upgrade to main branch#16

Open
RaSan147 wants to merge 136 commits intoRaSan147:masterfrom
astanin:master
Open

Upgrade to main branch#16
RaSan147 wants to merge 136 commits intoRaSan147:masterfrom
astanin:master

Conversation

@RaSan147
Copy link
Copy Markdown
Owner

@RaSan147 RaSan147 commented Apr 4, 2026

No description provided.

baolsen and others added 30 commits May 23, 2023 21:55
This code:
```
import numpy as np
from tabulate import tabulate

data = [[np.ones(1)]]

print(tabulate(data))
```

Throws a `FutureWarning` or a `ValueError` due to the comparison with `SEPARATING_LINE`. 


Fixes #287
calling _type is incorrect here; the subsequent lines need a `str`.
Also you can't reconstruct `None` with `type(None)(None)` anyway.
This regressed in e8e3091

Fixes #305
Fix separating line detection with ndarray values
fix(docs): Correct typo in ANSI support section
Fix handling "True"/"False" bool str and None
Configure break long words and on hyphen for maxcolwidths
Declare licenses using only these two fields, as per PEP 639:
* license:       SPDX license expression consisting of one or more license identifiers
* license-files: list of license file glob patterns

Supported by setuptools ≥ 77.0, or perhaps setuptools ≥ 77.0.3 which irons out some bugs:
https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license-and-license-files
- If the object implements a custom `__getattr__`, or if its `__call__`
  is itself not callable, you may get misleading results.
- Instead use the built-in `callable` function. Not only is it more
  robust, but it makes the intent clear and the code more readable.
When a column contains both bool-like strings ('True'/'False') and
numeric strings, the column type is detected as float. Formatting then
crashes with ValueError on float('False').

Catch ValueError and TypeError in the float branch of _format and fall
back to string formatting.

Fixes #209
Fix column wrapping breaking with None values (fixes #312)
DimitriPapadopoulos and others added 30 commits March 5, 2026 15:01
Unnecessary list comprehension
Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
… optional escape_map

generalize LaTeX escaping function, move escaping to _build_simple_row
The build backend should be `flit_core`, not `flit`:
https://flit.pypa.io/en/stable/pyproject_toml.html#build-system-section

File `_version.py` should be part of sdist and wheel distributions.
It's `_version.py`, not `version.py` any more.
Either support Python 3.8 and 3.9 officially and keep testing these
versions, or stop testing. This grey area where you don't support
versions but still test them just in case doesn't help. For example,
ruff targets `requires-python` and generates code that may not be
compatible with earlier versions. Such code will break CI tests
with unsupported versions of Python.
The resulting code is faster, simpler and more readable.
Either support Python 3.8 and 3.9 officially and keep testing these
versions, or stop testing. This grey area where you don't support
versions but still test them just in case doesn't help. For example,
ruff targets `requires-python` and generates code that may not be
compatible with earlier versions. Such code will break CI tests
with unsupported versions of Python.
GH102: Auto-cancel on repeated PRs

GH103: At least one workflow with manual dispatch trigger
fix #173

New CLI parameter:

--headers HEADERS
  where HEADERS can be "firstrow", "keys", "HEADER1,HEADER2,...", "KEY1:HEADER1,KEY2:HEADER2,..."

--read FILEFORMAT
  where FILEFORMAT can be "rsv" (default), "csv", "jsonl"

Deprecated CLI parameter:

--header

Usage examples:

cat ./examples/people.csv | tabulate -r csv --headers firstrow
  id  name    email              "favorite" fruit
----  ------  -----------------  ------------------
   1  Alice   alice@example.com  apple, kiwi
   2  Bob     bob@example.com    banana,
                                 orange,
                                 lychee
   3  Carol                      pear

cat ./examples/people.jsonl | tabulate -r jsonl -f grid --headers 'id:ID,name:First Name,email:Email'
+------+--------------+-------------------+
|   ID | First Name   | Email             |
+======+==============+===================+
|    1 | Alice        | alice@example.com |
+------+--------------+-------------------+
|    2 | Bob          | bob@example.com   |
+------+--------------+-------------------+
- old tests: launch tabulate via subprocess (still necessary)
- new tests: the same checks for coverage reports
Use `X | Y` for type annotations
Unnecessary `int` call (rewrite as a literal)
Use format specifiers instead of percent format
Import from `collections.abc` instead
Add support of JSONL and CSV input file formats in CLI tabulate utility
Enforce ruff/flake8-bugbear rules (B)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.