Skip to content

Commit

Permalink
Add main() to verify-hashes; remove unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
eloquence committed Oct 24, 2023
1 parent e9f02f2 commit 4d11da0
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions scripts/verify-hashes
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ import sys
from pathlib import Path
import utils

try:
import tomllib
except ModuleNotFoundError:
# pre-Python 3.11 compatibility
import toml as tomllib

# For a requirements file in one of our projects, this script checks if we have at
# least one corresponding sha256sum (for the source tarball) for each dependency.
# The script should be run from the project directory whose requirements you
Expand All @@ -21,11 +15,12 @@ except ModuleNotFoundError:
# Once Poetry support is stable across all components, requirements.txt support
# can be deprecated.

""""
Ensure that we have at least one signed SHA256 sum for each dependency declared
in a project's requirements file. This will be the source tarball.
"""
if __name__ == "__main__":

def main():
""" "
Ensure that we have at least one signed SHA256 sum for each dependency declared
in a project's requirements file. This will be the source tarball.
"""
if len(sys.argv) != 2:
print("Usage: ./scripts/verify-hashes path/to/sha256sums.txt")
sys.exit(1)
Expand Down Expand Up @@ -69,3 +64,7 @@ if __name__ == "__main__":
sys.exit(1)

sys.exit(0)


if __name__ == "__main__":
main()

0 comments on commit 4d11da0

Please sign in to comment.