Skip to content

Commit 38167b8

Browse files
committed
Automate release to PyPI, remove Python 3.8 testing
1 parent 74885be commit 38167b8

File tree

5 files changed

+44
-15
lines changed

5 files changed

+44
-15
lines changed

.github/workflows/release.yml

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

HOWTOPUBLISH

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# update contributors and CHANGELOG in README
2+
python -m pip install pre-commit
23
python -m pre_commit run -a # and then commit changes
34
tox -e py39-extra,py310-extra,py311-extra,py312-extra,py313-extra
45
# tag version release
56
python -m build -s # this will update tabulate/version.py
67
python -m pip install . # install tabulate in the current venv
78
python -m pip install -r benchmark/requirements.txt
89
python benchmark/benchmark.py # then update README
9-
# move tag to the last commit
10+
# move tag to the last commit: eg.
11+
git tag v0.10.4
1012
python -m build -s # update tabulate/version.py
1113
python -m build -nswx .
1214
git push # wait for all CI builds to succeed
1315
git push --tags # if CI builds succeed
14-
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
15-
twine upload dist/*

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
python-tabulate
22
===============
33

4+
> This is a temporary upgrade shim for https://github.com/astanin/python-tabulate
5+
6+
> Install `tabulate` via `python -m pip install tabulate-slip39`,
7+
> until the upstream https://pypi.org/project/tabulate is upgraded
8+
9+
410
Pretty-print tabular data in Python, a library and a command-line
511
utility.
612

@@ -503,10 +509,10 @@ format:
503509
>>> print(tabulate(table, headers, tablefmt="asciidoc"))
504510
[cols="8<,7>",options="header"]
505511
|====
506-
| item | qty
507-
| spam | 42
508-
| eggs | 451
509-
| bacon | 0
512+
| item | qty
513+
| spam | 42
514+
| eggs | 451
515+
| bacon | 0
510516
|====
511517

512518
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=77.0.3", "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 = "MIT"
99
license-files = ["LICENSE"]

tox.ini

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# for testing and it is disabled by default.
99

1010
[tox]
11-
envlist = lint, py{38, 39, 310, 311, 312, 313}
11+
envlist = lint, py{39, 310, 311, 312, 313}
1212
isolated_build = True
1313

1414
[gh]
@@ -33,12 +33,6 @@ commands = python -m pre_commit run -a
3333
deps =
3434
pre-commit
3535

36-
[testenv:py38]
37-
basepython = python3.8
38-
commands = pytest -v --doctest-modules --ignore benchmark {posargs}
39-
deps =
40-
pytest
41-
4236
[testenv:py38-extra]
4337
basepython = python3.8
4438
commands = pytest -v --doctest-modules --ignore benchmark {posargs}

0 commit comments

Comments
 (0)