mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-06-29 14:40:36 +02:00
fixes for venvs on windows
This commit is contained in:
@ -1,9 +1,8 @@
|
|||||||
import importlib
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from pathlib import Path
|
from sys import platform
|
||||||
|
|
||||||
from nostr_sdk import PublicKey, Keys, Client, Tag, Event, EventBuilder, Filter, HandleNotification, Timestamp, \
|
from nostr_sdk import PublicKey, Keys, Client, Tag, Event, EventBuilder, Filter, HandleNotification, Timestamp, \
|
||||||
init_logger, LogLevel, Options, nip04_encrypt
|
init_logger, LogLevel, Options, nip04_encrypt
|
||||||
@ -475,8 +474,11 @@ class DVM:
|
|||||||
request_form = dvm.create_request_from_nostr_event(job_event, self.client, self.dvm_config)
|
request_form = dvm.create_request_from_nostr_event(job_event, self.client, self.dvm_config)
|
||||||
|
|
||||||
if dvm_config.USE_OWN_VENV:
|
if dvm_config.USE_OWN_VENV:
|
||||||
python_bin = (r'cache/venvs/' + os.path.basename(dvm_config.SCRIPT).split(".py")[0]
|
python_location = "/bin/python"
|
||||||
+ "/bin/python")
|
if platform == "win32":
|
||||||
|
python_location = "/Scripts/python"
|
||||||
|
python_bin = ( r'cache/venvs/' + os.path.basename(dvm_config.SCRIPT).split(".py")[0]
|
||||||
|
+ python_location)
|
||||||
retcode = subprocess.call([python_bin, dvm_config.SCRIPT,
|
retcode = subprocess.call([python_bin, dvm_config.SCRIPT,
|
||||||
'--request', json.dumps(request_form),
|
'--request', json.dumps(request_form),
|
||||||
'--identifier', dvm_config.IDENTIFIER,
|
'--identifier', dvm_config.IDENTIFIER,
|
||||||
|
@ -71,7 +71,7 @@ class DVMTaskInterface:
|
|||||||
self.dependencies.append(("nostr-dvm", "nostr-dvm"))
|
self.dependencies.append(("nostr-dvm", "nostr-dvm"))
|
||||||
for (module, package) in self.dependencies:
|
for (module, package) in self.dependencies:
|
||||||
print("Installing Venv Module: " + module)
|
print("Installing Venv Module: " + module)
|
||||||
run([pip_location, "install", "--force-reinstall", package], cwd=dir)
|
run([pip_location, "install", "--upgrade", package], cwd=dir)
|
||||||
else:
|
else:
|
||||||
for module, package in self.dependencies:
|
for module, package in self.dependencies:
|
||||||
if module != "nostr-dvm":
|
if module != "nostr-dvm":
|
||||||
|
Reference in New Issue
Block a user