Skip to content

Commit

Permalink
Add support for uv venvs
Browse files Browse the repository at this point in the history
  • Loading branch information
tleonhardt committed Nov 3, 2024
1 parent 8117d3b commit e492099
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
15 changes: 11 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@
from os.path import abspath, dirname

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

# Import for custom theme from Read the Docs
import sphinx_rtd_theme
import sphinx_rtd_theme # noqa E402

# -- General configuration -----------------------------------------------------

Expand Down Expand Up @@ -179,9 +182,13 @@
# Ignore nitpicky warnings from autodoc which are occurring for very new versions of Sphinx and autodoc
# They seem to be happening because autodoc is now trying to add hyperlinks to docs for typehint classes
nitpick_ignore = [
('py:class', 'cmd2.decorators.CommandParent'),
('py:obj', 'cmd2.decorators.CommandParent'),
('py:class', 'ArgparseCommandFunc'),
('py:class', 'argparse._SubParsersAction'),
('py:class', 'cmd2.decorators.CommandParent'),
('py:class', 'cmd2.utils._T'),
('py:class', 'CommandParent'),
('py:class', 'frame'),
('py:class', 'RawCommandFuncOptionalBoolReturn'),
('py:class', 'types.FrameType'),
('py:obj', 'cmd2.decorators.CommandParent'),
]
20 changes: 18 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ dev = [
"pytest-cov",
"pytest-mock",
"sphinx",
"sphinx-rtd-theme",
"sphinx-autobuild",
"sphinx-rtd-theme",
"ruff",
"twine",
]
docs = [
"setuptools",
"setuptools_scm",
"sphinx",
"sphinx-rtd-theme",
"sphinx-autobuild",
"sphinx-rtd-theme",
]
test = [
"codecov",
Expand Down Expand Up @@ -317,3 +317,19 @@ docstring-code-line-length = "dynamic"
packages = ["cmd2"]

[tool.setuptools_scm]

[tool.uv]
dev-dependencies = [
"codecov",
"doc8",
"invoke",
"mypy",
"pytest",
"pytest-cov",
"pytest-mock",
"sphinx",
"sphinx-autobuild",
"sphinx-rtd-theme",
"ruff",
"twine",
]
4 changes: 2 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ def test_proc_reader_send_sigint(pr_none):
assert pr_none._proc.poll() is None
pr_none.send_sigint()
pr_none.wait()

# Mac sure a SIGINT killed the process
ret_code = pr_none._proc.poll()

# Make sure a SIGINT killed the process
if sys.platform.startswith('win'):
assert ret_code is not None
else:
Expand Down

0 comments on commit e492099

Please sign in to comment.