|
22 | 22 | _get_distribution_and_import_packages, |
23 | 23 | ) |
24 | 24 |
|
25 | | -# It is a good practice to alias the Version class for clarity in type hints. |
26 | 25 | from packaging.version import parse as parse_version, Version as PackagingVersion |
27 | 26 |
|
28 | 27 |
|
@@ -72,24 +71,28 @@ def warn_deprecation_for_versions_less_than( |
72 | 71 | `next_supported_version`, this issues a warning using either a |
73 | 72 | default `message_template` or one provided by the user. The |
74 | 73 | default `message_template` informs the user that they will not receive |
75 | | - future updates `dependent_import_package` if |
| 74 | + future updates for `dependent_import_package` if |
76 | 75 | `dependency_import_package` is somehow pinned to a version lower |
77 | 76 | than `next_supported_version`. |
78 | 77 |
|
79 | 78 | Args: |
80 | 79 | dependent_import_package: The import name of the package that |
81 | 80 | needs `dependency_import_package`. |
82 | 81 | dependency_import_package: The import name of the dependency to check. |
83 | | - next_supported_version: The version number below which a deprecation |
84 | | - warning will be logged. |
| 82 | + next_supported_version: The dependency_import_package version number |
| 83 | + below which a deprecation warning will be logged. |
85 | 84 | message_template: A custom default message template to replace |
86 | 85 | the default. This `message_template` is treated as an |
87 | 86 | f-string, where the following variables are defined: |
88 | 87 | `dependency_import_package`, `dependent_import_package` and |
89 | | - `dependency_package`, `dependent_package`, which contain both the |
90 | | - import and distribution packages for the dependency and the dependent, |
91 | | - respectively; and `next_supported_version` and `version_used`, which |
92 | | - refer to supported and currently-used versions of the dependency. |
| 88 | + `dependency_distribution_package` and |
| 89 | + `dependent_distribution_package` and `dependency_package`, |
| 90 | + `dependent_package` , which contain the import packages, the |
| 91 | + distribution packages, and pretty string with both the |
| 92 | + distribution and import packages for the dependency and the |
| 93 | + dependent, respectively; and `next_supported_version` and |
| 94 | + `version_used`, which refer to supported and currently-used |
| 95 | + versions of the dependency. |
93 | 96 |
|
94 | 97 | """ |
95 | 98 | if ( |
@@ -129,6 +132,8 @@ def warn_deprecation_for_versions_less_than( |
129 | 132 | message_template.format( |
130 | 133 | dependent_import_package=dependent_import_package, |
131 | 134 | dependency_import_package=dependency_import_package, |
| 135 | + dependent_distribution_package=dependent_distribution_package, |
| 136 | + dependency_distribution_package=dependency_distribution_package, |
132 | 137 | dependency_package=dependency_package, |
133 | 138 | dependent_package=dependent_package, |
134 | 139 | next_supported_version=next_supported_version, |
|
0 commit comments