From 7d7e0c02351303489d5555627337a39b519b536a Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 16 Aug 2023 14:18:10 -0400 Subject: Get python targets building I added 'black' to Biz/Lint.hs, but not the others because they rely on dependencies being in the PYTHONPATH to work, so they are only relevant in nix builds and repls. I also made some other tweaks to the python checkPhase and linted all the files. Everything should be building and linting correctly now. --- Biz/Bild/Example.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Biz/Bild/Example.py') diff --git a/Biz/Bild/Example.py b/Biz/Bild/Example.py index 78a8a6a..25686fa 100644 --- a/Biz/Bild/Example.py +++ b/Biz/Bild/Example.py @@ -1,15 +1,16 @@ +""" +Example Python file that also serves as a test case for bild. +fernet.""" # : out example # : dep cryptography import sys -from typing import List - -from cryptography.fernet import Fernet +import cryptography.fernet def cryptic_hello(name: str) -> str: "Example taken from `cryptography` docs." - key = Fernet.generate_key() - f = Fernet(key) + key = cryptography.fernet.Fernet.generate_key() + f = cryptography.fernet.Fernet(key) token = f.encrypt(hello(name).encode("utf-8")) ret = f.decrypt(token).decode("utf-8") assert ret == hello(name) @@ -17,10 +18,12 @@ def cryptic_hello(name: str) -> str: def hello(name: str) -> str: + "Say hello" return f"Hello {name}" def main() -> None: + "Entrypoint" if "test" in sys.argv: print("testing success") print(cryptic_hello("world")) -- cgit v1.2.3