Skip to content

Commit 6563fb9

Browse files
committed
Fix a lint error caused by click deprecating __version__
1 parent d5e97c9 commit 6563fb9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/bin/env python3
22

3-
import click
3+
from importlib.metadata import version
4+
45
from packaging.version import parse
56

6-
if parse(click.__version__) < parse("8.1.1") or parse(click.__version__) >= parse("8.2"):
7+
click_version = version("click")
8+
9+
if parse(click_version) < parse("8.1.1") or parse(click_version) >= parse("8.2"):
710
print("🚧 Linting with mypy is currently only supported with click~=8.1.1. 🚧")
811
print("🔧 Please run `pip install click~=8.1.1` first. 🔨")
912
exit(1)

0 commit comments

Comments
 (0)