Skip to content

Commit 9fed661

Browse files
committed
Merge branch 'master' into 3.0.0
2 parents 5054880 + 4d0684e commit 9fed661

File tree

6 files changed

+92
-15
lines changed

6 files changed

+92
-15
lines changed

plugins/ext_test/tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def clean_all(context):
157157
def sdist(context):
158158
"""Create a source distribution"""
159159
with context.cd(TASK_ROOT_STR):
160-
context.run('python setup.py sdist')
160+
context.run('python -m build --sdist')
161161

162162

163163
namespace.add_task(sdist)
@@ -167,7 +167,7 @@ def sdist(context):
167167
def wheel(context):
168168
"""Build a wheel distribution"""
169169
with context.cd(TASK_ROOT_STR):
170-
context.run('python setup.py bdist_wheel')
170+
context.run('python -m build --wheel')
171171

172172

173173
namespace.add_task(wheel)

plugins/template/tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def clean_all(context):
170170
@invoke.task(pre=[clean_all])
171171
def sdist(context):
172172
"""Create a source distribution"""
173-
context.run('python setup.py sdist')
173+
context.run('python -m build --sdist')
174174

175175

176176
namespace.add_task(sdist)
@@ -179,7 +179,7 @@ def sdist(context):
179179
@invoke.task(pre=[clean_all])
180180
def wheel(context):
181181
"""Build a wheel distribution"""
182-
context.run('python setup.py bdist_wheel')
182+
context.run('python -m build --wheel')
183183

184184

185185
namespace.add_task(wheel)

pyproject.toml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,87 @@
22
requires = ["build", "setuptools>=64", "setuptools-scm>=8"]
33
build-backend = "setuptools.build_meta"
44

5+
[project]
6+
name = "cmd2"
7+
dynamic = ["version"]
8+
description = "cmd2 - quickly build feature-rich and user-friendly interactive command line applications in Python"
9+
authors = [{ name = "cmd2 Contributors" }]
10+
readme = "README.md"
11+
requires-python = ">=3.8"
12+
keywords = [
13+
"CLI",
14+
"cmd",
15+
"command",
16+
"interactive",
17+
"prompt",
18+
"Python",
19+
]
20+
license = { file = "LICENSE" }
21+
classifiers = [
22+
"Development Status :: 5 - Production/Stable",
23+
"Environment :: Console",
24+
"Operating System :: OS Independent",
25+
"Intended Audience :: Developers",
26+
"Intended Audience :: System Administrators",
27+
"License :: OSI Approved :: MIT License",
28+
"Programming Language :: Python :: 3 :: Only",
29+
"Programming Language :: Python :: 3.8",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.11",
33+
"Programming Language :: Python :: 3.12",
34+
"Programming Language :: Python :: 3.13",
35+
"Topic :: Software Development :: Libraries :: Python Modules",
36+
]
37+
dependencies = [
38+
"gnureadline; platform_system == 'Darwin'",
39+
"pyperclip",
40+
"pyreadline3; platform_system == 'Windows'",
41+
"rich-argparse",
42+
"wcwidth",
43+
]
44+
45+
[project.optional-dependencies]
46+
build = [
47+
"build",
48+
"setuptools",
49+
"setuptools-scm",
50+
]
51+
dev = [
52+
"codecov",
53+
"doc8",
54+
"invoke",
55+
"mypy",
56+
"nox",
57+
"pytest",
58+
"pytest-cov",
59+
"pytest-mock",
60+
"sphinx",
61+
"sphinx-rtd-theme",
62+
"sphinx-autobuild",
63+
"ruff",
64+
"twine",
65+
]
66+
docs = [
67+
"setuptools",
68+
"setuptools_scm",
69+
"sphinx",
70+
"sphinx-rtd-theme",
71+
"sphinx-autobuild",
72+
]
73+
test = [
74+
"codecov",
75+
"coverage",
76+
"pytest",
77+
"pytest-cov",
78+
"pytest-mock",
79+
]
80+
validate = [
81+
"mypy",
82+
"ruff",
83+
"types-setuptools",
84+
]
85+
586
[tool.doc8]
687
ignore-path = [
788
"__pycache__",
@@ -223,3 +304,5 @@ docstring-code-format = false
223304
# This only has an effect when the `docstring-code-format` setting is
224305
# enabled.
225306
docstring-code-line-length = "dynamic"
307+
308+
[tool.setuptools_scm]

tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def validatetag(context):
309309
def sdist(context):
310310
"""Create a source distribution"""
311311
with context.cd(TASK_ROOT_STR):
312-
context.run('python setup.py sdist')
312+
context.run('python -m build --sdist')
313313

314314

315315
namespace.add_task(sdist)
@@ -319,7 +319,7 @@ def sdist(context):
319319
def wheel(context):
320320
"""Build a wheel distribution"""
321321
with context.cd(TASK_ROOT_STR):
322-
context.run('python setup.py bdist_wheel')
322+
context.run('python -m build --wheel')
323323

324324

325325
namespace.add_task(wheel)

tests/test_completion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,14 +463,14 @@ def test_path_completion_no_text(cmd2_app):
463463

464464
def test_path_completion_no_path(cmd2_app):
465465
# Run path complete with search text that isn't preceded by a path. This should use CWD as the path.
466-
text = 's'
466+
text = 'p'
467467
line = 'shell ls {}'.format(text)
468468
endidx = len(line)
469469
begidx = endidx - len(text)
470470
completions_no_text = cmd2_app.path_complete(text, line, begidx, endidx)
471471

472472
# Run path complete with path set to the CWD
473-
text = os.getcwd() + os.path.sep + 's'
473+
text = os.getcwd() + os.path.sep + text
474474
line = 'shell ls {}'.format(text)
475475
endidx = len(line)
476476
begidx = endidx - len(text)

tests/test_utils.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,9 @@ def pr_none():
289289
def test_proc_reader_send_sigint(pr_none):
290290
assert pr_none._proc.poll() is None
291291
pr_none.send_sigint()
292-
293-
wait_start = time.monotonic()
294292
pr_none.wait()
295-
wait_finish = time.monotonic()
296-
297-
# Make sure the process exited before sleep of 5 seconds finished
298-
# 3 seconds accounts for some delay but is long enough for the process to exit
299-
assert wait_finish - wait_start < 3
300293

294+
# Mac sure a SIGINT killed the process
301295
ret_code = pr_none._proc.poll()
302296
if sys.platform.startswith('win'):
303297
assert ret_code is not None

0 commit comments

Comments
 (0)