File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change 44"""
55
66import re
7+ from typing import TYPE_CHECKING
78
89import packaging
910
@@ -155,14 +156,16 @@ def safer_best_effort_version(value: str) -> str:
155156 canonicalize_license_expression as _canonicalize_license_expression ,
156157 )
157158except ImportError :
158-
159- def _canonicalize_license_expression (expression : str ) -> str : # type: ignore[misc] # pyright: ignore[reportAssignmentType]
160- # Defer import error to affect only users that actually use it
161- # https://github.com/pypa/setuptools/issues/4894
162- raise ImportError (
163- "Cannot import `packaging.licenses`."
164- """
165- Setuptools>=77.0.0 requires "packaging>=24.2" to work properly.
166- Please make sure you have a suitable version installed.
167- """
168- )
159+ if not TYPE_CHECKING :
160+ # XXX: pyright is still upset even with # pyright: ignore[reportAssignmentType]
161+
162+ def _canonicalize_license_expression (expression : str ) -> str :
163+ # Defer import error to affect only users that actually use it
164+ # https://github.com/pypa/setuptools/issues/4894
165+ raise ImportError (
166+ "Cannot import `packaging.licenses`."
167+ """
168+ Setuptools>=77.0.0 requires "packaging>=24.2" to work properly.
169+ Please make sure you have a suitable version installed.
170+ """
171+ )
You can’t perform that action at this time.
0 commit comments