Expand env vars

This commit is contained in:
Byron Lathi
2025-07-14 12:45:49 -07:00
parent b8cd278cf1
commit 3a72154055
5 changed files with 8 additions and 2 deletions

View File

@@ -1,3 +1,5 @@
python3 -m venv .venv python3 -m venv .venv
source .venv/bin/activate source .venv/bin/activate
pip install -r requirements.txt pip install -r requirements.txt
export TOP_DIR=$(git rev-parse --show-toplevel)

View File

@@ -35,7 +35,7 @@ name = "rtl-manifest" # REQUIRED, is the only field that cannot be marked as dy
# https://packaging.python.org/guides/single-sourcing-package-version/ # https://packaging.python.org/guides/single-sourcing-package-version/
# dynamic = ["version"] # dynamic = ["version"]
version = "0.3.1" # REQUIRED, although can be dynamic version = "0.4.0" # REQUIRED, although can be dynamic
# This is a one-line description or tagline of what your project does. This # This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field: # corresponds to the "Summary" metadata field:

View File

@@ -3,6 +3,8 @@ import argparse
from typing import List, Tuple from typing import List, Tuple
import pathlib import pathlib
import os
def rtl_manifest_main(): def rtl_manifest_main():
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
@@ -38,7 +40,7 @@ def parse(source_file: str) -> Tuple[List[str], List[str]]:
base_dir = pathlib.Path(source_file).parent base_dir = pathlib.Path(source_file).parent
with open(source_file, "r") as file: with open(source_file, "r") as file:
for line in file: for line in file:
path = line.strip() path = os.path.expandvars(line.strip())
if path.startswith("#"): if path.startswith("#"):
continue continue
if path == "": if path == "":

0
test/other_file.txt Normal file
View File

View File

@@ -4,3 +4,5 @@ src/example.sv
# ^ above was a blank line # ^ above was a blank line
`include . `include .
$TOP_DIR/src/other_file.txt