You need to sign in or sign up before continuing.
Commit b762bfd3 by Mathieu Kniewallner Committed by Bjorn Neergaard

refactor: comply with mypy `truthy-bool`

parent 1bb97299
...@@ -418,7 +418,7 @@ You can specify a package in the following forms: ...@@ -418,7 +418,7 @@ You can specify a package in the following forms:
return [ return [
parse_dependency_specification( parse_dependency_specification(
requirement=requirement, requirement=requirement,
env=self.env if isinstance(self, EnvCommand) and self.env else None, env=self.env if isinstance(self, EnvCommand) else None,
cwd=cwd, cwd=cwd,
) )
for requirement in requirements for requirement in requirements
......
...@@ -424,10 +424,7 @@ class PackageInfo: ...@@ -424,10 +424,7 @@ class PackageInfo:
except ValueError: except ValueError:
return None return None
info = cls._from_distribution(dist=dist) return cls._from_distribution(dist=dist)
if info:
return info
return None
@classmethod @classmethod
def from_package(cls, package: Package) -> PackageInfo: def from_package(cls, package: Package) -> PackageInfo:
...@@ -491,7 +488,6 @@ class PackageInfo: ...@@ -491,7 +488,6 @@ class PackageInfo:
# we discovered PkgInfo but no requirements were listed # we discovered PkgInfo but no requirements were listed
assert info
info._source_type = "directory" info._source_type = "directory"
info._source_url = path.as_posix() info._source_url = path.as_posix()
......
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