Skip to content

Commit

Permalink
fix for lock2yaml (#1171)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlittle authored Oct 21, 2024
1 parent 59a1f0d commit 9dba3e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions requirements/locks/lock2yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from __future__ import annotations

from pathlib import Path
import sys

from jinja2 import Environment, FileSystemLoader, select_autoescape
Expand All @@ -22,15 +23,14 @@
template = environment.get_template("lock2yaml.txt")

# default to linux-64 only
env = sys.argv[1]
env = f"{sys.argv[1]}-lock"
lock = f"{env}-linux-64.txt"
name = f"geovista-{env}"
yaml = f"{env}-linux-64.yml"

# TODO @bjlittle: use Path.open when >=py311 and remove .ruff.toml ignore
with open(lock) as fin:
with Path(lock).open(mode="r") as fin:
content = template.render(file=fin, name=name)

with open(yaml, mode="w", encoding="utf-8") as fout:
with Path(yaml).open(mode="w", encoding="utf-8") as fout:
fout.write(content)
fout.write("\n")

0 comments on commit 9dba3e9

Please sign in to comment.