mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-06 01:31:39 -05:00
Add update script for a new vendor directory
Where we'll put pyproject.nix
This commit is contained in:
parent
60559cd89b
commit
4b4821888e
1 changed files with 31 additions and 0 deletions
31
vendor/update.py
vendored
Executable file
31
vendor/update.py
vendored
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
import subprocess
|
||||||
|
import shutil
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
store_path = json.loads(
|
||||||
|
subprocess.check_output(
|
||||||
|
[
|
||||||
|
"nix-instantiate",
|
||||||
|
"--eval",
|
||||||
|
"--json",
|
||||||
|
"--expr",
|
||||||
|
'builtins.fetchGit { url = "git@github.com:adisbladis/pyproject.nix.git"; }',
|
||||||
|
]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
|
shutil.rmtree("pyproject.nix")
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
os.mkdir("pyproject.nix")
|
||||||
|
|
||||||
|
for filename in os.listdir(f"{store_path}/lib"):
|
||||||
|
if filename.startswith("test") or not filename.endswith(".nix"):
|
||||||
|
continue
|
||||||
|
shutil.copy(f"{store_path}/lib/{filename}", f"pyproject.nix/{filename}")
|
Loading…
Add table
Reference in a new issue