|
33 | 33 |
|
34 | 34 | import argcomplete |
35 | 35 | import coloredlogs |
36 | | -import pkg_resources # part of setuptools |
| 36 | +import ruamel.yaml |
| 37 | +from importlib_resources import files |
| 38 | +from ruamel.yaml.comments import CommentedMap, CommentedSeq |
| 39 | +from ruamel.yaml.main import YAML |
37 | 40 | from schema_salad.exceptions import ValidationException |
38 | 41 | from schema_salad.ref_resolver import Loader, file_uri, uri_file_path |
39 | 42 | from schema_salad.sourceline import cmap, strip_dup_lineno |
|
45 | 48 | yaml_no_ts, |
46 | 49 | ) |
47 | 50 |
|
48 | | -import ruamel.yaml |
49 | | -from ruamel.yaml.comments import CommentedMap, CommentedSeq |
50 | | -from ruamel.yaml.main import YAML |
51 | | - |
52 | 51 | from . import CWL_CONTENT_TYPES, workflow |
53 | 52 | from .argparser import arg_parser, generate_parser, get_default_args |
54 | 53 | from .context import LoadingContext, RuntimeContext, getdefault |
@@ -646,12 +645,12 @@ def setup_schema( |
646 | 645 | if custom_schema_callback is not None: |
647 | 646 | custom_schema_callback() |
648 | 647 | elif args.enable_ext: |
649 | | - with pkg_resources.resource_stream(__name__, "extensions.yml") as res: |
650 | | - ext10 = res.read().decode("utf-8") |
651 | | - with pkg_resources.resource_stream(__name__, "extensions-v1.1.yml") as res: |
652 | | - ext11 = res.read().decode("utf-8") |
653 | | - with pkg_resources.resource_stream(__name__, "extensions-v1.2.yml") as res: |
654 | | - ext12 = res.read().decode("utf-8") |
| 648 | + with files("cwltool").joinpath("extensions.yml") as res: |
| 649 | + ext10 = res.read_text("utf-8") |
| 650 | + with files("cwltool").joinpath("extensions-v1.1.yml") as res: |
| 651 | + ext11 = res.read_text("utf-8") |
| 652 | + with files("cwltool").joinpath("extensions-v1.2.yml") as res: |
| 653 | + ext12 = res.read_text("utf-8") |
655 | 654 | use_custom_schema("v1.0", "http://commonwl.org/cwltool", ext10) |
656 | 655 | use_custom_schema("v1.1", "http://commonwl.org/cwltool", ext11) |
657 | 656 | use_custom_schema("v1.2", "http://commonwl.org/cwltool", ext12) |
|
0 commit comments