Skip to content

Commit f5155f6

Browse files
author
Fabien Coelho
committed
used dotenv instead of manual parsing
1 parent 8fa8c00 commit f5155f6

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

implementations/c-jsu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ WORKDIR /usr/src/myapp
1111
ARG JMC
1212
ARG JSU
1313

14-
RUN apk add git py3-pip py3-re2 icu-data-full
14+
RUN apk add git py3-pip py3-re2 py3-dotenv icu-data-full
1515

1616
# force install, otherwise it would require a virtual environment
1717
RUN pip install --break-system-packages jsonschema-specifications

implementations/c-jsu/bowtie_jsu_compile.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"""
1010

1111
from pathlib import Path
12+
import dotenv
1213
import hashlib
1314
import json
1415
import os
@@ -71,12 +72,7 @@ class Runner:
7172
def __init__(self, language: str = "python", options: list[str] = []):
7273

7374
# setup environment
74-
if ENV.exists():
75-
with Path.open(ENV) as env:
76-
for line in env:
77-
if line.startswith("export ") and "=" in line:
78-
var, val = line[7:].rstrip().split("=", 1)
79-
os.environ[var] = val
75+
dotenv.load_dotenv(ENV)
8076

8177
# setup language
8278
self.language: str = language.lower()

0 commit comments

Comments
 (0)