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
EXT_FILE = 'extensions.json'
if __name__ == '__main__':
with open(EXT_FILE, 'w') as f:
2020-01-07 23:40:40 +00:00
ext = set(ext.lstrip('.') for ext in SUPPORTED_EXTENSIONS)
ext.add('egg')
f.write(json.dumps(sorted(ext), indent=2) + '\n')