Skip to content

Commit f974945

Browse files
authored
Merge branch 'astanin:master' into master
2 parents 3b2b695 + 23e4fcd commit f974945

File tree

16 files changed

+293
-189
lines changed

16 files changed

+293
-189
lines changed

.circleci/config.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.circleci/requirements.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

.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/tabulate.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: python-tabulate
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.9', '3.10', '3.11', '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 pytest numpy pandas
24+
- name: Run tests
25+
run: |
26+
pytest -v --doctest-modules --ignore benchmark.py

HOWTOPUBLISH

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# update contributors and CHANGELOG in README
22
# tag version release
33
python3 benchmark.py # then update README
4-
tox -e py37-extra,py38-extra,py39-extra,py310-extra
4+
tox -e py38-extra,py39-extra,py310-extra,py311-extra,py312-extra
55
python3 -m build -nswx .
66
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
77
twine upload dist/*

README.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pip install tabulate
5353
Build status
5454
------------
5555

56-
[![Build status](https://circleci.com/gh/astanin/python-tabulate.svg?style=svg)](https://circleci.com/gh/astanin/python-tabulate/tree/master) [![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
-------------
@@ -81,7 +81,7 @@ The following tabular data types are supported:
8181
- list of lists or another iterable of iterables
8282
- list or another iterable of dicts (keys as columns)
8383
- dict of iterables (keys as columns)
84-
- list of dataclasses (Python 3.7+ only, field names as columns)
84+
- list of dataclasses (field names as columns)
8585
- two-dimensional NumPy array
8686
- NumPy record arrays (names as columns)
8787
- pandas.DataFrame
@@ -121,10 +121,22 @@ dictionaries or named tuples:
121121
```pycon
122122
>>> print(tabulate({"Name": ["Alice", "Bob"],
123123
... "Age": [24, 19]}, headers="keys"))
124-
Age Name
125-
----- ------
126-
24 Alice
127-
19 Bob
124+
Name Age
125+
------ -----
126+
Alice 24
127+
Bob 19
128+
```
129+
130+
When data is a list of dictionaries, a dictionary can be passed as `headers`
131+
to replace the keys with other column labels:
132+
133+
```pycon
134+
>>> print(tabulate([{1: "Alice", 2: 24}, {1: "Bob", 2: 19}],
135+
... headers={1: "Name", 2: "Age"}))
136+
Name Age
137+
------ -----
138+
Alice 24
139+
Bob 19
128140
```
129141

130142
### Row Indices
@@ -1074,33 +1086,33 @@ To run tests on all supported Python versions, make sure all Python
10741086
interpreters, `pytest` and `tox` are installed, then run `tox` in the root
10751087
of the project source tree.
10761088

1077-
On Linux `tox` expects to find executables like `python3.7`, `python3.8` etc.
1078-
On Windows it looks for `C:\Python37\python.exe`, `C:\Python38\python.exe` etc. respectively.
1089+
On Linux `tox` expects to find executables like `python3.11`, `python3.12` etc.
1090+
On Windows it looks for `C:\Python311\python.exe`, `C:\Python312\python.exe` etc. respectively.
10791091

10801092
One way to install all the required versions of the Python interpreter is to use [pyenv](https://github.com/pyenv/pyenv).
10811093
All versions can then be easily installed with something like:
10821094

1083-
pyenv install 3.7.12
1084-
pyenv install 3.8.12
1095+
pyenv install 3.11.7
1096+
pyenv install 3.12.1
10851097
...
10861098

10871099
Don't forget to change your `PATH` so that `tox` knows how to find all the installed versions. Something like
10881100

10891101
export PATH="${PATH}:${HOME}/.pyenv/shims"
10901102

10911103
To test only some Python environments, use `-e` option. For example, to
1092-
test only against Python 3.7 and Python 3.10, run:
1104+
test only against Python 3.11 and Python 3.12, run:
10931105

10941106
```shell
1095-
tox -e py37,py310
1107+
tox -e py311,py312
10961108
```
10971109

10981110
in the root of the project source tree.
10991111

11001112
To enable NumPy and Pandas tests, run:
11011113

11021114
```shell
1103-
tox -e py37-extra,py310-extra
1115+
tox -e py311-extra,py312-extra
11041116
```
11051117

11061118
(this may take a long time the first time, because NumPy and Pandas will

appveyor.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ environment:
88
# The list here is complete (excluding Python 2.6, which
99
# isn't covered by this document) at the time of writing.
1010

11-
- PYTHON: "C:\\Python37"
12-
- PYTHON: "C:\\Python38"
13-
- PYTHON: "C:\\Python39"
14-
- PYTHON: "C:\\Python37-x64"
15-
- PYTHON: "C:\\Python38-x64"
11+
#- PYTHON: "C:\\Python39"
12+
#- PYTHON: "C:\\Python310"
13+
#- PYTHON: "C:\\Python311"
14+
#- PYTHON: "C:\\Python312"
1615
- PYTHON: "C:\\Python39-x64"
1716
- PYTHON: "C:\\Python310-x64"
1817
- PYTHON: "C:\\Python311-x64"
18+
- PYTHON: "C:\\Python312-x64"
1919

2020
install:
2121
# Newer setuptools is needed for proper support of pyproject.toml
@@ -29,9 +29,6 @@ build: off
2929

3030
test_script:
3131
# Put your test command here.
32-
# If you don't need to build C extensions on 64-bit Python 3.3 or 3.4,
33-
# you can remove "build.cmd" from the front of the command, as it's
34-
# only needed to support those cases.
3532
# Note that you must use the environment variable %PYTHON% to refer to
3633
# the interpreter you're using - Appveyor does not do anything special
3734
# to put the Python version you want to use on PATH.
@@ -40,9 +37,7 @@ test_script:
4037

4138
after_test:
4239
# This step builds your wheels.
43-
# Again, you only need build.cmd if you're building C extensions for
44-
# 64-bit Python 3.3/3.4. And you need to use %PYTHON% to get the correct
45-
# interpreter
40+
# Again, you need to use %PYTHON% to get the correct interpreter
4641
#- "build.cmd %PYTHON%\\python.exe setup.py bdist_wheel"
4742
- "%PYTHON%\\python.exe -m build -nswx ."
4843

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ classifiers = [
1313
"License :: OSI Approved :: MIT License",
1414
"Operating System :: OS Independent",
1515
"Programming Language :: Python :: 3",
16-
"Programming Language :: Python :: 3.7",
17-
"Programming Language :: Python :: 3.8",
1816
"Programming Language :: Python :: 3.9",
1917
"Programming Language :: Python :: 3.10",
2018
"Programming Language :: Python :: 3.11",
19+
"Programming Language :: Python :: 3.12",
2120
"Topic :: Software Development :: Libraries",
2221
]
23-
requires-python = ">=3.7"
22+
requires-python = ">=3.9"
2423
dynamic = ["version"]
2524

2625
[project.urls]

0 commit comments

Comments
 (0)