Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 8 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,18 @@ jobs:
- "3.12"
- "3.13"
- "3.14"
- "pypy-3.7"
- "pypy-3.8"
- "pypy-3.9"
- "pypy-3.10"
- "pypy-3.11"
include:
- os: windows-latest
python-version: "3.7"
- os: ubuntu-22.04
python-version: "3.7"
- os: ubuntu-22.04
python-version: "pypy-3.6"
- os: ubuntu-latest
container: python:3.6
python-version: "3.6"
exclude:
- os: macos-latest
python-version: "pypy-3.7"

runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
Expand Down Expand Up @@ -109,7 +95,7 @@ jobs:
fi

- name: Upload coverage data
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: coverage-data.${{ matrix.os }}-${{ matrix.python-version }}
path: .coverage.*
Expand All @@ -122,8 +108,8 @@ jobs:
needs: tests

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version-file: .python-version-default
cache: pip
Expand All @@ -137,7 +123,7 @@ jobs:
delete-merged: true

- name: Download coverage data
uses: actions/download-artifact@v4
uses: actions/download-artifact@v6
with:
name: coverage-data

Expand All @@ -153,7 +139,7 @@ jobs:
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}

Expand All @@ -163,7 +149,7 @@ jobs:
python -Im coverage report --fail-under=100

- name: Upload HTML report if check failed.
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: html-report
path: htmlcov
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v6

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
4 changes: 2 additions & 2 deletions bin/update-tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,8 +675,8 @@ def replace_if_modified(new_filename: str, original_filename: str) -> None:
If there are other changes or the original doesn't exist, replace it.
"""
if os.path.exists(original_filename):
with open(original_filename, 'r', encoding='utf-8') as f1, \
open(new_filename, 'r', encoding='utf-8') as f2:
with open(original_filename, encoding='utf-8') as f1, \
open(new_filename, encoding='utf-8') as f2:
old_lines = f1.readlines()
new_lines = f2.readlines()

Expand Down
3 changes: 1 addition & 2 deletions bin/wcwidth-browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,7 @@ def on_resize(self, *args):
# pylint: disable=W0613
# Unused argument 'args'
assert self.term.width >= self.screen.hint_width, (
'Screen to small {}, must be at least {}'.format(
self.term.width, self.screen.hint_width))
f'Screen to small {self.term.width}, must be at least {self.screen.hint_width}')
self._set_lastpage()
self.dirty = self.STATE_REFRESH

Expand Down
6 changes: 4 additions & 2 deletions bin/wcwidth-libc-comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ def report_ucs_msg(ucs, wcwidth_libc, wcwidth_local):
.lstrip('0'))
url = f"http://codepoints.net/U+{ucp}"
name = unicodedata.name(ucs)
return ("libc,ours={},{} [--o{}o--] name={} val={} {}"
" ".format(wcwidth_libc, wcwidth_local, ucs, name, ord(ucs), url))
return (
f"libc,ours={wcwidth_libc},{wcwidth_local} "
f"[--o{ucs}o--] name={name} val={ord(ucs)} {url} ")



if sys.maxunicode < 1114111:
Expand Down
4 changes: 2 additions & 2 deletions docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Install wcwidth in editable mode::

Execute unit tests using tox_ for all supported Python versions::

tox -e py36,py37,py38,py39,py310,py311,py312,py313,py314
tox -e py38,py39,py310,py311,py312,py313,py314

Updating Unicode Version
------------------------
Expand Down Expand Up @@ -141,7 +141,7 @@ To upgrade requirements for updating unicode version, run::

To upgrade requirements for testing, run::

tox -e update_requirements37,update_requirements39
tox -e update_requirements38,update_requirements39

To upgrade requirements for building documentation, run::

Expand Down
50 changes: 50 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[build-system]
build-backend = "hatchling.build"
requires = [ "hatchling" ]

[project]
name = "wcwidth"
version = "0.2.14"
description = "Measures the displayed width of unicode strings in a terminal"
readme = "README.rst"
keywords = [
"cjk",
"combining",
"console",
"eastasian",
"emoji",
"emulator",
"terminal",
"unicode",
"wcswidth",
"wcwidth",
"xterm",
]
license = "MIT"
license-files = [ "LICENSE" ]
authors = [
{ name = "Jeff Quast", email = "contact@jeffquast.com" },
]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: POSIX",
"Programming Language :: Python :: 3 :: Only",
"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",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Internationalization",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Localization",
"Topic :: Terminals",
]

[project.urls]
Homepage = "https://github.com/jquast/wcwidth"
41 changes: 0 additions & 41 deletions requirements-tests36.txt

This file was deleted.

6 changes: 0 additions & 6 deletions requirements-tests37.in

This file was deleted.

45 changes: 0 additions & 45 deletions requirements-tests37.txt

This file was deleted.

5 changes: 5 additions & 0 deletions requirements-tests38.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# for python3.8
pytest<7
pytest-cov
coverage[toml]<6
pytest-benchmark
35 changes: 35 additions & 0 deletions requirements-tests38.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile --allow-unsafe --no-emit-index-url --output-file=requirements-tests38.txt --strip-extras requirements-tests38.in
#
attrs==25.3.0
# via pytest
coverage==5.5
# via
# -r requirements-tests38.in
# pytest-cov
iniconfig==2.1.0
# via pytest
packaging==25.0
# via pytest
pluggy==1.5.0
# via pytest
py==1.11.0
# via pytest
py-cpuinfo==9.0.0
# via pytest-benchmark
pytest==6.2.5
# via
# -r requirements-tests38.in
# pytest-benchmark
# pytest-cov
pytest-benchmark==4.0.0
# via -r requirements-tests38.in
pytest-cov==5.0.0
# via -r requirements-tests38.in
toml==0.10.2
# via
# coverage
# pytest
Loading
Loading