poetry2nix/generate.py

16 lines
424 B
Python
Raw Permalink Normal View History

2019-06-24 16:23:02 +01:00
#!/usr/bin/env nix-shell
2020-01-07 23:40:40 +00:00
#! nix-shell -i python3 -p python3 poetry
2019-06-24 16:23:02 +01:00
# Run code generation used by poetry2nix
from poetry.packages.utils.utils import SUPPORTED_EXTENSIONS
import json
2022-01-12 18:25:02 +13:00
EXT_FILE = "extensions.json"
2019-06-24 16:23:02 +01:00
2022-01-12 18:25:02 +13:00
if __name__ == "__main__":
with open(EXT_FILE, "w") as f:
ext = set(ext.lstrip(".") for ext in SUPPORTED_EXTENSIONS)
ext.add("egg")
f.write(json.dumps(sorted(ext), indent=2) + "\n")