Commit d1336961 by David Hotham Committed by Bjorn Neergaard

fix more truthy-bool mypy warnings

parent daddf1ba
...@@ -126,7 +126,7 @@ The <c1>init</c1> command creates a basic <comment>pyproject.toml</> file in the ...@@ -126,7 +126,7 @@ The <c1>init</c1> command creates a basic <comment>pyproject.toml</> file in the
description = self.ask(question) description = self.ask(question)
author = self.option("author") author = self.option("author")
if not author and vcs_config and vcs_config.get("user.name"): if not author and vcs_config.get("user.name"):
author = vcs_config["user.name"] author = vcs_config["user.name"]
author_email = vcs_config.get("user.email") author_email = vcs_config.get("user.email")
if author_email: if author_email:
......
...@@ -524,7 +524,7 @@ lists all packages available.""" ...@@ -524,7 +524,7 @@ lists all packages available."""
constraint = parse_constraint("^" + package.pretty_version) constraint = parse_constraint("^" + package.pretty_version)
if latest.version and constraint.allows(latest.version): if constraint.allows(latest.version):
# It needs an immediate semver-compliant upgrade # It needs an immediate semver-compliant upgrade
return "semver-safe-update" return "semver-safe-update"
......
...@@ -88,7 +88,7 @@ class PyPiRepository(HTTPRepository): ...@@ -88,7 +88,7 @@ class PyPiRepository(HTTPRepository):
ignored_pre_release_packages.append(package) ignored_pre_release_packages.append(package)
continue continue
if not constraint or (constraint and constraint.allows(package.version)): if constraint.allows(package.version):
packages.append(package) packages.append(package)
self._log( self._log(
......
...@@ -289,7 +289,7 @@ class SitePackages: ...@@ -289,7 +289,7 @@ class SitePackages:
f"{path} is not relative to any discovered {site_type}sites" f"{path} is not relative to any discovered {site_type}sites"
) )
results = [candidate / path for candidate in candidates if candidate] results = [candidate / path for candidate in candidates]
if not results and strict: if not results and strict:
raise RuntimeError( raise RuntimeError(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment