diff --git a/appveyor.yml b/appveyor.yml index b4cc1930a..c2479d99e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,7 @@ version: .{build}-{branch} environment: + SYSTEMROOT: "C:\\WINDOWS" matrix: - PYTHON: "C:\\Python27" @@ -11,16 +12,16 @@ environment: PYTHON_VERSION: "2.7.x" PYTHON_ARCH: "64" - - PYTHON: "C:\\Python33_64" - PYTHON_VERSION: "3.3" + - PYTHON: "C:\\Python33-x64" + PYTHON_VERSION: "3.3.x" PYTHON_ARCH: "64" - - PYTHON: "C:\\Python34_64" - PYTHON_VERSION: "3.4" + - PYTHON: "C:\\Python34-x64" + PYTHON_VERSION: "3.4.x" PYTHON_ARCH: "64" - - PYTHON: "C:\\Python35_64" - PYTHON_VERSION: "3.5" + - PYTHON: "C:\\Python35-x64" + PYTHON_VERSION: "3.5.x" PYTHON_ARCH: "64" @@ -28,11 +29,9 @@ install: - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - "python --version" - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" - - "pip install --disable-pip-version-check --user --upgrade pip" - - "pip install --upgrade --no-deps --force-reinstall git+git://github.com/kapilkd13/schema_salad@windows#egg=schema_salad-2.4.201706261942" build_script: - - "%CMD_IN_ENV% python setup.py install" + - "%CMD_IN_ENV% pip install ." test_script: diff --git a/cwltool/builder.py b/cwltool/builder.py index 20f67b258..ad9d58869 100644 --- a/cwltool/builder.py +++ b/cwltool/builder.py @@ -62,8 +62,8 @@ def __init__(self): # type: () -> None self.job_script_provider = None # type: Any def build_job_script(self, commands): - # type: (List[bytes]) -> Text - build_job_script_method = getattr(self.job_script_provider, "build_job_script", None) # type: Callable[[Builder, List[bytes]], Text] + # type: (List[Text]) -> Text + build_job_script_method = getattr(self.job_script_provider, "build_job_script", None) # type: Callable[[Builder, Union[List[str],List[Text]]], Text] if build_job_script_method: return build_job_script_method(self, commands) else: diff --git a/cwltool/job.py b/cwltool/job.py index 4e82b7e22..aee86732e 100644 --- a/cwltool/job.py +++ b/cwltool/job.py @@ -207,7 +207,7 @@ def _execute(self, runtime, env, rm_tmpdir=True, move_outputs="move"): os.makedirs(dn) stdout_path = absout - commands = [Text(x).encode('utf-8') for x in runtime + self.command_line] + commands = [Text(x) for x in (runtime + self.command_line)] job_script_contents = None # type: Text builder = getattr(self, "builder", None) # type: Builder if builder is not None: @@ -297,6 +297,8 @@ def run(self, pull_image=True, rm_container=True, env["TMPDIR"] = str(self.tmpdir) if onWindows() else self.tmpdir if "PATH" not in env: env["PATH"] = str(os.environ["PATH"]) if onWindows() else os.environ["PATH"] + if "SYSTEMROOT" not in env and "SYSTEMROOT" in os.environ: + env["SYSTEMROOT"] = str(os.environ["SYSTEMROOT"]) if onWindows() else os.environ["SYSTEMROOT"] stageFiles(self.pathmapper, ignoreWritable=True, symLink=True) if self.generatemapper: @@ -422,7 +424,7 @@ def run(self, pull_image=True, rm_container=True, def _job_popen( - commands, # type: List[bytes] + commands, # type: List[Text] stdin_path, # type: Text stdout_path, # type: Text stderr_path, # type: Text diff --git a/cwltool/sandboxjs.py b/cwltool/sandboxjs.py index fa0851958..d76691954 100644 --- a/cwltool/sandboxjs.py +++ b/cwltool/sandboxjs.py @@ -57,7 +57,8 @@ def new_js_proc(force_docker_pull=False): # type: (bool) -> subprocess.Popen res = resource_stream(__name__, 'cwlNodeEngine.js') - nodecode = res.read() + nodecode = res.read().decode('utf-8') + required_node_version, docker = (False,)*2 nodejs = None trynodes = ("nodejs", "node") @@ -238,7 +239,7 @@ def get_error(error_queue): no_more_error.release() output_thread.join() error_thread.join() - if stdout_buf.getvalue().endswith("\n"): + if stdout_buf.getvalue().endswith("\n".encode()): rselect = [] no_more_output.release() no_more_error.release()