Skip to content

Commit

Permalink
remove usage of ancient shellescape backport of Stdlib's shlex
Browse files Browse the repository at this point in the history
  • Loading branch information
a-detiste committed Sep 15, 2024
1 parent 4bb5329 commit a34d4ad
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 16 deletions.
4 changes: 2 additions & 2 deletions cwltool/command_line_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import logging
import os
import re
import shlex
import shutil
import threading
import urllib
Expand All @@ -31,7 +32,6 @@
cast,
)

import shellescape
from mypy_extensions import mypyc_attr
from ruamel.yaml.comments import CommentedMap, CommentedSeq
from schema_salad.avro.schema import Schema
Expand Down Expand Up @@ -1164,7 +1164,7 @@ def register_reader(f: CWLObjectType) -> None:
for b in builder.bindings:
arg = builder.generate_arg(b)
if b.get("shellQuote", True):
arg = [shellescape.quote(a) for a in aslist(arg)]
arg = [shlex.quote(a) for a in aslist(arg)]
cmd.extend(aslist(arg))
j.command_line = ["/bin/sh", "-c", " ".join(cmd)]
else:
Expand Down
4 changes: 2 additions & 2 deletions cwltool/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import math
import os
import re
import shlex
import shutil
import signal
import stat
Expand Down Expand Up @@ -35,7 +36,6 @@
)

import psutil
import shellescape
from prov.model import PROV
from schema_salad.sourceline import SourceLine
from schema_salad.utils import json_dump, json_dumps
Expand Down Expand Up @@ -271,7 +271,7 @@ def _execute(
self.outdir,
" \\\n ".join(
[
shellescape.quote(str(arg)) if shouldquote(str(arg)) else str(arg)
shlex.quote(str(arg)) if shouldquote(str(arg)) else str(arg)
for arg in (runtime + self.command_line)
]
),
Expand Down
5 changes: 0 additions & 5 deletions mypy-stubs/shellescape/__init__.pyi

This file was deleted.

5 changes: 0 additions & 5 deletions mypy-stubs/shellescape/main.pyi

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
requests>=2.6.1
ruamel.yaml>=0.16.0,<0.19
rdflib>=4.2.2,<7.1
shellescape>=3.4.1,<3.9
schema-salad>=8.7,<9
prov==1.5.1
mypy-extensions
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
# https://github.com/ionrock/cachecontrol/issues/137
"ruamel.yaml >= 0.16, < 0.19",
"rdflib >= 4.2.2, < 7.1.0",
"shellescape >= 3.4.1, < 3.9",
"schema-salad >= 8.7, < 9",
"prov == 1.5.1",
"mypy-extensions",
Expand Down

0 comments on commit a34d4ad

Please sign in to comment.