Skip to content

Commit 99c8f1a

Browse files
committed
Drop MS Windows support in favor of WSL 2
1 parent 420b69f commit 99c8f1a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+118
-749
lines changed

Makefile

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,19 @@ MODULE=cwltool
2525
# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
2626
# `[[` conditional expressions.
2727
PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) setup.py
28-
DEVPKGS=diff_cover black pylint coverage pep257 pydocstyle flake8 tox\
28+
DEVPKGS=diff_cover black pylint pep257 pydocstyle flake8 tox tox-pyenv \
2929
isort wheel autoflake flake8-bugbear pyupgrade bandit \
3030
-rtest-requirements.txt -rmypy_requirements.txt
3131
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
3232
python-flake8 python-mock shellcheck
3333

34-
VERSION=3.0.$(shell TZ=UTC git log --first-parent --max-count=1 \
34+
VERSION=3.1.$(shell TZ=UTC git log --first-parent --max-count=1 \
3535
--format=format:%cd --date=format-local:%Y%m%d%H%M%S)
3636
mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
3737
UNAME_S=$(shell uname -s)
3838

3939
## all : default task
40-
all:
41-
pip install -e .
40+
all: dev
4241

4342
## help : print this help message and exit
4443
help: Makefile
@@ -47,7 +46,7 @@ help: Makefile
4746
## install-dep : install most of the development dependencies via pip
4847
install-dep: install-dependencies
4948

50-
install-dependencies:
49+
install-dependencies: FORCE
5150
pip install --upgrade $(DEVPKGS)
5251
pip install -r requirements.txt
5352

@@ -112,7 +111,7 @@ pylint: $(PYSOURCES)
112111
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
113112
$^ -j0|| true
114113

115-
pylint_report.txt: ${PYSOURCES}
114+
pylint_report.txt: $(PYSOURCES)
116115
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
117116
$^ -j0> $@ || true
118117

@@ -143,26 +142,26 @@ diff-cover.html: coverage.xml
143142
diff-cover $^ --html-report $@
144143

145144
## test : run the ${MODULE} test suite
146-
test: $(pysources)
147-
python setup.py test --addopts "-n auto --dist=loadfile"
145+
test: $(PYSOURCES)
146+
python setup.py test
148147

149148
## testcov : run the ${MODULE} test suite and collect coverage
150-
testcov: $(pysources)
151-
python setup.py test --addopts "--cov cwltool -n auto --dist=loadfile"
149+
testcov: $(PYSOURCES)
150+
python setup.py test --addopts "--cov --cov-config=.coveragerc --cov-report= -n auto --dist=loadfile"
152151

153-
sloccount.sc: ${PYSOURCES} Makefile
152+
sloccount.sc: $(PYSOURCES) Makefile
154153
sloccount --duplicates --wide --details $^ > $@
155154

156155
## sloccount : count lines of code
157-
sloccount: ${PYSOURCES} Makefile
156+
sloccount: $(PYSOURCES) Makefile
158157
sloccount $^
159158

160159
list-author-emails:
161160
@echo 'name, E-Mail Address'
162161
@git log --format='%aN,%aE' | sort -u | grep -v 'root'
163162

164163
mypy3: mypy
165-
mypy: $(filter-out setup.py gittagger.py,${PYSOURCES})
164+
mypy: $(filter-out setup.py gittagger.py,$(PYSOURCES))
166165
if ! test -f $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))')/py.typed ; \
167166
then \
168167
rm -Rf typeshed/ruamel/yaml ; \
@@ -171,14 +170,14 @@ mypy: $(filter-out setup.py gittagger.py,${PYSOURCES})
171170
fi # if minimally required ruamel.yaml version is 0.15.99 or greater, than the above can be removed
172171
MYPYPATH=$$MYPYPATH:typeshed mypy $^
173172

174-
mypyc: ${PYSOURCES}
173+
mypyc: $(PYSOURCES)
175174
MYPYPATH=typeshed CWLTOOL_USE_MYPYC=1 pip install --verbose -e . && pytest --ignore cwltool/schemas --basetemp ./tmp
176175

177176
shellcheck: FORCE
178177
shellcheck build-cwl-docker.sh cwl-docker.sh release-test.sh conformance-test.sh \
179178
cwltool-in-docker.sh
180179

181-
pyupgrade: ${PYSOURCES}
180+
pyupgrade: $(PYSOURCES)
182181
pyupgrade --exit-zero-even-if-changed --py36-plus $^
183182

