Skip to content

Commit 2dea62e

Browse files
authored
Add support for uv venvs (#1367)
1 parent 8117d3b commit 2dea62e

File tree

3 files changed

+31
-8
lines changed

3 files changed

+31
-8
lines changed

docs/conf.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@
2323
from os.path import abspath, dirname
2424

2525
# Make sure we get the version of this copy of cmd2
26-
sys.path.insert(1, dirname(dirname(abspath(__file__))))
26+
root_path = dirname(dirname(abspath(__file__)))
27+
cmd2_ext_test_path = f'{root_path}/plugins/ext_test/'
28+
sys.path.insert(1, root_path) # cmd2
29+
sys.path.insert(2, cmd2_ext_test_path) # cmd2_ext_test
2730

2831
# Import for custom theme from Read the Docs
29-
import sphinx_rtd_theme
32+
import sphinx_rtd_theme # noqa E402
3033

3134
# -- General configuration -----------------------------------------------------
3235

@@ -179,9 +182,13 @@
179182
# Ignore nitpicky warnings from autodoc which are occurring for very new versions of Sphinx and autodoc
180183
# They seem to be happening because autodoc is now trying to add hyperlinks to docs for typehint classes
181184
nitpick_ignore = [
182-
('py:class', 'cmd2.decorators.CommandParent'),
183-
('py:obj', 'cmd2.decorators.CommandParent'),
185+
('py:class', 'ArgparseCommandFunc'),
184186
('py:class', 'argparse._SubParsersAction'),
187+
('py:class', 'cmd2.decorators.CommandParent'),
185188
('py:class', 'cmd2.utils._T'),
189+
('py:class', 'CommandParent'),
190+
('py:class', 'frame'),
191+
('py:class', 'RawCommandFuncOptionalBoolReturn'),
186192
('py:class', 'types.FrameType'),
193+
('py:obj', 'cmd2.decorators.CommandParent'),
187194
]

pyproject.toml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ dev = [
5757
"pytest-cov",
5858
"pytest-mock",
5959
"sphinx",
60-
"sphinx-rtd-theme",
6160
"sphinx-autobuild",
61+
"sphinx-rtd-theme",
6262
"ruff",
6363
"twine",
6464
]
6565
docs = [
6666
"setuptools",
6767
"setuptools_scm",
6868
"sphinx",
69-
"sphinx-rtd-theme",
7069
"sphinx-autobuild",
70+
"sphinx-rtd-theme",
7171
]
7272
test = [
7373
"codecov",
@@ -317,3 +317,19 @@ docstring-code-line-length = "dynamic"
317317
packages = ["cmd2"]
318318

319319
[tool.setuptools_scm]
320+
321+
[tool.uv]
322+
dev-dependencies = [
323+
"codecov",
324+
"doc8",
325+
"invoke",
326+
"mypy",
327+
"pytest",
328+
"pytest-cov",
329+
"pytest-mock",
330+
"sphinx",
331+
"sphinx-autobuild",
332+
"sphinx-rtd-theme",
333+
"ruff",
334+
"twine",
335+
]

tests/test_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ def test_proc_reader_send_sigint(pr_none):
290290
assert pr_none._proc.poll() is None
291291
pr_none.send_sigint()
292292
pr_none.wait()
293-
294-
# Mac sure a SIGINT killed the process
295293
ret_code = pr_none._proc.poll()
294+
295+
# Make sure a SIGINT killed the process
296296
if sys.platform.startswith('win'):
297297
assert ret_code is not None
298298
else:

0 commit comments

Comments
 (0)