Skip to content

Commit 23e4fcd

Browse files
committed
Merge branch 'dev-ci-github-actions'
2 parents b76f58f + 97b67f3 commit 23e4fcd

File tree

9 files changed

+51
-16
lines changed

9 files changed

+51
-16
lines changed

.github/workflows/lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: lint
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: ['3.12']
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
python -m pip install tox tox-gh
24+
- name: Run linters
25+
run: |
26+
tox -e lint

.github/workflows/github-actions-tox.yml renamed to .github/workflows/tabulate.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ jobs:
1212
python-version: ['3.9', '3.10', '3.11', '3.12']
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
- name: Set up Python ${{ matrix.python-version }}
1717
uses: actions/setup-python@v4
1818
with:
1919
python-version: ${{ matrix.python-version }}
2020
- name: Install dependencies
2121
run: |
2222
python -m pip install --upgrade pip
23-
python -m pip install tox tox-gh-actions
24-
- name: Test with tox
25-
run: tox
23+
python -m pip install pytest numpy pandas
24+
- name: Run tests
25+
run: |
26+
pytest -v --doctest-modules --ignore benchmark.py

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pip install tabulate
5353
Build status
5454
------------
5555

56-
[![python-tabulate](https://github.com/astanin/python-tabulate/actions/workflows/github-actions-tox.yml/badge.svg)](https://github.com/astanin/python-tabulate/actions/workflows/github-actions-tox.yml) [![Build status](https://ci.appveyor.com/api/projects/status/8745yksvvol7h3d7/branch/master?svg=true)](https://ci.appveyor.com/project/astanin/python-tabulate/branch/master)
56+
[![python-tabulate](https://github.com/astanin/python-tabulate/actions/workflows/tabulate.yml/badge.svg)](https://github.com/astanin/python-tabulate/actions/workflows/tabulate.yml) [![Build status](https://ci.appveyor.com/api/projects/status/8745yksvvol7h3d7/branch/master?svg=true)](https://ci.appveyor.com/project/astanin/python-tabulate/branch/master)
5757

5858
Library usage
5959
-------------

tabulate/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def _is_file(f):
104104

105105

106106
def _is_separating_line_value(value):
107-
return type(value) == str and value.strip() == SEPARATING_LINE
107+
return type(value) is str and value.strip() == SEPARATING_LINE
108108

109109

110110
def _is_separating_line(row):
@@ -2770,7 +2770,7 @@ def _main():
27702770
print(usage)
27712771
sys.exit(0)
27722772
files = [sys.stdin] if not args else args
2773-
with (sys.stdout if outfile == "-" else open(outfile, "w")) as out:
2773+
with sys.stdout if outfile == "-" else open(outfile, "w") as out:
27742774
for f in files:
27752775
if f == "-":
27762776
f = sys.stdin

test/test_cli.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
"""
44

5-
65
import os
76
import sys
87

test/test_internal.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,12 @@ def test_wrap_text_wide_chars():
182182

183183
rows = [["청자청자청자청자청자", "약간 감싸면 더 잘 보일 수있는 다소 긴 설명입니다"]]
184184
widths = [5, 20]
185-
expected = [["청자\n청자\n청자\n청자\n청자", "약간 감싸면 더 잘\n보일 수있는 다소 긴\n설명입니다"]]
185+
expected = [
186+
[
187+
"청자\n청자\n청자\n청자\n청자",
188+
"약간 감싸면 더 잘\n보일 수있는 다소 긴\n설명입니다",
189+
]
190+
]
186191
result = T._wrap_text_to_colwidths(rows, widths)
187192

188193
assert_equal(expected, result)

test/test_output.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ def test_plain_maxcolwidth_autowraps_wide_chars():
137137

138138
table = [
139139
["hdr", "fold"],
140-
["1", "약간 감싸면 더 잘 보일 수있는 다소 긴 설명입니다 설명입니다 설명입니다 설명입니다 설명"],
140+
[
141+
"1",
142+
"약간 감싸면 더 잘 보일 수있는 다소 긴 설명입니다 설명입니다 설명입니다 설명입니다 설명",
143+
],
141144
]
142145
expected = "\n".join(
143146
[

test/test_textwrapper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ def test_wrap_color_in_single_line():
142142

143143
def test_wrap_color_line_splillover():
144144
"""TextWrapper: Wrap a line - preserve internal color tags and wrap them to
145-
other lines when required, requires adding the colors tags to other lines as appropriate"""
145+
other lines when required, requires adding the colors tags to other lines as appropriate
146+
"""
146147
# This has both a text color and a background color
147148
data = "This is a \033[31mtest string for testing TextWrap\033[0m with colors"
148149

tox.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
envlist = lint, py{38, 39, 310, 311, 312}
1212
isolated_build = True
1313

14-
[gh-actions]
14+
[gh]
1515
python =
16-
3.9: py39
17-
3.10: py310
18-
3.11: py311
19-
3.12: py312
16+
3.9: py39-extra
17+
3.10: py310-extra
18+
3.11: py311-extra
19+
3.12: py312-extra
2020

2121
[testenv]
2222
commands = pytest -v --doctest-modules --ignore benchmark.py {posargs}

0 commit comments

Comments
 (0)