Skip to content

Commit

Permalink
Move the version check to the last possible block
Browse files Browse the repository at this point in the history
  • Loading branch information
multimeric committed Aug 14, 2024
1 parent 1ce1fd6 commit 8de3f9a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions codegen/dataset/generate_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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(
Expand Down
7 changes: 4 additions & 3 deletions codegen/id_mapping/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))


Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8de3f9a

Please sign in to comment.