Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyharrison committed Dec 1, 2024
1 parent 4d6f377 commit 79f9009
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions sbom4python/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ def _create_package(self, package, version, parent="-", requirements=None):
)
else:
self.sbom_package.set_downloadlocation(
f"https://pypi.org/project/{package}/{version}/#files"
)
f"https://pypi.org/project/{package}/{version}/#files"
)
else:
self.sbom_package.set_downloadlocation(self.metadata.get("Download-URL"))
# External references
Expand All @@ -268,7 +268,9 @@ def _create_package(self, package, version, parent="-", requirements=None):
self.sbom_package.set_cpe(
f"cpe:2.3:a:{component_supplier.replace(' ', '_').lower()}:{package}:{cpe_version}:*:*:*:*:*:*:*"
)
checksum, checksum_algorithm = self.package_metadata.get_checksum(version=version)
checksum, checksum_algorithm = self.package_metadata.get_checksum(
version=version
)
if checksum is not None:
self.sbom_package.set_checksum(checksum_algorithm, checksum)
# Copyright
Expand Down Expand Up @@ -563,7 +565,7 @@ def process_requirements(self, filename):
elif filename.endswith(".txt"):
self.process_requirements_file(filename)
elif self.debug:
print (f"Unable to process requirements file {filename}")
print(f"Unable to process requirements file {filename}")

def _process_requirement_dependency(self, dependency, filename):
if len(dependency.strip()) > 0:
Expand All @@ -585,6 +587,7 @@ def _process_requirement_dependency(self, dependency, filename):
print(f"Processing {package}")
self._create_package(package, version, requirements=filename)
self._create_relationship(package)

def process_requirements_file(self, filename):
# Process a requirements.txt file
if len(filename) > 0:
Expand Down

0 comments on commit 79f9009

Please sign in to comment.