prettytable 3.18.0__tar.gz → 3.19.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. {prettytable-3.18.0 → prettytable-3.19.0}/.github/dependabot.yml +0 -5
  2. prettytable-3.19.0/.github/workflows/actions.lock +129 -0
  3. {prettytable-3.18.0 → prettytable-3.19.0}/.github/workflows/labels.yml +3 -3
  4. prettytable-3.19.0/.github/workflows/lint.yml +48 -0
  5. {prettytable-3.18.0 → prettytable-3.19.0}/.github/workflows/release-drafter.yml +2 -2
  6. {prettytable-3.18.0 → prettytable-3.19.0}/.github/workflows/release.yml +6 -6
  7. {prettytable-3.18.0 → prettytable-3.19.0}/.github/workflows/require-pr-label.yml +2 -2
  8. {prettytable-3.18.0 → prettytable-3.19.0}/.github/workflows/test.yml +11 -19
  9. {prettytable-3.18.0 → prettytable-3.19.0}/.pre-commit-config.yaml +37 -9
  10. {prettytable-3.18.0 → prettytable-3.19.0}/PKG-INFO +3 -4
  11. prettytable-3.19.0/RELEASING.md +25 -0
  12. {prettytable-3.18.0 → prettytable-3.19.0}/pyproject.toml +15 -14
  13. {prettytable-3.18.0 → prettytable-3.19.0}/requirements-mypy.txt +1 -1
  14. {prettytable-3.18.0 → prettytable-3.19.0}/src/prettytable/_version.py +2 -2
  15. {prettytable-3.18.0 → prettytable-3.19.0}/src/prettytable/prettytable.py +27 -7
  16. {prettytable-3.18.0 → prettytable-3.19.0}/tests/test_colortable.py +0 -1
  17. {prettytable-3.18.0 → prettytable-3.19.0}/tests/test_html.py +14 -0
  18. {prettytable-3.18.0 → prettytable-3.19.0}/tests/test_prettytable.py +49 -15
  19. {prettytable-3.18.0 → prettytable-3.19.0}/tests/test_sections.py +3 -1
  20. {prettytable-3.18.0 → prettytable-3.19.0}/tests/test_style.py +12 -6
  21. {prettytable-3.18.0 → prettytable-3.19.0}/tox.ini +1 -1
  22. prettytable-3.18.0/.github/workflows/lint.yml +0 -37
  23. prettytable-3.18.0/RELEASING.md +0 -25
  24. {prettytable-3.18.0 → prettytable-3.19.0}/.github/FUNDING.yml +0 -0
  25. {prettytable-3.18.0 → prettytable-3.19.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  26. {prettytable-3.18.0 → prettytable-3.19.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  27. {prettytable-3.18.0 → prettytable-3.19.0}/.github/SECURITY.md +0 -0
  28. {prettytable-3.18.0 → prettytable-3.19.0}/.github/labels.yml +0 -0
  29. {prettytable-3.18.0 → prettytable-3.19.0}/.github/release-drafter.yml +0 -0
  30. {prettytable-3.18.0 → prettytable-3.19.0}/.gitignore +0 -0
  31. {prettytable-3.18.0 → prettytable-3.19.0}/CHANGELOG.md +0 -0
  32. {prettytable-3.18.0 → prettytable-3.19.0}/LICENSE +0 -0
  33. {prettytable-3.18.0 → prettytable-3.19.0}/README.md +0 -0
  34. {prettytable-3.18.0 → prettytable-3.19.0}/src/prettytable/__init__.py +0 -0
  35. {prettytable-3.18.0 → prettytable-3.19.0}/src/prettytable/__main__.py +0 -0
  36. {prettytable-3.18.0 → prettytable-3.19.0}/src/prettytable/colortable.py +0 -0
  37. {prettytable-3.18.0 → prettytable-3.19.0}/src/prettytable/py.typed +0 -0
  38. {prettytable-3.18.0 → prettytable-3.19.0}/tests/conftest.py +0 -0
  39. {prettytable-3.18.0 → prettytable-3.19.0}/tests/data/table_align_center.txt +0 -0
  40. {prettytable-3.18.0 → prettytable-3.19.0}/tests/data/table_align_left.txt +0 -0
  41. {prettytable-3.18.0 → prettytable-3.19.0}/tests/data/table_align_right.txt +0 -0
  42. {prettytable-3.18.0 → prettytable-3.19.0}/tests/data/table_ansi_colors.txt +0 -0
  43. {prettytable-3.18.0 → prettytable-3.19.0}/tests/data/table_cjk.txt +0 -0
  44. {prettytable-3.18.0 → prettytable-3.19.0}/tests/data/table_combining_chars.txt +0 -0
  45. {prettytable-3.18.0 → prettytable-3.19.0}/tests/data/table_complex_emoji.txt +0 -0
  46. {prettytable-3.18.0 → prettytable-3.19.0}/tests/test_json.py +0 -0
  47. {prettytable-3.18.0 → prettytable-3.19.0}/tests/test_latex.py +0 -0
  48. {prettytable-3.18.0 → prettytable-3.19.0}/tests/test_mediawiki.py +0 -0
  49. {prettytable-3.18.0 → prettytable-3.19.0}/tests/test_rst.py +0 -0
  50. {prettytable-3.18.0 → prettytable-3.19.0}/tests/test_sorting.py +0 -0
@@ -13,11 +13,6 @@ updates:
13
13
  labels:
14
14
  - "changelog: skip"
15
15
  - "dependencies"
16
- ignore:
17
- - dependency-name: "*"
18
- update-types:
19
- - "version-update:semver-minor"
20
- - "version-update:semver-patch"
21
16
  cooldown:
22
17
  default-days: 7
23
18
 
@@ -0,0 +1,129 @@
1
+ # This file is machine-generated by `gh actions-lock`.
2
+ # Do not edit by hand; run `gh actions-lock` to update.
3
+ # Docs: https://gh.io/actions-lockfile
4
+ version: 'v0.0.3'
5
+ workflows:
6
+ '.github/workflows/labels.yml':
7
+ - 'actions/checkout@v7.0.1'
8
+ - 'micnncim/action-label-syncer@v1.3.0'
9
+ '.github/workflows/lint.yml':
10
+ - 'actions/checkout@v7.0.1'
11
+ - 'actions/setup-python@v7.1.0'
12
+ - 'astral-sh/setup-uv@v10.3.2'
13
+ - 'j178/prek-action@v3.1.0'
14
+ '.github/workflows/release-drafter.yml':
15
+ - 'release-drafter/release-drafter@v7.10.0'
16
+ '.github/workflows/release.yml':
17
+ - 'actions/checkout@v7.0.1'
18
+ - 'actions/download-artifact@v8.0.2'
19
+ - 'hynek/build-and-inspect-python-package@v3.0.2'
20
+ - 'pypa/gh-action-pypi-publish@v1.14.3'
21
+ '.github/workflows/require-pr-label.yml':
22
+ - 'mheap/github-action-required-labels@v5.6.0'
23
+ '.github/workflows/test.yml':
24
+ - 'actions/checkout@v7.0.1'
25
+ - 'actions/setup-python@v7.1.0'
26
+ - 'astral-sh/setup-uv@v10.3.2'
27
+ - 'codecov/codecov-action@v6.0.0'
28
+ dependencies:
29
+ 'actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8':
30
+ ref: 'v4.2.2'
31
+ commit: 'sha1-4d101475d8b20a2381f78447822ac1eab6504dd8'
32
+ owner_id: 44036562
33
+ repo_id: 760702757
34
+ uses:
35
+ - 'actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d'
36
+ 'actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d':
37
+ ref: 'v4.2.1'
38
+ commit: 'sha1-508db95dd578ae2727ebd6217d5ba78e4fbda05d'
39
+ owner_id: 44036562
40
+ repo_id: 760701061
41
+ 'actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9':
42
+ ref: 'v6.1.0'
43
+ commit: 'sha1-55cc8345863c7cc4c66a329aec7e433d2d1c52a9'
44
+ owner_id: 44036562
45
+ repo_id: 215566462
46
+ 'actions/checkout@v7.0.1':
47
+ ref: 'v7.0.1'
48
+ commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1'
49
+ owner_id: 44036562
50
+ repo_id: 197814629
51
+ 'actions/download-artifact@v8.0.2':
52
+ ref: 'v8.0.2'
53
+ commit: 'sha1-9000827ccba6bdab643e8b6fd33ac0654aef8333'
54
+ owner_id: 44036562
55
+ repo_id: 192626254
56
+ 'actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd':
57
+ ref: 'v8.0.0'
58
+ commit: 'sha1-ed597411d8f924073f98dfc5c65a23a2325f34cd'
59
+ owner_id: 44036562
60
+ repo_id: 205262760
61
+ 'actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97':
62
+ ref: 'v7.0.0'
63
+ commit: 'sha1-5fda3b95a4ea91299a34e894583c3862153e4b97'
64
+ owner_id: 44036562
65
+ repo_id: 192625525
66
+ 'actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405':
67
+ ref: 'v6.2.0'
68
+ commit: 'sha1-a309ff8b426b58ec0e2a45f0f869d46889d02405'
69
+ owner_id: 44036562
70
+ repo_id: 192625525
71
+ 'actions/setup-python@v7.1.0':
72
+ ref: 'v7.1.0'
73
+ commit: 'sha1-6d4fd22b20465ccc0f7354476588e8df7c9ca0e0'
74
+ owner_id: 44036562
75
+ repo_id: 192625525
76
+ 'actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9':
77
+ ref: 'v7.0.2'
78
+ commit: 'sha1-cf430e030ddbb5b0abf93d22962f4752f3646cd9'
79
+ owner_id: 44036562
80
+ repo_id: 192625955
81
+ 'astral-sh/setup-uv@v10.3.2':
82
+ ref: 'v10.3.2'
83
+ commit: 'sha1-07a047e608db84b3d8c06cd9a7c7dcc9c355c18e'
84
+ owner_id: 115962839
85
+ repo_id: 846733598
86
+ 'codecov/codecov-action@v6.0.0':
87
+ ref: 'v6.0.0'
88
+ commit: 'sha1-57e3a136b779b570ffcdbf80b3bdc90e7fab3de2'
89
+ owner_id: 8226205
90
+ repo_id: 200299178
91
+ uses:
92
+ - 'actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd'
93
+ 'hynek/build-and-inspect-python-package@v3.0.2':
94
+ ref: 'v3.0.2'
95
+ commit: 'sha1-67230f7b8410ae0052b39c1efc89d89fff43ff10'
96
+ owner_id: 41240
97
+ repo_id: 526525235
98
+ uses:
99
+ - 'actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8'
100
+ - 'actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9'
101
+ - 'actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97'
102
+ - 'actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9'
103
+ 'j178/prek-action@v3.1.0':
104
+ ref: 'v3.1.0'
105
+ commit: 'sha1-44924fe9ef4a6f88253c4b6b1bf11c689d3ce53d'
106
+ owner_id: 10510431
107
+ repo_id: 1052387486
108
+ 'mheap/github-action-required-labels@v5.6.0':
109
+ ref: 'v5.6.0'
110
+ commit: 'sha1-23e10fde7e062233401931a0eece796cd9bf3177'
111
+ owner_id: 59130
112
+ repo_id: 272521528
113
+ 'micnncim/action-label-syncer@v1.3.0':
114
+ ref: 'v1.3.0'
115
+ commit: 'sha1-3abd5ab72fda571e69fffd97bd4e0033dd5f495c'
116
+ owner_id: 21333876
117
+ repo_id: 214834296
118
+ 'pypa/gh-action-pypi-publish@v1.14.3':
119
+ ref: 'v1.14.3'
120
+ commit: 'sha1-7245906fb61fa33a13554f9d5fb856fe61758086'
121
+ owner_id: 647025
122
+ repo_id: 178055147
123
+ uses:
124
+ - 'actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405'
125
+ 'release-drafter/release-drafter@v7.10.0':
126
+ ref: 'v7.10.0'
127
+ commit: 'sha1-978bb0b30c5ee8cdd332ced253758157150d43f0'
128
+ owner_id: 58292376
129
+ repo_id: 139022359
@@ -12,12 +12,12 @@ jobs:
12
12
  sync:
13
13
  permissions:
14
14
  pull-requests: write
15
- runs-on: ubuntu-latest
15
+ runs-on: ubuntu-slim
16
16
  steps:
17
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17
+ - uses: actions/checkout@v7.0.1
18
18
  with:
19
19
  persist-credentials: false
20
- - uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0
20
+ - uses: micnncim/action-label-syncer@v1.3.0
21
21
  with:
22
22
  prune: false
23
23
  env:
@@ -0,0 +1,48 @@
1
+ name: Lint
2
+
3
+ on: [push, pull_request, workflow_dispatch]
4
+
5
+ permissions: {}
6
+
7
+ env:
8
+ FORCE_COLOR: 1
9
+ RUFF_OUTPUT_FORMAT: github
10
+
11
+ jobs:
12
+ lint:
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - uses: actions/checkout@v7.0.1
17
+ with:
18
+ persist-credentials: false
19
+ - uses: j178/prek-action@v3.1.0
20
+
21
+ mypy:
22
+ runs-on: ubuntu-latest
23
+
24
+ steps:
25
+ - uses: actions/checkout@v7.0.1
26
+ with:
27
+ persist-credentials: false
28
+ - uses: actions/setup-python@v7.1.0
29
+ with:
30
+ python-version: "3.x"
31
+ - name: Install uv
32
+ uses: astral-sh/setup-uv@v10.3.2
33
+ - name: Mypy
34
+ run: uvx --with tox-uv tox -e mypy
35
+
36
+ # Fails when .github/workflows/actions.lock is out of sync with the
37
+ # workflows or a locked pin no longer verifies upstream.
38
+ lockfile:
39
+ runs-on: ubuntu-slim
40
+ env:
41
+ GH_TOKEN: ${{ github.token }}
42
+
43
+ steps:
44
+ - uses: actions/checkout@v7.0.1
45
+ with:
46
+ persist-credentials: false
47
+ - run: gh extension install github/gh-actions-lock --pin v0.4.1
48
+ - run: gh actions-lock --verify
@@ -25,7 +25,7 @@ jobs:
25
25
  runs-on: ubuntu-slim
26
26
  steps:
27
27
  # Drafts your next release notes as pull requests are merged into "main"
28
- - uses: release-drafter/release-drafter@5de93583980a40bd78603b6dfdcda5b4df377b32 # v7.2.0
28
+ - uses: release-drafter/release-drafter@v7.10.0
29
29
 
30
30
  autolabeler:
31
31
  if: |
@@ -36,4 +36,4 @@ jobs:
36
36
  pull-requests: write
37
37
  runs-on: ubuntu-slim
38
38
  steps:
39
- - uses: release-drafter/release-drafter/autolabeler@5de93583980a40bd78603b6dfdcda5b4df377b32 # v7.2.0
39
+ - uses: release-drafter/release-drafter/autolabeler@v7.10.0
@@ -20,12 +20,12 @@ jobs:
20
20
  runs-on: ubuntu-latest
21
21
 
22
22
  steps:
23
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23
+ - uses: actions/checkout@v7.0.1
24
24
  with:
25
25
  fetch-depth: 0
26
26
  persist-credentials: false
27
27
 
28
- - uses: hynek/build-and-inspect-python-package@fe0a0fb1925ca263d076ca4f2c13e93a6e92a33e # v2.17.0
28
+ - uses: hynek/build-and-inspect-python-package@v3.0.2
29
29
 
30
30
  # Publish to Test PyPI on every commit on main.
31
31
  release-test-pypi:
@@ -42,13 +42,13 @@ jobs:
42
42
 
43
43
  steps:
44
44
  - name: Download packages built by build-and-inspect-python-package
45
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
45
+ uses: actions/download-artifact@v8.0.2
46
46
  with:
47
47
  name: Packages
48
48
  path: dist
49
49
 
50
50
  - name: Publish to Test PyPI
51
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
51
+ uses: pypa/gh-action-pypi-publish@v1.14.3
52
52
  with:
53
53
  repository-url: https://test.pypi.org/legacy/
54
54
 
@@ -67,10 +67,10 @@ jobs:
67
67
 
68
68
  steps:
69
69
  - name: Download packages built by build-and-inspect-python-package
70
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
70
+ uses: actions/download-artifact@v8.0.2
71
71
  with:
72
72
  name: Packages
73
73
  path: dist
74
74
 
75
75
  - name: Publish to PyPI
76
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
76
+ uses: pypa/gh-action-pypi-publish@v1.14.3
@@ -6,14 +6,14 @@ on:
6
6
 
7
7
  jobs:
8
8
  label:
9
- runs-on: ubuntu-latest
9
+ runs-on: ubuntu-slim
10
10
 
11
11
  permissions:
12
12
  issues: write
13
13
  pull-requests: write
14
14
 
15
15
  steps:
16
- - uses: mheap/github-action-required-labels@0ac283b4e65c1fb28ce6079dea5546ceca98ccbe # v5.5.2
16
+ - uses: mheap/github-action-required-labels@v5.6.0
17
17
  with:
18
18
  mode: minimum
19
19
  count: 1
@@ -15,7 +15,10 @@ jobs:
15
15
  fail-fast: false
16
16
  matrix:
17
17
  python-version:
18
+ - "pypy3.12"
18
19
  - "pypy3.11"
20
+ - "3.16t"
21
+ - "3.16"
19
22
  - "3.15t"
20
23
  - "3.15"
21
24
  - "3.14t"
@@ -23,55 +26,44 @@ jobs:
23
26
  - "3.13"
24
27
  - "3.12"
25
28
  - "3.11"
26
- - "3.10"
27
29
  os: [windows-latest, macos-latest, ubuntu-latest]
28
- include:
29
- - python-version: "3.16"
30
- os: ubuntu-latest
31
- - python-version: "3.16t"
32
- os: ubuntu-latest
33
30
 
34
31
  steps:
35
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
32
+ - uses: actions/checkout@v7.0.1
36
33
  with:
37
34
  persist-credentials: false
38
35
 
39
36
  - name: Set up Python ${{ matrix.python-version }}
40
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
41
- if: "!startsWith(matrix.python-version, '3.16')"
37
+ uses: actions/setup-python@v7.1.0
42
38
  with:
43
39
  python-version: ${{ matrix.python-version }}
44
40
  allow-prereleases: true
45
41
 
46
- - name: Set up Python ${{ matrix.python-version }} (deadsnakes)
47
- uses: deadsnakes/action@e640ac8743173a67cca4d7d77cd837e514bf98e8 # v3.2.0
48
- if: startsWith(matrix.python-version, '3.16')
49
- with:
50
- python-version: "3.16-dev"
51
- nogil: ${{ endsWith(matrix.python-version, 't') }}
52
-
53
42
  - name: Set PYTHON_GIL
54
43
  if: endsWith(matrix.python-version, 't')
55
44
  run: |
56
45
  echo "PYTHON_GIL=0" >> "$GITHUB_ENV"
57
46
 
58
47
  - name: Install uv
59
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
48
+ uses: astral-sh/setup-uv@v10.3.2
60
49
 
61
50
  - name: Tox tests
62
51
  run: |
63
52
  uvx --python ${{ matrix.python-version }} --with tox-uv tox -e py
64
53
 
65
54
  - name: Upload coverage
66
- uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
55
+ uses: codecov/codecov-action@v6.0.0
67
56
  with:
68
57
  flags: ${{ matrix.os }}
69
58
  name: ${{ matrix.os }} Python ${{ matrix.python-version }}
70
59
 
71
60
  success:
61
+ if: always()
72
62
  needs: test
73
63
  runs-on: ubuntu-latest
74
64
  name: Test successful
75
65
  steps:
76
66
  - name: Success
77
- run: echo Test successful
67
+ env:
68
+ TEST_RESULT: ${{ needs.test.result }}
69
+ run: test "$TEST_RESULT" = "success"
@@ -1,73 +1,101 @@
1
+ priorities:
2
+ fix: 0
3
+ fix-py: 10
4
+ fix-eol: 20
5
+ fix-whitespace: 30
6
+ check: 40
7
+
1
8
  repos:
2
9
  - repo: https://github.com/astral-sh/ruff-pre-commit
3
- rev: v0.15.9
10
+ rev: v0.17.5
4
11
  hooks:
5
12
  - id: ruff-check
6
13
  args: [--exit-non-zero-on-fix]
14
+ priority: fix
7
15
 
8
16
  - repo: https://github.com/psf/black-pre-commit-mirror
9
- rev: 26.3.1
17
+ rev: 26.10.1
10
18
  hooks:
11
19
  - id: black
20
+ priority: fix-py
12
21
 
13
22
  - repo: https://github.com/pre-commit/pre-commit-hooks
14
23
  rev: v6.0.0
15
24
  hooks:
16
25
  - id: check-added-large-files
26
+ priority: check
17
27
  - id: check-case-conflict
28
+ priority: check
18
29
  - id: check-merge-conflict
30
+ priority: check
19
31
  - id: check-toml
32
+ priority: check
20
33
  - id: check-yaml
34
+ priority: check
21
35
  - id: debug-statements
36
+ priority: check
22
37
  - id: end-of-file-fixer
38
+ priority: fix-eol
23
39
  - id: forbid-submodules
40
+ priority: check
24
41
  - id: requirements-txt-fixer
42
+ priority: fix
25
43
  - id: trailing-whitespace
26
44
  exclude: .github/ISSUE_TEMPLATE/bug_report.md|tests/test_style.py|tests/test_prettytable.py
45
+ priority: fix-whitespace
27
46
 
28
47
  - repo: https://github.com/python-jsonschema/check-jsonschema
29
- rev: 0.37.1
48
+ rev: 0.39.0
30
49
  hooks:
31
50
  - id: check-dependabot
51
+ priority: check
32
52
  - id: check-github-workflows
53
+ priority: check
33
54
 
34
55
  - repo: https://github.com/rhysd/actionlint
35
56
  rev: v1.7.12
36
57
  hooks:
37
58
  - id: actionlint
59
+ priority: check
38
60
 
39
61
  - repo: https://github.com/zizmorcore/zizmor-pre-commit
40
- rev: v1.23.1
62
+ rev: v1.32.0
41
63
  hooks:
42
64
  - id: zizmor
65
+ priority: check
43
66
 
44
67
  - repo: https://github.com/tox-dev/pyproject-fmt
45
- rev: v2.21.0
68
+ rev: v2.30.6
46
69
  hooks:
47
70
  - id: pyproject-fmt
71
+ priority: fix
48
72
 
49
73
  - repo: https://github.com/abravalheri/validate-pyproject
50
- rev: v0.25
74
+ rev: "v0.27"
51
75
  hooks:
52
76
  - id: validate-pyproject
53
- additional_dependencies: ["trove-classifiers>=2026.6.1.19"]
77
+ priority: check
54
78
 
55
79
  - repo: https://github.com/tox-dev/tox-ini-fmt
56
- rev: 1.7.1
80
+ rev: 1.10.2
57
81
  hooks:
58
82
  - id: tox-ini-fmt
83
+ priority: fix
59
84
 
60
85
  - repo: https://github.com/rbubley/mirrors-prettier
61
- rev: v3.8.1
86
+ rev: v3.10.1
62
87
  hooks:
63
88
  - id: prettier
64
89
  args: [--prose-wrap=always, --print-width=88]
65
90
  exclude: ^.github/ISSUE_TEMPLATE/bug_report.md$
91
+ priority: fix
66
92
 
67
93
  - repo: meta
68
94
  hooks:
69
95
  - id: check-hooks-apply
96
+ priority: check
70
97
  - id: check-useless-excludes
98
+ priority: check
71
99
 
72
100
  ci:
73
101
  autoupdate_schedule: quarterly
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: prettytable
3
- Version: 3.18.0
3
+ Version: 3.19.0
4
4
  Summary: A simple Python library for easily displaying tabular data in a visually appealing ASCII table format
5
5
  Project-URL: Changelog, https://github.com/prettytable/prettytable/releases
6
6
  Project-URL: Funding, https://tidelift.com/subscription/pkg/pypi-prettytable?utm_source=pypi-prettytable&utm_medium=pypi
@@ -12,7 +12,6 @@ License-Expression: BSD-3-Clause
12
12
  License-File: LICENSE
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3 :: Only
15
- Classifier: Programming Language :: Python :: 3.10
16
15
  Classifier: Programming Language :: Python :: 3.11
17
16
  Classifier: Programming Language :: Python :: 3.12
18
17
  Classifier: Programming Language :: Python :: 3.13
@@ -23,7 +22,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
23
22
  Classifier: Programming Language :: Python :: Implementation :: PyPy
24
23
  Classifier: Topic :: Text Processing
25
24
  Classifier: Typing :: Typed
26
- Requires-Python: >=3.10
25
+ Requires-Python: >=3.11
27
26
  Requires-Dist: wcwidth>=0.3.5
28
27
  Provides-Extra: tests
29
28
  Requires-Dist: pytest-cov; extra == 'tests'
@@ -0,0 +1,25 @@
1
+ # Release checklist
2
+
3
+ - [ ] Get `main` to the appropriate code release state.
4
+ [GitHub Actions](https://github.com/prettytable/prettytable/actions) should be
5
+ running cleanly for all merges to `main`.
6
+ [![GitHub Actions status](https://github.com/prettytable/prettytable/workflows/Test/badge.svg)](https://github.com/prettytable/prettytable/actions)
7
+
8
+ - [ ] Edit release draft, adjust text if needed:
9
+ https://github.com/prettytable/prettytable/releases
10
+
11
+ - [ ] Check next tag is correct, amend if needed
12
+
13
+ - [ ] Publish release
14
+
15
+ - [ ] Check the tagged
16
+ [GitHub Actions build](https://github.com/prettytable/prettytable/actions/workflows/release.yml)
17
+ has deployed to [PyPI](https://pypi.org/project/prettytable/#history)
18
+
19
+ - [ ] Check installation:
20
+
21
+ ```bash
22
+ pip uninstall -y prettytable
23
+ pip install -U prettytable
24
+ python3 -c "import prettytable; print(prettytable.__version__)"
25
+ ```
@@ -13,11 +13,10 @@ license = "BSD-3-Clause"
13
13
  license-files = [ "LICENSE" ]
14
14
  maintainers = [ { name = "Hugo van Kemenade" } ]
15
15
  authors = [ { name = "Luke Maurits", email = "luke@maurits.id.au" } ]
16
- requires-python = ">=3.10"
16
+ requires-python = ">=3.11"
17
17
  classifiers = [
18
18
  "Programming Language :: Python",
19
19
  "Programming Language :: Python :: 3 :: Only",
20
- "Programming Language :: Python :: 3.10",
21
20
  "Programming Language :: Python :: 3.11",
22
21
  "Programming Language :: Python :: 3.12",
23
22
  "Programming Language :: Python :: 3.13",
@@ -57,21 +56,20 @@ lint.extend-select = [
57
56
  "ICN", # flake8-import-conventions
58
57
  "ISC", # flake8-implicit-str-concat
59
58
  "LOG", # flake8-logging
60
- "PERF", # Perflint
59
+ "PERF", # perflint
61
60
  "PGH", # pygrep-hooks
62
- "PIE", # flake8-pie
63
61
  "PYI", # flake8-pyi
64
- "RUF022", # unsorted-dunder-all
65
- "RUF100", # unused noqa (yesqa)
62
+ "TID251", # flake8-tidy-imports: banned-api
66
63
  "UP", # pyupgrade
67
64
  "W", # pycodestyle warnings
68
- "YTT", # flake8-2020
69
65
  ]
70
66
  lint.ignore = [
71
67
  "PIE790", # flake8-pie: unnecessary-placeholder
72
68
  ]
73
69
  lint.flake8-import-conventions.aliases.datetime = "dt"
74
70
  lint.flake8-import-conventions.banned-from = [ "datetime" ]
71
+ lint.flake8-tidy-imports.banned-api."re.match".msg = "use re.fullmatch() or re.search() instead"
72
+ lint.flake8-tidy-imports.banned-api."typing.TYPE_CHECKING".msg = "use TYPE_CHECKING = False instead"
75
73
  lint.isort.known-first-party = [ "prettytable" ]
76
74
  lint.isort.required-imports = [ "from __future__ import annotations" ]
77
75
 
@@ -79,23 +77,26 @@ lint.isort.required-imports = [ "from __future__ import annotations" ]
79
77
  max_supported_python = "3.16"
80
78
 
81
79
  [tool.mypy]
82
- python_version = "3.10"
83
- pretty = true
84
- disallow_any_generics = true
85
- enable_error_code = "ignore-without-code"
86
- extra_checks = true
87
80
  follow_imports = "silent"
81
+ python_version = "3.11"
82
+ disallow_any_generics = true
88
83
  warn_redundant_casts = true
89
84
  warn_unused_ignores = true
85
+ enable_error_code = "ignore-without-code"
86
+ extra_checks = true
87
+ pretty = true
88
+ num_workers = 4
90
89
 
91
90
  [tool.pytest]
92
- minversion = "9.0"
93
- testpaths = [ "tests" ]
94
91
  filterwarnings = [
95
92
  "error",
96
93
  ]
94
+ minversion = "9.0"
95
+ testpaths = [ "tests" ]
97
96
 
98
97
  [tool.coverage]
99
98
  run.omit = [
100
99
  "**/__main__.py",
101
100
  ]
101
+ run.disable_warnings = [ "no-sysmon" ] # 3.11
102
+ run.core = "sysmon" # default for 3.14+, available for 3.12+
@@ -1,2 +1,2 @@
1
- mypy==2.1.0
1
+ mypy==2.4.0
2
2
  types-colorama
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '3.18.0'
22
- __version_tuple__ = version_tuple = (3, 18, 0)
21
+ __version__ = version = '3.19.0'
22
+ __version_tuple__ = version_tuple = (3, 19, 0)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -38,10 +38,9 @@ from typing import Any, Literal, cast
38
38
  TYPE_CHECKING = False
39
39
  if TYPE_CHECKING:
40
40
  from collections.abc import Callable, Mapping, Sequence
41
- from typing import Final, TypeAlias, TypedDict
41
+ from typing import Final, Self, TypeAlias, TypedDict
42
42
 
43
43
  from _typeshed import SupportsRichComparison
44
- from typing_extensions import Self
45
44
 
46
45
  class OptionsType(TypedDict):
47
46
  title: str | None
@@ -179,6 +178,25 @@ class ObservableDict(dict[str, Any]):
179
178
  self.callback(key, old_value, value)
180
179
  super().__setitem__(key, value)
181
180
 
181
+ def __deepcopy__(self, memo: dict[int, Any]) -> Self:
182
+ """Return a deep copy without triggering the callback.
183
+
184
+ The default deepcopy sets the callback before restoring the items, so
185
+ each item would trigger the callback on a table that is only partly
186
+ copied.
187
+
188
+ Arguments:
189
+ memo: The memo dictionary passed by copy.deepcopy
190
+ """
191
+ import copy
192
+
193
+ new = type(self)()
194
+ memo[id(self)] = new
195
+ for key, value in self.items():
196
+ dict.__setitem__(new, copy.deepcopy(key, memo), copy.deepcopy(value, memo))
197
+ new.callback = copy.deepcopy(self.callback, memo)
198
+ return new
199
+
182
200
 
183
201
  @lru_cache
184
202
  def _get_size(text: str) -> tuple[int, int]:
@@ -2956,9 +2974,12 @@ class PrettyTable:
2956
2974
  wanted_fields = self._field_names
2957
2975
 
2958
2976
  wanted_alignments = [self._align[field] for field in wanted_fields]
2959
- if options["border"] and options["vrules"] == VRuleStyle.ALL:
2960
- alignment_str = "|".join(wanted_alignments)
2961
- elif not options["border"] and options["preserve_internal_border"]:
2977
+ if (
2978
+ options["border"]
2979
+ and options["vrules"] == VRuleStyle.ALL
2980
+ or not options["border"]
2981
+ and options["preserve_internal_border"]
2982
+ ):
2962
2983
  alignment_str = "|".join(wanted_alignments)
2963
2984
  else:
2964
2985
  alignment_str = "".join(wanted_alignments)
@@ -3200,8 +3221,7 @@ def _make_table_handler():
3200
3221
  for row in self.rows:
3201
3222
  if len(row[0]) < self.max_row_width:
3202
3223
  appends = self.max_row_width - len(row[0])
3203
- for i in range(1, appends):
3204
- row[0].append("-")
3224
+ row[0].extend(["-"] * appends)
3205
3225
 
3206
3226
  if row[1]:
3207
3227
  self.make_fields_unique(row[0])
@@ -96,7 +96,6 @@ class TestColorTableRendering:
96
96
  (False, True), # the default
97
97
  (True, True), # titled
98
98
  (True, False), # titled, no header
99
- (True, True), # both title and header
100
99
  ],
101
100
  )
102
101
  def test_color_table_rendering(self, with_title: bool, with_header: bool) -> None:
@@ -22,6 +22,20 @@ class TestHtmlConstructor:
22
22
  with pytest.raises(ValueError):
23
23
  from_html_one(html_string)
24
24
 
25
+ def test_html_ragged_row(self) -> None:
26
+ """from_html() must not raise when a row has fewer cells than the header."""
27
+ # Arrange
28
+ html = "<table><tr><th>a</th><th>b</th></tr><tr><td>1</td></tr></table>"
29
+
30
+ # Act
31
+ tables = from_html(html)
32
+
33
+ # Assert
34
+ assert len(tables) == 1
35
+ table = tables[0]
36
+ assert table.field_names == ["a", "b"]
37
+ assert table.rows == [["1", "-"]]
38
+
25
39
 
26
40
  class TestHtmlOutput:
27
41
  def test_html_output(self, helper_table: PrettyTable) -> None:
@@ -1,10 +1,11 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import datetime as dt
4
+ import importlib
4
5
  import sqlite3
5
6
  from collections.abc import Generator
6
7
  from math import e, pi, sqrt
7
- from typing import Any
8
+ from typing import Any, ClassVar
8
9
 
9
10
  import pytest
10
11
  from pytest_lazy_fixtures import lf
@@ -1560,9 +1561,11 @@ class TestRepr:
1560
1561
 
1561
1562
 
1562
1563
  class TestBreakOnHyphens:
1563
- row = [
1564
- "bluedevil breeze breeze-gtk eos-bash-shared glib2 "
1565
- "kactivitymanagerd kde-cli-tools kde-gtk-config kdecoration"
1564
+ row: ClassVar[list[str]] = [
1565
+ (
1566
+ "bluedevil breeze breeze-gtk eos-bash-shared glib2 "
1567
+ "kactivitymanagerd kde-cli-tools kde-gtk-config kdecoration"
1568
+ )
1566
1569
  ]
1567
1570
  EXPECTED_TRUE = """+------------------------------------------+
1568
1571
  | Field 1 |
@@ -1720,9 +1723,11 @@ class TestWidth:
1720
1723
  0,
1721
1724
  0,
1722
1725
  0,
1723
- "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam "
1724
- "nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam "
1725
- "erat, sed diam voluptua",
1726
+ (
1727
+ "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam "
1728
+ "nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam "
1729
+ "erat, sed diam voluptua"
1730
+ ),
1726
1731
  ]
1727
1732
  )
1728
1733
 
@@ -1915,9 +1920,11 @@ class TestWidth:
1915
1920
  0,
1916
1921
  0,
1917
1922
  0,
1918
- "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam "
1919
- "nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam "
1920
- "erat, sed diam voluptua",
1923
+ (
1924
+ "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam "
1925
+ "nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam "
1926
+ "erat, sed diam voluptua"
1927
+ ),
1921
1928
  ]
1922
1929
  )
1923
1930
 
@@ -1944,9 +1951,11 @@ class TestWidth:
1944
1951
  0,
1945
1952
  0,
1946
1953
  0,
1947
- "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam "
1948
- "nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam "
1949
- "erat, sed diam voluptua",
1954
+ (
1955
+ "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam "
1956
+ "nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam "
1957
+ "erat, sed diam voluptua"
1958
+ ),
1950
1959
  ]
1951
1960
  )
1952
1961
 
@@ -2007,6 +2016,31 @@ class TestGeneralOutput:
2007
2016
  t_copy = helper_table.copy()
2008
2017
  assert helper_table.get_string() == t_copy.get_string()
2009
2018
 
2019
+ @pytest.mark.parametrize(
2020
+ "attribute, value",
2021
+ [
2022
+ ("custom_format", {"Field 2": lambda field, value: f"[{value}]"}),
2023
+ ("float_format", {"Field 2": ".2"}),
2024
+ ("int_format", {"Field 2": "03"}),
2025
+ ("none_format", {"Field 2": "-"}),
2026
+ ],
2027
+ )
2028
+ def test_copy_with_format_option(
2029
+ self, helper_table: PrettyTable, attribute: str, value: dict[str, Any]
2030
+ ) -> None:
2031
+ setattr(helper_table, attribute, value)
2032
+ t_copy = helper_table.copy()
2033
+ assert getattr(t_copy, attribute) == value
2034
+ assert helper_table.get_string() == t_copy.get_string()
2035
+
2036
+ # The copy's callbacks update the copy, not the original
2037
+ t_copy.custom_format["Field 2"] = lambda field, value: "changed"
2038
+ assert "changed" in t_copy.get_string()
2039
+ assert "changed" not in helper_table.get_string()
2040
+ assert getattr(helper_table, attribute) == value
2041
+ for name in ("float_format", "int_format", "none_format"):
2042
+ assert "Field 2" not in getattr(t_copy, name)
2043
+
2010
2044
  def test_text(self, helper_table: PrettyTable) -> None:
2011
2045
  assert helper_table.get_formatted_string("text") == helper_table.get_string()
2012
2046
  # test with default arg, too
@@ -2080,7 +2114,7 @@ class TestDeprecations:
2080
2114
  )
2081
2115
  def test_hrule_constant_deprecations(self, module_name: str, name: str) -> None:
2082
2116
  with pytest.deprecated_call(match=f"the '{name}' constant is deprecated"):
2083
- exec(f"from {module_name} import {name}")
2117
+ getattr(importlib.import_module(module_name), name)
2084
2118
 
2085
2119
  @pytest.mark.parametrize(
2086
2120
  "module_name",
@@ -2106,7 +2140,7 @@ class TestDeprecations:
2106
2140
  self, module_name: str, name: str
2107
2141
  ) -> None:
2108
2142
  with pytest.deprecated_call(match=f"the '{name}' constant is deprecated"):
2109
- exec(f"from {module_name} import {name}")
2143
+ getattr(importlib.import_module(module_name), name)
2110
2144
 
2111
2145
  def test_options_type_deprecation(self) -> None:
2112
2146
  with pytest.deprecated_call(match="OptionsType"):
@@ -1,5 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
+ from typing import ClassVar
4
+
3
5
  from prettytable import PrettyTable, TableStyle
4
6
 
5
7
 
@@ -15,7 +17,7 @@ class TestRowEndSection:
15
17
  └──────────┴──────────┴──────────┘
16
18
  """.strip()
17
19
 
18
- TEST_ROWS = [
20
+ TEST_ROWS: ClassVar[list[list[str]]] = [
19
21
  ["value 4", "value 5", "value 6"],
20
22
  ["value 7", "value 8", "value 9"],
21
23
  ["value 10", "value 11", "value 12"],
@@ -493,16 +493,20 @@ def emoji_pretty_table() -> PrettyTable:
493
493
  '\033[38;5;226m _`/""\033[38;5;250m.-. \033[0m',
494
494
  "\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
495
495
  "\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
496
- "\033[38;5;228;5m ⚡\033[38;5;111;25mʻ ʻ\033[38;5;228;5m"
497
- "⚡\033[38;5;111;25mʻ ʻ \033[0m",
496
+ (
497
+ "\033[38;5;228;5m ⚡\033[38;5;111;25mʻ ʻ\033[38;5;228;5m"
498
+ "⚡\033[38;5;111;25mʻ ʻ \033[0m"
499
+ ),
498
500
  "\033[38;5;111m ʻ ʻ ʻ ʻ \033[0m",
499
501
  ]
500
502
  thunder2 = [
501
503
  "\033[38;5;240;1m .-. \033[0m",
502
504
  "\033[38;5;240;1m ( ). \033[0m",
503
505
  "\033[38;5;240;1m (___(__) \033[0m",
504
- "\033[38;5;21;1m ‚ʻ\033[38;5;228;5m⚡\033[38;5;21;25mʻ‚\033[38;5;228;5m"
505
- "⚡\033[38;5;21;25m‚ʻ \033[0m",
506
+ (
507
+ "\033[38;5;21;1m ‚ʻ\033[38;5;228;5m⚡\033[38;5;21;25mʻ‚\033[38;5;228;5m"
508
+ "⚡\033[38;5;21;25m‚ʻ \033[0m"
509
+ ),
506
510
  "\033[38;5;21;1m ‚ʻ‚ʻ\033[38;5;228;5m⚡\033[38;5;21;25mʻ‚ʻ \033[0m",
507
511
  ]
508
512
  table = PrettyTable(["Thunderbolt", "Lightning"])
@@ -711,8 +715,10 @@ def test_ansi_wrap_width():
711
715
  table.add_row(
712
716
  [
713
717
  "NEW_ENVIRON",
714
- "\x1b[38;5;208mOversharing: HOME, PWD, SHELL,"
715
- " SSH_AUTH_SOCK, XDG_SESSION_PATH\x1b[0m",
718
+ (
719
+ "\x1b[38;5;208mOversharing: HOME, PWD, SHELL,"
720
+ " SSH_AUTH_SOCK, XDG_SESSION_PATH\x1b[0m"
721
+ ),
716
722
  ]
717
723
  )
718
724
  result = table.get_string()
@@ -5,7 +5,7 @@ env_list =
5
5
  lint
6
6
  mypy
7
7
  py{py3}
8
- py{310-316}
8
+ py{311-316}
9
9
  py{314-316}t
10
10
 
11
11
  [testenv]
@@ -1,37 +0,0 @@
1
- name: Lint
2
-
3
- on: [push, pull_request, workflow_dispatch]
4
-
5
- permissions: {}
6
-
7
- env:
8
- FORCE_COLOR: 1
9
- RUFF_OUTPUT_FORMAT: github
10
-
11
- jobs:
12
- lint:
13
- runs-on: ubuntu-latest
14
-
15
- steps:
16
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17
- with:
18
- persist-credentials: false
19
- - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
20
- with:
21
- python-version: "3.x"
22
- - uses: j178/prek-action@cbc2f23eb5539cf20d82d1aabd0d0ecbcc56f4e3 # v2.0.2
23
-
24
- mypy:
25
- runs-on: ubuntu-latest
26
-
27
- steps:
28
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29
- with:
30
- persist-credentials: false
31
- - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
32
- with:
33
- python-version: "3.x"
34
- - name: Install uv
35
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
36
- - name: Mypy
37
- run: uvx --with tox-uv tox -e mypy
@@ -1,25 +0,0 @@
1
- # Release checklist
2
-
3
- - [ ] Get `main` to the appropriate code release state.
4
- [GitHub Actions](https://github.com/hugovk/tinytext/actions) should be running
5
- cleanly for all merges to `main`.
6
- [![GitHub Actions status](https://github.com/hugovk/tinytext/workflows/Test/badge.svg)](https://github.com/hugovk/tinytext/actions)
7
-
8
- - [ ] Edit release draft, adjust text if needed:
9
- https://github.com/hugovk/tinytext/releases
10
-
11
- - [ ] Check next tag is correct, amend if needed
12
-
13
- - [ ] Publish release
14
-
15
- - [ ] Check the tagged
16
- [GitHub Actions build](https://github.com/hugovk/tinytext/actions/workflows/deploy.yml)
17
- has deployed to [PyPI](https://pypi.org/project/tinytext/#history)
18
-
19
- - [ ] Check installation:
20
-
21
- ```bash
22
- pip uninstall -y prettytable
23
- pip install -U prettytable
24
- python3 -c "import prettytable; print(prettytable.__version__)"
25
- ```
File without changes
File without changes
File without changes
File without changes