mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-04 20:22:14 +03:00
python: fix pip translator
This commit is contained in:
parent
753452e0fb
commit
cd223d4669
@ -40,10 +40,9 @@ in {
|
||||
jsonInput=$1
|
||||
|
||||
# read the json input
|
||||
outputFile=$(${jq}/bin/jq '.outputFile' -c -r $jsonInput)
|
||||
source=$(${jq}/bin/jq '.source' -c -r $jsonInput)
|
||||
pythonAttr=$(${jq}/bin/jq '.pythonAttr' -c -r $jsonInput)
|
||||
application=$(${jq}/bin/jq '.application' -c -r $jsonInput)
|
||||
outputFile=$WORKDIR/$(${jq}/bin/jq '.outputFile' -c -r $jsonInput)
|
||||
source="$(${jq}/bin/jq '.source' -c -r $jsonInput)/$(${jq}/bin/jq '.project.relPath' -c -r $jsonInput)"
|
||||
pythonAttr=$(${jq}/bin/jq '.project.subsystemInfo.pythonAttr' -c -r $jsonInput)
|
||||
|
||||
# build python and pip executables
|
||||
tmpBuild=$(mktemp -d)
|
||||
@ -89,6 +88,7 @@ in {
|
||||
-r $tmpBuild/computed_requirements
|
||||
# -r ''${inputFiles/$'\n'/$' -r '}
|
||||
|
||||
cd $WORKDIR
|
||||
# generate the dream lock from the downloaded list of files
|
||||
NAME=$(${jq}/bin/jq '.name' -c -r $tmpBuild/python.json) \
|
||||
VERSION=$(${jq}/bin/jq '.version' -c -r $tmpBuild/python.json) \
|
||||
|
@ -3,6 +3,7 @@ import base64
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import sys
|
||||
import urllib.request
|
||||
|
||||
@ -66,7 +67,7 @@ def main():
|
||||
"sourcesAggregatedHash": None,
|
||||
},
|
||||
_subsystem={
|
||||
"application": jsonInput['application'],
|
||||
"application": jsonInput.get('application', False),
|
||||
"pythonAttr": f"python{sys.version_info.major}{sys.version_info.minor}",
|
||||
"sourceFormats":
|
||||
{pname: data['format'] for pname, data in packages.items()}
|
||||
@ -85,6 +86,8 @@ def main():
|
||||
|
||||
# dump dream lock to $ouputFile
|
||||
print(jsonInput['outputFile'])
|
||||
dirPath = pathlib.Path(os.path.dirname(jsonInput['outputFile']))
|
||||
dirPath.mkdir(parents=True, exist_ok=True)
|
||||
with open(jsonInput['outputFile'], 'w') as lock:
|
||||
json.dump(dream_lock, lock, indent=2)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user