diff --git a/codegen/dataset/generate_fields.py b/codegen/dataset/generate_fields.py index b176707..c55db96 100644 --- a/codegen/dataset/generate_fields.py +++ b/codegen/dataset/generate_fields.py @@ -22,9 +22,6 @@ UniprotSearchField, ) -# We use some python 3.8+ features here -assert sys.version_info >= (3, 9) - # If the functions return anything, print it app = typer.Typer(result_callback=lambda x: print(x)) @@ -417,6 +414,10 @@ def generate_query_fields(dataset: str, type_name: str) -> Iterable[ast.stmt]: return top_level +# We use some python 3.8+ features here +assert sys.version_info >= (3, 9) + + @app.command() def make_dataset(dataset: str): module = ast.Module( diff --git a/codegen/id_mapping/generate.py b/codegen/id_mapping/generate.py index 8105dd4..831f861 100644 --- a/codegen/id_mapping/generate.py +++ b/codegen/id_mapping/generate.py @@ -8,9 +8,6 @@ import requests import typer -# ast.unparse uses Python 3.9+ -assert sys.version_info >= (3, 9) - app = typer.Typer(result_callback=lambda x: print(x)) @@ -109,6 +106,10 @@ def to_function(self) -> ast.FunctionDef: ) +# ast.unparse uses Python 3.9 +assert sys.version_info >= (3, 9) + + @app.command() def main() -> None: rules: defaultdict[int, Rule] = defaultdict(Rule)