Skip to content

Commit f52beb2

Browse files
authored
Fix Python 3.14 support (#807)
* Fix Python 3.14 support * Fix test
1 parent 928d152 commit f52beb2

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
os: ubuntu-24.04-arm
1717
- pyver: "3.12"
1818
os: ubuntu-24.04-arm
19-
# - pyver: "3.14"
20-
# os: ubuntu-24.04
19+
- pyver: "3.14"
20+
os: ubuntu-24.04
2121
runs-on: ${{ matrix.os }}
2222
steps:
2323
- uses: actions/checkout@v6

test/test_wordcloud_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def test_cli_regexp_invalid(tmp_text_file, capsys):
185185
@pytest.mark.no_cover
186186
@pytest.mark.parametrize("command,expected_output, expected_exit_code", [
187187
("wordcloud_cli --help", "usage: wordcloud_cli", 0),
188-
("%s -m wordcloud --help" % sys.executable, "usage: __main__", 0),
188+
("%s -m wordcloud --help" % sys.executable, "A simple command line", 0),
189189
("%s %s/../wordcloud/wordcloud_cli.py --help" % (sys.executable, os.path.dirname(__file__)), "To execute the CLI", 1),
190190
])
191191
def test_cli_as_executable(command, expected_output, expected_exit_code, tmpdir, capfd):

wordcloud/wordcloud_cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44
from __future__ import absolute_import
55

6+
import pathlib
67
import sys
78
import textwrap
89

@@ -116,10 +117,10 @@ def make_parser():
116117
'--fontfile', metavar='path', dest='font_path',
117118
help='path to font file you wish to use (default: DroidSansMono)')
118119
parser.add_argument(
119-
'--mask', metavar='file', type=argparse.FileType('rb'),
120+
'--mask', metavar='file', type=pathlib.Path,
120121
help='mask to use for the image form')
121122
parser.add_argument(
122-
'--colormask', metavar='file', type=argparse.FileType('rb'),
123+
'--colormask', metavar='file', type=pathlib.Path,
123124
help='color mask to use for image coloring')
124125
parser.add_argument(
125126
'--contour_width', metavar='width', default=0, type=float,

0 commit comments

Comments
 (0)