184183
release-test: FORCE
@@ -192,7 +191,7 @@ release: release-test
192191
twine upload testenv2/src/${MODULE}/dist/* && \
193192
git tag ${VERSION} && git push --tags
194193

195-
flake8: ${PYSOURCES}
194+
flake8: $(PYSOURCES)
196195
flake8 $^
197196

198197
FORCE:

README.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Common Workflow Language tool description reference implementation
33
==================================================================
44

5-
|Linux Status| |Debian Stable package| |Debian Testing package| |Windows Status| |Coverage Status| |Downloads|
5+
|Linux Status| |Debian Stable package| |Debian Testing package| |Coverage Status| |Downloads|
66

77
.. |Linux Status| image:: https://github.com/common-workflow-language/cwltool/actions/workflows/ci-tests.yml/badge.svg?branch=main
88
:target: https://github.com/common-workflow-language/cwltool/actions/workflows/ci-tests.yml
@@ -13,9 +13,6 @@ Common Workflow Language tool description reference implementation
1313
.. |Debian Testing package| image:: https://badges.debian.net/badges/debian/testing/cwltool/version.svg
1414
:target: https://packages.debian.org/testing/cwltool
1515

16-
.. |Windows Status| image:: https://img.shields.io/appveyor/ci/mr-c/cwltool/main.svg?label=Windows%20builds
17-
:target: https://ci.appveyor.com/project/mr-c/cwltool
18-
1916
.. |Coverage Status| image:: https://img.shields.io/codecov/c/github/common-workflow-language/cwltool.svg
2017
:target: https://codecov.io/gh/common-workflow-language/cwltool
2118

appveyor.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

cwltool/argparser.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from .process import Process, shortname
2222
from .resolver import ga4gh_tool_registries
2323
from .software_requirements import SOFTWARE_REQUIREMENTS_ENABLED
24-
from .utils import DEFAULT_TMP_PREFIX, onWindows
24+
from .utils import DEFAULT_TMP_PREFIX
2525

2626

2727
def arg_parser() -> argparse.ArgumentParser:
@@ -516,14 +516,13 @@ def arg_parser() -> argparse.ArgumentParser:
516516
"--enable-color",
517517
action="store_true",
518518
help="Enable logging color (default enabled)",
519-
default=not onWindows(),
519+
default=True,
520520
)
521521
colorgroup.add_argument(
522522
"--disable-color",
523523
action="store_false",
524524
dest="enable_color",
525525
help="Disable colored logging (default false)",
526-
default=onWindows(),
527526
)
528527

529528
parser.add_argument(

cwltool/builder.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@
3737
CWLObjectType,
3838
CWLOutputType,
3939
aslist,
40-
docker_windows_path_adjust,
4140
get_listing,
4241
normalizeFilesDirs,
43-
onWindows,
4442
visit_class,
4543
)
4644

@@ -551,14 +549,6 @@ def tostr(self, value: Union[MutableMapping[str, str], Any]) -> str:
551549
raise WorkflowException(
552550
'{} object missing "path": {}'.format(value["class"], value)
553551
)
554-
555-
# Path adjust for windows file path when passing to docker, docker accepts unix like path only
556-
(docker_req, docker_is_req) = self.get_requirement("DockerRequirement")
557-
if onWindows() and docker_req is not None:
558-
# docker_req is none only when there is no dockerRequirement
559-
# mentioned in hints and Requirement
560-
path = docker_windows_path_adjust(value["path"])
561-
return path
562552
return value["path"]
563553
else:
564554
return str(value)

cwltool/command_line_tool.py

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Implementation of CommandLineTool."""
22

33
import copy
4-
from enum import Enum
54
import hashlib
65
import json
76
import locale
@@ -12,6 +11,7 @@
1211
import threading
1312
import urllib
1413
import urllib.parse
14+
from enum import Enum
1515
from functools import cmp_to_key, partial
1616
from typing import (
1717
Any,
@@ -70,17 +70,13 @@
7070
adjustDirObjs,
7171
adjustFileObjs,
7272
aslist,
73-
convert_pathsep_to_unix,
74-
docker_windows_path_adjust,
7573
get_listing,
7674
normalizeFilesDirs,
77-
onWindows,
7875
random_outdir,
7976
shared_file_lock,
8077
trim_listing,
8178
upgrade_lock,
8279
visit_class,
83-
windows_default_container_id,
8480
)
8581

8682
if TYPE_CHECKING:
@@ -99,21 +95,6 @@ class PathCheckingMode(Enum):
9995
RELAXED = re.compile(r".*") # Accept anything
10096

10197

102-
DEFAULT_CONTAINER_MSG = """
103-
We are on Microsoft Windows and not all components of this CWL description have a
104-
container specified. This means that these steps will be executed in the default container,
105-
which is %s.
106-
107-
Note, this could affect portability if this CWL description relies on non-POSIX features
108-
or commands in this container. For best results add the following to your CWL
109-
description's hints section:
110-
111-
hints:
112-
DockerRequirement:
113-
dockerPull: %s
114-
"""
115-
116-
11798
class ExpressionJob:
11899
"""Job for ExpressionTools."""
119100

@@ -224,7 +205,7 @@ def revmap_file(
224205
if "location" in f and "path" not in f:
225206
location = cast(str, f["location"])
226207
if location.startswith("file://"):
227-
f["path"] = convert_pathsep_to_unix(uri_file_path(location))
208+
f["path"] = uri_file_path(location)
228209
else:
229210
return f
230211

@@ -324,9 +305,7 @@ def check_adjust(
324305
raise ValueError(
325306
"Do not call check_adjust using a builder that doesn't have a pathmapper."
326307
)
327-
file_o["path"] = path = docker_windows_path_adjust(
328-
builder.pathmapper.mapper(cast(str, file_o["location"]))[1]
329-
)
308+
file_o["path"] = path = builder.pathmapper.mapper(cast(str, file_o["location"]))[1]
330309
basename = cast(str, file_o.get("basename"))
331310
dn, bn = os.path.split(path)
332311
if file_o.get("dirname") != dn:
@@ -405,17 +384,6 @@ def make_job_runner(self, runtimeContext: RuntimeContext) -> Type[JobBase]:
405384
self.requirements.insert(0, dockerReq)
406385
dockerRequired = True
407386

408-
if (
409-
default_container == windows_default_container_id
410-
and runtimeContext.use_container
411-
and onWindows()
412-
):
413-
_logger.warning(
414-
DEFAULT_CONTAINER_MSG,
415-
windows_default_container_id,
416-
windows_default_container_id,
417-
)
418-
419387
if dockerReq is not None and runtimeContext.use_container:
420388
if mpiReq is not None:
421389
_logger.warning("MPIRequirement with containers is a beta feature")

cwltool/docker.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@
2020
from .job import ContainerCommandLineJob
2121
from .loghandler import _logger
2222
from .pathmapper import MapperEnt, PathMapper
23-
from .utils import (
24-
CWLObjectType,
25-
create_tmp_dir,
26-
docker_windows_path_adjust,
27-
ensure_writable,
28-
onWindows,
29-
)
23+
from .utils import CWLObjectType, create_tmp_dir, ensure_writable
3024

3125
_IMAGES = set() # type: Set[str]
3226
_IMAGES_LOCK = threading.Lock()
@@ -61,14 +55,10 @@ def _get_docker_machine_mounts() -> List[str]:
6155
def _check_docker_machine_path(path: Optional[str]) -> None:
6256
if path is None:
6357
return
64-
if onWindows():
65-
path = path.lower()
6658
mounts = _get_docker_machine_mounts()
6759

6860
found = False
6961
for mount in mounts:
70-
if onWindows():
71-
mount = mount.lower()
7262
if path.startswith(mount):
7363
found = True
7464
break
@@ -268,7 +258,7 @@ def add_file_or_directory_volume(
268258
) -> None:
269259
"""Append volume a file/dir mapping to the runtime option list."""
270260
if not volume.resolved.startswith("_:"):
271-
_check_docker_machine_path(docker_windows_path_adjust(volume.resolved))
261+
_check_docker_machine_path(volume.resolved)
272262
self.append_volume(runtime, volume.resolved, volume.target)
273263

274264
def add_writable_file_volume(
@@ -369,9 +359,7 @@ def create_runtime(
369359
runtime = [x.replace(":ro", "") for x in runtime]
370360
runtime = [x.replace(":rw", "") for x in runtime]
371361

372-
runtime.append(
373-
"--workdir=%s" % (docker_windows_path_adjust(self.builder.outdir))
374-
)
362+
runtime.append("--workdir=%s" % (self.builder.outdir))
375363
if not user_space_docker_cmd:
376364

377365
if not runtimeContext.no_read_only:
@@ -387,9 +375,7 @@ def create_runtime(
387375
runtime.append("--log-driver=none")
388376

389377
euid, egid = docker_vm_id()
390-
if not onWindows():
391-
# MS Windows does not have getuid() or geteuid() functions
392-
euid, egid = euid or os.geteuid(), egid or os.getgid()
378+
euid, egid = euid or os.geteuid(), egid or os.getgid()
393379

394380
if runtimeContext.no_match_user is False and (
395381
euid is not None and egid is not None

0 commit comments

Comments
 (0)