Skip to content

Commit

Permalink
chore: remove an inaccurate warning (ApeWorX#2229)
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey authored Aug 22, 2024
1 parent fa2ba27 commit ee4e5fd
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/ape/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,20 +177,7 @@ def get_package_version(obj: Any) -> str:
# NOTE: In case the distribution and package name differ
dists = _get_distributions(pkg_name)
if dists:
num_packages = len(dists)
pkg_name = dists[0].metadata["Name"]

if num_packages != 1:
# Warn that there are more than 1 package with this name,
# which can lead to odd behaviors.
found_paths = [str(d._path) for d in dists if hasattr(d, "_path")]
found_paths_str = ",\n\t".join(found_paths)
message = f"Found {num_packages} packages named '{pkg_name}'."
if found_paths:
message = f"{message}\nInstallation paths:\n\t{found_paths_str}"

logger.warning(message)

try:
return str(version_metadata(pkg_name))

Expand Down

0 comments on commit ee4e5fd

Please sign in to comment.