Skip to content

Commit e507bc9

Browse files
authored
Fix compare version for packages (#10762)
1 parent 3d6262b commit e507bc9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
199199
- Fixed the `{validation,test}_step` outputs getting moved to CPU with `Trainer(move_metrics_to_cpu=True)` ([#10631](https://github.com/PyTorchLightning/pytorch-lightning/pull/10631))
200200

201201

202+
- Fixed `_compare_version` for python packages ([#10762](https://github.com/PyTorchLightning/pytorch-lightning/pull/10762))
203+
202204

203205
## [1.5.2] - 2021-11-16
204206

pytorch_lightning/utilities/imports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _compare_version(package: str, op: Callable, version: str, use_base_version:
5858
pkg_version = Version(pkg.__version__)
5959
else:
6060
# try pkg_resources to infer version
61-
pkg_version = Version(pkg_resources.get_distribution(pkg).version)
61+
pkg_version = Version(pkg_resources.get_distribution(package).version)
6262
except TypeError:
6363
# this is mocked by Sphinx, so it should return True to generate all summaries
6464
return True

0 commit comments

Comments
 (0)