Skip to content

Commit

Permalink
more ci debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
wtbarnes committed Jan 5, 2024
1 parent 45ea5db commit 859b270
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
13 changes: 6 additions & 7 deletions hissw/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ def run(self, script, args=None, save_vars=None, raise_exceptions=True):
# Expose the ssw_home variable in all scripts by default
args.update({'ssw_home': self.ssw_home})
with tempfile.TemporaryDirectory() as tmpdir:
tmpdir_path = pathlib.Path(tmpdir)
tmpdir_path = pathlib.Path(tmpdir) / 'hissw_files'
tmpdir_path.mkdir(parents=True, exist_ok=True)
date_string = datetime.datetime.now().strftime('%Y%m%d-%H%M%S')
# Construct temporary filenames
save_filename = tmpdir_path / f'idl_vars_{date_string}.sav'
Expand Down Expand Up @@ -218,19 +219,17 @@ def _run_shell_script(self, path, raise_exceptions):
path.name if on_windows else f'./{path.name}',
cwd=path.parent,
shell=True,
# capture_output=True,
# text=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
capture_output=True,
text=True,
)
self._check_for_errors(cmd_output, raise_exceptions=raise_exceptions)

def _check_for_errors(self, output, raise_exceptions=True):
"""
Check IDL output to try and decide if an error has occurred
"""
stdout = f"{output.stdout.decode('utf-8')}"
stderr = f"{output.stderr.decode('utf-8')}"
stdout = output.stdout
stderr = output.stderr
# NOTE: For some reason, not only errors are output to stderr so we
# have to check it for certain keywords to see if an error occurred
if raise_exceptions:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ extend-ignore = [
"PT007", # Parametrize should be lists of tuples # TODO! fix
"PT011", # Too broad exception assert # TODO! fix
"PT023", # Always use () on pytest decorators
"UP022",
]

[tool.ruff.per-file-ignores]
Expand Down

0 comments on commit 859b270

Please sign in to comment.