|
2 | 2 | import pynvim |
3 | 3 | import pip |
4 | 4 |
|
| 5 | + |
5 | 6 | def update_sdks(): |
6 | | - pip.main(["install","pieces_os_client","--upgrade"]) |
| 7 | + pip.main(["install", "pieces_os_client", "--upgrade"]) |
| 8 | + |
7 | 9 |
|
8 | | -MIN_SDKS_VERSION = "4.4.0" |
| 10 | +MIN_SDKS_VERSION = "4.4.1" |
9 | 11 | try: |
10 | | - from pieces_os_client import __version__ as pieces_os_client_version |
| 12 | + from pieces_os_client import __version__ as pieces_os_client_version |
| 13 | + |
| 14 | + try: # If there is any issue in the version checker then it is outdated |
| 15 | + from pieces_os_client.wrapper.version_compatibility import VersionChecker |
11 | 16 |
|
12 | | - try: # If there is any issue in the version checker then it is outdated |
13 | | - from pieces_os_client.wrapper.version_compatibility import VersionChecker |
14 | | - VersionChecker.compare("1.0.0","1.0.0") # Check also that the compare is working too |
15 | | - except (AttributeError, ModuleNotFoundError): |
16 | | - update_sdks() |
17 | | - raise ModuleNotFoundError |
| 17 | + VersionChecker.compare( |
| 18 | + "1.0.0", "1.0.0" |
| 19 | + ) # Check also that the compare is working too |
| 20 | + except (AttributeError, ModuleNotFoundError): |
| 21 | + update_sdks() |
| 22 | + raise ModuleNotFoundError |
18 | 23 |
|
19 | | - if VersionChecker.compare(pieces_os_client_version,MIN_SDKS_VERSION) < 0: # We need to be above 4.0.0 |
20 | | - update_sdks() |
21 | | - raise ModuleNotFoundError |
22 | | - from .main import Pieces |
| 24 | + if ( |
| 25 | + VersionChecker.compare(pieces_os_client_version, MIN_SDKS_VERSION) < 0 |
| 26 | + ): # We need to be above 4.0.0 |
| 27 | + update_sdks() |
| 28 | + raise ModuleNotFoundError |
| 29 | + from .main import Pieces |
23 | 30 | except ModuleNotFoundError: |
24 | | - pip.main(["install","pieces_os_client"]) |
25 | | - from .main import Pieces |
| 31 | + pip.main(["install", "pieces_os_client"]) |
| 32 | + from .main import Pieces |
0 commit comments