diff --git a/.calcipy_packaging.lock b/.calcipy_packaging.lock index 25a1a809..dd1f861e 100644 --- a/.calcipy_packaging.lock +++ b/.calcipy_packaging.lock @@ -144,12 +144,12 @@ "version": "3.27.0" }, "corallium": { - "datetime": "2024-06-07T09:07:04.610944+00:00", + "datetime": "2024-06-07T11:56:42.609084+00:00", "domain": "https://pypi.org/pypi/{name}/json", - "latest_datetime": "2024-06-07T09:07:04.610944+00:00", - "latest_version": "1.0.3", + "latest_datetime": "2024-06-07T11:56:42.609084+00:00", + "latest_version": "2.0.0", "name": "corallium", - "version": "1.0.3" + "version": "2.0.0" }, "coverage": { "datetime": "2024-05-28T14:03:57.019159+00:00", diff --git a/docs/docs/CHANGELOG.md b/docs/docs/CHANGELOG.md index a5036a34..b2f8c939 100644 --- a/docs/docs/CHANGELOG.md +++ b/docs/docs/CHANGELOG.md @@ -1,5 +1,15 @@ ## Unreleased +## 3.0.1 (2024-06-12) + +### Fix + +- don't pass arguments to pyright CLI + +### Perf + +- cache known executables + ## 3.0.0 (2024-06-07) ### Fix diff --git a/docs/docs/DEVELOPER_GUIDE.md b/docs/docs/DEVELOPER_GUIDE.md index 8cbfa8b2..0b82bc30 100644 --- a/docs/docs/DEVELOPER_GUIDE.md +++ b/docs/docs/DEVELOPER_GUIDE.md @@ -72,15 +72,15 @@ poetry config pypi-token.pypi ... | `calcipy/tasks/cl.py` | 28 | 5 | 0 | 75.0% | | `calcipy/tasks/defaults.py` | 20 | 0 | 0 | 89.3% | | `calcipy/tasks/doc.py` | 45 | 0 | 8 | 90.5% | -| `calcipy/tasks/executable_utils.py` | 27 | 0 | 0 | 87.2% | +| `calcipy/tasks/executable_utils.py` | 34 | 0 | 0 | 89.6% | | `calcipy/tasks/lint.py` | 44 | 2 | 0 | 82.9% | | `calcipy/tasks/nox.py` | 8 | 0 | 0 | 100.0% | | `calcipy/tasks/pack.py` | 42 | 11 | 0 | 64.1% | | `calcipy/tasks/stale.py` | 6 | 0 | 0 | 100.0% | | `calcipy/tasks/tags.py` | 18 | 1 | 0 | 91.7% | | `calcipy/tasks/test.py` | 45 | 1 | 2 | 89.2% | -| `calcipy/tasks/types.py` | 20 | 0 | 0 | 89.3% | -| **Totals** | 1019 | 76 | 262 | 86.5% | +| `calcipy/tasks/types.py` | 14 | 0 | 0 | 90.0% | +| **Totals** | 1020 | 76 | 262 | 86.5% | -Generated on: 2024-06-07 +Generated on: 2024-06-12 diff --git a/poetry.lock b/poetry.lock index a6fcb8c7..eff207c0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2770,4 +2770,4 @@ types = ["basedpyright", "mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9.13" -content-hash = "de97bfb430ca5fab3062b39dc724cb9107f02514597092db252f902457ae6c3a" +content-hash = "aa1886d6f11bf56932cb1b0283f84c057239ea533ce0e17a7044d1ae3771d1cc" diff --git a/pyproject.toml b/pyproject.toml index 93cdefb1..9b8cf398 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ basedpyright = {optional = true, version = ">=1.6.0"} # types beartype = ">=0.18.2" bidict = {optional = true, version = ">=0.22.1"} # stale commitizen = {optional = true, version = ">=3.22.0"} # doc -corallium = ">=1.0.3" +corallium = ">=2.0.0" griffe = {optional = true, version = ">=0.45.2"} # experimental httpx = {optional = true, version = ">=0.24.1"} # stale invoke = ">=2.2.0" diff --git a/tests/conftest.py b/tests/conftest.py index a8ba2c90..0643c995 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -4,14 +4,14 @@ import pytest from beartype import beartype -from beartype.typing import Dict +from beartype.typing import Dict, Union from invoke.context import MockContext from .configuration import TEST_TMP_CACHE, clear_test_cache @pytest.fixture(scope='module') -def vcr_config() -> Dict: +def vcr_config() -> Dict[str, Union[str, bool, list[str]]]: """Global configuration (https://github.com/kiwicom/pytest-recording) for `pytest-recording` (vcr). Returns @@ -51,10 +51,10 @@ def ctx() -> MockContext: Adapted from: - https://github.com/pyinvoke/invocations/blob/8a277c304dd7aaad03888ee42d811c468e7fb37d/tests/conftest.py#L5-L11 + https://github.com/pyinvoke/invocations/blob/4e3578e9c49dbbff2ec00ef3c8d37810fba511fa/tests/conftest.py#L13-L19 Documentation: https://docs.pyinvoke.org/en/stable/concepts/testing.html """ - MockContext.run_command = property(lambda self: self.run.call_args[0][0]) + MockContext.run_command = property(lambda self: self.run.call_args[0][0]) # type: ignore[attr-defined] return MockContext(run=True) diff --git a/tests/noxfile/test_noxfile.py b/tests/noxfile/test_noxfile.py index 470db7f1..f6b64b24 100644 --- a/tests/noxfile/test_noxfile.py +++ b/tests/noxfile/test_noxfile.py @@ -5,7 +5,7 @@ def test__installable_dev_dependencies(monkeypatch): - def stubbed_read_pyproject() -> Dict: + def stubbed_read_pyproject() -> Dict: # type: ignore[type-arg] return { 'tool': { 'poetry': { diff --git a/tests/tasks/test_tags.py b/tests/tasks/test_tags.py index 2077b1c6..0670490c 100644 --- a/tests/tasks/test_tags.py +++ b/tests/tasks/test_tags.py @@ -1,9 +1,10 @@ +# mypy: disable_error_code=type-arg + from pathlib import Path -from unittest.mock import call import pytest from beartype import beartype -from beartype.typing import Callable, Dict, List +from beartype.typing import Callable, Dict from calcipy.tasks.tags import collect_code_tags from tests.configuration import APP_DIR, TEST_DATA_DIR @@ -29,7 +30,7 @@ def _check_output(kwargs: Dict) -> None: @pytest.mark.parametrize( - ('task', 'kwargs', 'commands', 'validator'), + ('task', 'kwargs', 'validator'), [ (collect_code_tags, { 'base_dir': APP_DIR.as_posix(), @@ -38,12 +39,12 @@ def _check_output(kwargs: Dict) -> None: 'tag_order': 'FIXME,TODO', 'regex': '', 'ignore_patterns': '*.py,*.yaml,docs/docs/*.md', - }, [], _check_no_write), + }, _check_no_write), (collect_code_tags, { 'base_dir': APP_DIR.as_posix(), 'doc_sub_dir': TEST_DATA_DIR.as_posix(), 'filename': 'test_tags.md.rej', - }, [], _check_output), + }, _check_output), ], ids=[ 'Check that no code tags were matched and no file was created', @@ -51,12 +52,7 @@ def _check_output(kwargs: Dict) -> None: ], ) @beartype -def test_tags(ctx, task, kwargs: Dict, commands: List[str], validator: Callable[[Dict], None]): +def test_tags(ctx, task, kwargs: Dict, validator: Callable[[Dict], None]): task(ctx, **kwargs) - ctx.run.assert_has_calls([ - call(cmd) if isinstance(cmd, str) else cmd - for cmd in commands - ]) - validator(kwargs) diff --git a/tests/test_scripts.py b/tests/test_scripts.py index d91f886b..c895b04c 100644 --- a/tests/test_scripts.py +++ b/tests/test_scripts.py @@ -1 +1 @@ -from calcipy.scripts import start_program # noqa: F401 # Smoke test the scripts import +from calcipy.scripts import start # noqa: F401 # Smoke test the scripts import