Skip to content

Commit

Permalink
Merge branch 'master' into future
Browse files Browse the repository at this point in the history
  • Loading branch information
astanin authored Sep 26, 2024
2 parents 6ea2a05 + 2f3a737 commit be7596e
Show file tree
Hide file tree
Showing 12 changed files with 253 additions and 182 deletions.
60 changes: 0 additions & 60 deletions .circleci/config.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .circleci/requirements.txt

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/github-actions-tox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: python-tabulate

on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Test with tox
run: tox
2 changes: 1 addition & 1 deletion HOWTOPUBLISH
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# update contributors and CHANGELOG in README
# tag version release
python3 benchmark.py # then update README
tox -e py37-extra,py38-extra,py39-extra,py310-extra
tox -e py38-extra,py39-extra,py310-extra,py311-extra,py312-extra
python3 -m build -nswx .
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
twine upload dist/*
38 changes: 25 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pip install tabulate
Build status
------------

[![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)
[![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)

Library usage
-------------
Expand Down Expand Up @@ -81,7 +81,7 @@ The following tabular data types are supported:
- list of lists or another iterable of iterables
- list or another iterable of dicts (keys as columns)
- dict of iterables (keys as columns)
- list of dataclasses (Python 3.7+ only, field names as columns)
- list of dataclasses (field names as columns)
- two-dimensional NumPy array
- NumPy record arrays (names as columns)
- pandas.DataFrame
Expand Down Expand Up @@ -121,10 +121,22 @@ dictionaries or named tuples:
```pycon
>>> print(tabulate({"Name": ["Alice", "Bob"],
... "Age": [24, 19]}, headers="keys"))
Age Name
----- ------
24 Alice
19 Bob
Name Age
------ -----
Alice 24
Bob 19
```

When data is a list of dictionaries, a dictionary can be passed as `headers`
to replace the keys with other column labels:

```pycon
>>> print(tabulate([{1: "Alice", 2: 24}, {1: "Bob", 2: 19}],
... headers={1: "Name", 2: "Age"}))
Name Age
------ -----
Alice 24
Bob 19
```

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

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

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

pyenv install 3.7.12
pyenv install 3.8.12
pyenv install 3.11.7
pyenv install 3.12.1
...

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

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

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

```shell
tox -e py37,py310
tox -e py311,py312
```

in the root of the project source tree.

To enable NumPy and Pandas tests, run:

```shell
tox -e py37-extra,py310-extra
tox -e py311-extra,py312-extra
```

(this may take a long time the first time, because NumPy and Pandas will
Expand Down
17 changes: 6 additions & 11 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ environment:
# The list here is complete (excluding Python 2.6, which
# isn't covered by this document) at the time of writing.

- PYTHON: "C:\\Python37"
- PYTHON: "C:\\Python38"
- PYTHON: "C:\\Python39"
- PYTHON: "C:\\Python37-x64"
- PYTHON: "C:\\Python38-x64"
#- PYTHON: "C:\\Python39"
#- PYTHON: "C:\\Python310"
#- PYTHON: "C:\\Python311"
#- PYTHON: "C:\\Python312"
- PYTHON: "C:\\Python39-x64"
- PYTHON: "C:\\Python310-x64"
- PYTHON: "C:\\Python311-x64"
- PYTHON: "C:\\Python312-x64"

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

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

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

Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries",
]
requires-python = ">=3.7"
requires-python = ">=3.9"
dynamic = ["version"]

[project.urls]
Expand Down
Loading

0 comments on commit be7596e

Please sign in to comment.