Skip to content

Commit 24ef1bd

Browse files
committed
Use TYPE_CHECKING for tomlkit type hint
1 parent 415a594 commit 24ef1bd

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ Now, use the generated requirements and constraints files with i.e. `pip install
296296

297297
## uv pyproject.toml integration
298298

299-
mxdev includes a built-in hook to automatically update your `pyproject.toml` file when working with [uv](https://docs.astral.sh/uv/)-managed projects.
299+
mxdev includes a built-in hook to automatically update your `pyproject.toml` file when working with [uv](https://docs.astral.sh/uv/)-managed projects.
300300

301301
To use this feature, you must install mxdev with the `uv` extra:
302302

src/mxdev/uv.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
from mxdev.hooks import Hook
22
from mxdev.state import State
33
from pathlib import Path
4+
from typing import TYPE_CHECKING
45

56
import logging
67
import os
78
import tempfile
89

910

11+
if TYPE_CHECKING:
12+
import tomlkit
13+
14+
1015
logger = logging.getLogger("mxdev")
1116

1217

tests/test_uv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
from mxdev.state import State
33
from mxdev.uv import UvPyprojectUpdater
44

5-
import tomlkit
65
import pytest
76
import sys
7+
import tomlkit
88

99

1010
def test_hook_skips_when_pyproject_toml_missing(mocker, tmp_path, monkeypatch):

0 commit comments

Comments
 (0)