|
48 | 48 | def is_package_is_up_to_date(package_name: str): |
49 | 49 | try: |
50 | 50 | cur_version = version(package_name) |
51 | | - except: |
| 51 | + except Exception: |
52 | 52 | cur_version = "not installed" |
53 | 53 |
|
54 | 54 | try: |
55 | 55 | response = requests.get(f"https://pypi.org/pypi/{package_name}/json") |
56 | 56 | latest_version = response.json()["info"]["version"] |
57 | | - except: |
| 57 | + except Exception: |
58 | 58 | latest_version = "package does not exist" |
59 | 59 |
|
60 | 60 | return cur_version == latest_version |
@@ -93,14 +93,14 @@ def model_post_init(self, ctx): |
93 | 93 | pymatgen_is_up_to_date = is_package_is_up_to_date("pymatgen") |
94 | 94 | if not pymatgen_is_up_to_date: |
95 | 95 | warnings.warn( |
96 | | - f"We *STRONGLY* recommend you to update your `pymatgen` package, which is behind the most recent version. " |
97 | | - f"Hence, if any pymatgen input sets have been updated, this validator will be outdated." |
| 96 | + "We *STRONGLY* recommend you to update your `pymatgen` package, which is behind the most recent version. " |
| 97 | + "Hence, if any pymatgen input sets have been updated, this validator will be outdated." |
98 | 98 | ) |
99 | 99 | pymatgen_io_validation_is_up_to_date = is_package_is_up_to_date("pymatgen-io-validation") |
100 | 100 | if not pymatgen_io_validation_is_up_to_date: |
101 | 101 | warnings.warn( |
102 | | - f"We *STRONGLY* recommend you to update your `pymatgen-io-validation` package, which is behind the most recent version. " |
103 | | - f"Hence, if any checks in this package have been updated, the validator you use will be outdated." |
| 102 | + "We *STRONGLY* recommend you to update your `pymatgen-io-validation` package, which is behind the most recent version. " |
| 103 | + "Hence, if any checks in this package have been updated, the validator you use will be outdated." |
104 | 104 | ) |
105 | 105 |
|
106 | 106 | class Config: # noqa |
|
0 commit comments