From 3a3cc823a2b1676eee50b76b6f789356e5d5f94a Mon Sep 17 00:00:00 2001 From: Kyle King Date: Thu, 6 Jun 2024 22:35:31 -0400 Subject: [PATCH] fix: make experimental dependencies optional --- calcipy/tasks/pack.py | 3 ++- pyproject.toml | 8 ++++++-- tests/tasks/test_pack.py | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/calcipy/tasks/pack.py b/calcipy/tasks/pack.py index 091685f4..a243d191 100644 --- a/calcipy/tasks/pack.py +++ b/calcipy/tasks/pack.py @@ -7,7 +7,6 @@ from .. import can_skip # Required for mocking can_skip.can_skip from ..cli import task -from ..experiments import bump_programmatically from ..invoke_helpers import run from .executable_utils import python_dir @@ -71,6 +70,8 @@ def bump_tag(ctx: Context, *, tag: str, tag_prefix: str = '', pkg_name: str = '' ``` """ + from ..experiments import bump_programmatically # noqa: PLC0415 + if not tag: raise ValueError('tag must not be empty') if not pkg_name: diff --git a/pyproject.toml b/pyproject.toml index 77ae0dea..28511a3d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ beartype = ">=0.18.2" bidict = {optional = true, version = ">=0.22.1"} # stale commitizen = {optional = true, version = ">=3.22.0"} # doc corallium = ">=1.0.2" -griffe = ">=0.32.3" # experimental +griffe = {optional = true, version = ">=0.45.2"} # experimental httpx = {optional = true, version = ">=0.24.1"} # stale invoke = ">=2.2.0" mkdocs = {optional = true, version = ">=1.5.3"} # doc @@ -81,7 +81,7 @@ pytest-watcher = {optional = true, version = ">=0.4.2"} # test python-box = {optional = true, version = ">=6.0.2"} # ddict pyyaml = {optional = true, version = ">=5.2"} # doc,tags ruff = {optional = true, version = ">=0.3.7"} # lint -semver = ">=3.0.1" # experimental +semver = {optional = true, version = ">=3.0.2"} # experimental tabulate = {optional = true, version = ">=0.9.0"} # tags: Required for pandas to markdown transitions = {optional = true, version = ">=0.9.0"} # tags: docs virtualenv = {optional = true, version = ">=20.24.0"} # tags: nox. Prevents 'scripts' KeyError with Python 3.12 @@ -105,6 +105,10 @@ doc = [ "pyyaml", "transitions", ] +experimental = [ + "griffe", + "semver", +] lint = [ "ruff", ] diff --git a/tests/tasks/test_pack.py b/tests/tasks/test_pack.py index ddaa1e87..3f40bdb1 100644 --- a/tests/tasks/test_pack.py +++ b/tests/tasks/test_pack.py @@ -11,7 +11,7 @@ ('task', 'kwargs', 'commands'), [ (install_extras, {}, [call( - 'poetry install --sync --extras=ddict --extras=doc --extras=lint' + 'poetry install --sync --extras=ddict --extras=doc --extras=experimental --extras=lint' ' --extras=nox --extras=pylint --extras=stale --extras=tags --extras=test --extras=types', )]), (lock, {}, [call('poetry lock --no-update')]),