Skip to content

Commit 3922029

Browse files
committed
Automate release to PyPI; update 1
1 parent cab3a79 commit 3922029

File tree

4 files changed

+45
-8
lines changed

4 files changed

+45
-8
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
pypi-publish:
12+
name: Upload release to PyPI
13+
runs-on: ubuntu-latest
14+
environment:
15+
name: pypi
16+
url: https://pypi.org/p/tabulate-slip39
17+
permissions:
18+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
- name: Build
25+
run: |
26+
python -m pip install --upgrade pip
27+
python -m pip install setuptools build
28+
python -m build -s
29+
- name: Publish package distributions to PyPI
30+
if: startsWith(github.ref, 'refs/tags')
31+
uses: pypa/gh-action-pypi-publish@release/v1

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,10 @@ format:
503503
>>> print(tabulate(table, headers, tablefmt="asciidoc"))
504504
[cols="8<,7>",options="header"]
505505
|====
506-
| item | qty
507-
| spam | 42
508-
| eggs | 451
509-
| bacon | 0
506+
| item | qty
507+
| spam | 42
508+
| eggs | 451
509+
| bacon | 0
510510
|====
511511

512512
```

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.2.0", "setuptools_scm[toml]>=3.4.3"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "tabulate"
6+
name = "tabulate-slip39"
77
authors = [{name = "Sergey Astanin", email = "[email protected]"}]
88
license = {text = "MIT"}
99
description = "Pretty-print tabular data"
@@ -24,7 +24,7 @@ requires-python = ">=3.9"
2424
dynamic = ["version"]
2525

2626
[project.urls]
27-
Homepage = "https://github.com/astanin/python-tabulate"
27+
Homepage = "https://github.com/pjkundert/python-tabulate"
2828

2929
[project.optional-dependencies]
3030
widechars = ["wcwidth"]

tabulate/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,9 @@ def _normalize_tabular_data(tabular_data, headers, showindex="default"):
16231623
return rows, headers, headers_pad
16241624

16251625

1626-
def _wrap_text_to_colwidths(list_of_lists, colwidths, numparses=True, missingval=_DEFAULT_MISSINGVAL):
1626+
def _wrap_text_to_colwidths(
1627+
list_of_lists, colwidths, numparses=True, missingval=_DEFAULT_MISSINGVAL
1628+
):
16271629
if len(list_of_lists):
16281630
num_cols = len(list_of_lists[0])
16291631
else:
@@ -1646,7 +1648,11 @@ def _wrap_text_to_colwidths(list_of_lists, colwidths, numparses=True, missingval
16461648
# explicit than just `str` of the object. Also doesn't work for
16471649
# custom floatfmt/intfmt, nor with any missing/blank cells.
16481650
casted_cell = (
1649-
missingval if cell is None else str(cell) if _isnumber(cell) else _type(cell, numparse)(cell)
1651+
missingval
1652+
if cell is None
1653+
else str(cell)
1654+
if _isnumber(cell)
1655+
else _type(cell, numparse)(cell)
16501656
)
16511657
wrapped = [
16521658
"\n".join(wrapper.wrap(line))

0 commit comments

Comments
 (0)