Skip to content

Commit

Permalink
Attempt to install tomli-w from inside cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
austinschneider committed Jan 18, 2025
1 parent 9fd2342 commit 70fc941
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmake/parse_pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import sys
import os
import subprocess

# If you're on Python < 3.11, you can 'pip install tomli' and do `import tomli`.
# On Python >= 3.11, tomllib is in the standard library.
Expand All @@ -18,8 +19,11 @@
try:
import tomli_w as toml # Use tomli_w to *write* TOML back out
except ModuleNotFoundError as e:
print(f"[Error] Please install the 'tomli-w' package: `pip install toml-w`", file=sys.stderr)
raise
try:
subprocess.check_call([sys.executable, "-m", "pip", "install", "tomli-w"])
except:
print(f"[Error] Please install the 'tomli-w' package: `pip install toml-w`", file=sys.stderr)
raise

def main():
if len(sys.argv) < 3:
Expand Down

0 comments on commit 70fc941

Please sign in to comment.