Skip to content

Commit 016e95f

Browse files
Regen parsers without mypyc decorators
1 parent 7edbaf2 commit 016e95f

5 files changed

Lines changed: 6 additions & 54 deletions

File tree

cwl_utils/parser/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,9 @@ def load_document_by_uri(
285285
base_uri = path.resolve().parent.as_uri()
286286
id_ = path.resolve().name.split("#")[1] if "#" in path.resolve().name else None
287287

288-
if loadingOptions is None:
289-
loadingOptions = LoadingOptions(fileuri=real_uri, baseuri=base_uri)
288+
loadingOptions = LoadingOptions(
289+
fileuri=real_uri, baseuri=base_uri, copyfrom=loadingOptions
290+
)
290291

291292
return load_document_by_string(
292293
loadingOptions.fetcher.fetch_text(real_uri),

cwl_utils/parser/cwl_v1_0.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import sys
99
import uuid as _uuid__
1010
from collections.abc import Collection
11-
from mypy_extensions import trait
1211
from typing import ClassVar
1312

1413
from schema_salad.runtime import (
@@ -38,7 +37,7 @@
3837
from schema_salad.exceptions import ValidationException, SchemaSaladException
3938
from schema_salad.runtime import LoadingOptions, convert_typing, extract_type, Saveable
4039
from schema_salad.sourceline import SourceLine, add_lc_filename
41-
from schema_salad.utils import yaml_no_ts
40+
from schema_salad.utils import yaml_no_ts # requires schema-salad v8.2+
4241

4342
S = TypeVar("S", bound=Saveable)
4443

@@ -2651,12 +2650,10 @@ def save(
26512650
)
26522651

26532652

2654-
@trait
26552653
class SchemaBase(Saveable):
26562654
pass
26572655

26582656

2659-
@trait
26602657
class Parameter(SchemaBase):
26612658
"""
26622659
Define an input or output parameter to a process.
@@ -2666,22 +2663,18 @@ class Parameter(SchemaBase):
26662663
pass
26672664

26682665

2669-
@trait
26702666
class InputBinding(Saveable):
26712667
pass
26722668

26732669

2674-
@trait
26752670
class OutputBinding(Saveable):
26762671
pass
26772672

26782673

2679-
@trait
26802674
class InputSchema(SchemaBase):
26812675
pass
26822676

26832677

2684-
@trait
26852678
class OutputSchema(SchemaBase):
26862679
pass
26872680

@@ -6525,7 +6518,6 @@ def save(
65256518
)
65266519

65276520

6528-
@trait
65296521
class ProcessRequirement(Saveable):
65306522
"""
65316523
A process requirement declares a prerequisite that may or must be fulfilled before executing a process. See ```Process.hints`` <#process>`__ and ```Process.requirements`` <#process>`__.
@@ -6537,7 +6529,6 @@ class ProcessRequirement(Saveable):
65376529
pass
65386530

65396531

6540-
@trait
65416532
class Process(Saveable):
65426533
"""
65436534
The base executable type in CWL is the ``Process`` object defined by the document. Note that the ``Process`` object is abstract and cannot be directly executed.
@@ -17188,7 +17179,6 @@ def save(
1718817179
)
1718917180

1719017181

17191-
@trait
1719217182
class Sink(Saveable):
1719317183
pass
1719417184

cwl_utils/parser/cwl_v1_1.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import sys
99
import uuid as _uuid__
1010
from collections.abc import Collection
11-
from mypy_extensions import trait
1211
from typing import ClassVar
1312

1413
from schema_salad.runtime import (
@@ -38,7 +37,7 @@
3837
from schema_salad.exceptions import ValidationException, SchemaSaladException
3938
from schema_salad.runtime import LoadingOptions, convert_typing, extract_type, Saveable
4039
from schema_salad.sourceline import SourceLine, add_lc_filename
41-
from schema_salad.utils import yaml_no_ts
40+
from schema_salad.utils import yaml_no_ts # requires schema-salad v8.2+
4241

4342
S = TypeVar("S", bound=Saveable)
4443

@@ -2651,42 +2650,34 @@ def save(
26512650
)
26522651

26532652

2654-
@trait
26552653
class Labeled(Saveable):
26562654
pass
26572655

26582656

2659-
@trait
26602657
class Identified(Saveable):
26612658
pass
26622659

26632660

2664-
@trait
26652661
class IdentifierRequired(Identified):
26662662
pass
26672663

26682664

2669-
@trait
26702665
class LoadContents(Saveable):
26712666
pass
26722667

26732668

2674-
@trait
26752669
class FieldBase(Labeled):
26762670
pass
26772671

26782672

2679-
@trait
26802673
class InputFormat(Saveable):
26812674
pass
26822675

26832676

2684-
@trait
26852677
class OutputFormat(Saveable):
26862678
pass
26872679

26882680

2689-
@trait
26902681
class Parameter(FieldBase, schema_salad.metaschema.Documented, IdentifierRequired):
26912682
"""
26922683
Define an input or output parameter to a process.
@@ -2843,17 +2834,14 @@ def save(
28432834
attrs: ClassVar[Collection[str]] = frozenset(["loadContents"])
28442835

28452836

2846-
@trait
28472837
class IOSchema(Labeled, schema_salad.metaschema.Documented):
28482838
pass
28492839

28502840

2851-
@trait
28522841
class InputSchema(IOSchema):
28532842
pass
28542843

28552844

2856-
@trait
28572845
class OutputSchema(IOSchema):
28582846
pass
28592847

@@ -6276,17 +6264,14 @@ def save(
62766264
)
62776265

62786266

6279-
@trait
62806267
class InputParameter(Parameter, InputFormat, LoadContents):
62816268
pass
62826269

62836270

6284-
@trait
62856271
class OutputParameter(Parameter, OutputFormat):
62866272
pass
62876273

62886274

6289-
@trait
62906275
class ProcessRequirement(Saveable):
62916276
"""
62926277
A process requirement declares a prerequisite that may or must be fulfilled before executing a process. See ```Process.hints`` <#process>`__ and ```Process.requirements`` <#process>`__.
@@ -6298,7 +6283,6 @@ class ProcessRequirement(Saveable):
62986283
pass
62996284

63006285

6301-
@trait
63026286
class Process(Identified, Labeled, schema_salad.metaschema.Documented):
63036287
"""
63046288
The base executable type in CWL is the ``Process`` object defined by the document. Note that the ``Process`` object is abstract and cannot be directly executed.
@@ -6491,7 +6475,6 @@ def save(
64916475
attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"])
64926476

64936477

6494-
@trait
64956478
class CommandInputSchema(Saveable):
64966479
pass
64976480

@@ -8129,7 +8112,6 @@ def save(
81298112
)
81308113

81318114

8132-
@trait
81338115
class CommandLineBindable(Saveable):
81348116
pass
81358117

@@ -19885,7 +19867,6 @@ def save(
1988519867
)
1988619868

1988719869

19888-
@trait
1988919870
class Sink(Saveable):
1989019871
pass
1989119872

cwl_utils/parser/cwl_v1_2.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import sys
99
import uuid as _uuid__
1010
from collections.abc import Collection
11-
from mypy_extensions import trait
1211
from typing import ClassVar
1312

1413
from schema_salad.runtime import (
@@ -38,7 +37,7 @@
3837
from schema_salad.exceptions import ValidationException, SchemaSaladException
3938
from schema_salad.runtime import LoadingOptions, convert_typing, extract_type, Saveable
4039
from schema_salad.sourceline import SourceLine, add_lc_filename
41-
from schema_salad.utils import yaml_no_ts
40+
from schema_salad.utils import yaml_no_ts # requires schema-salad v8.2+
4241

4342
S = TypeVar("S", bound=Saveable)
4443

@@ -2651,42 +2650,34 @@ def save(
26512650
)
26522651

26532652

2654-
@trait
26552653
class Labeled(Saveable):
26562654
pass
26572655

26582656

2659-
@trait
26602657
class Identified(Saveable):
26612658
pass
26622659

26632660

2664-
@trait
26652661
class IdentifierRequired(Identified):
26662662
pass
26672663

26682664

2669-
@trait
26702665
class LoadContents(Saveable):
26712666
pass
26722667

26732668

2674-
@trait
26752669
class FieldBase(Labeled):
26762670
pass
26772671

26782672

2679-
@trait
26802673
class InputFormat(Saveable):
26812674
pass
26822675

26832676

2684-
@trait
26852677
class OutputFormat(Saveable):
26862678
pass
26872679

26882680

2689-
@trait
26902681
class Parameter(FieldBase, schema_salad.metaschema.Documented, IdentifierRequired):
26912682
"""
26922683
Define an input or output parameter to a process.
@@ -2843,17 +2834,14 @@ def save(
28432834
attrs: ClassVar[Collection[str]] = frozenset(["loadContents"])
28442835

28452836

2846-
@trait
28472837
class IOSchema(Labeled, schema_salad.metaschema.Documented):
28482838
pass
28492839

28502840

2851-
@trait
28522841
class InputSchema(IOSchema):
28532842
pass
28542843

28552844

2856-
@trait
28572845
class OutputSchema(IOSchema):
28582846
pass
28592847

@@ -6276,17 +6264,14 @@ def save(
62766264
)
62776265

62786266

6279-
@trait
62806267
class InputParameter(Parameter, InputFormat, LoadContents):
62816268
pass
62826269

62836270

6284-
@trait
62856271
class OutputParameter(Parameter, OutputFormat):
62866272
pass
62876273

62886274

6289-
@trait
62906275
class ProcessRequirement(Saveable):
62916276
"""
62926277
A process requirement declares a prerequisite that may or must be fulfilled before executing a process. See ```Process.hints`` <#process>`__ and ```Process.requirements`` <#process>`__.
@@ -6298,7 +6283,6 @@ class ProcessRequirement(Saveable):
62986283
pass
62996284

63006285

6301-
@trait
63026286
class Process(Identified, Labeled, schema_salad.metaschema.Documented):
63036287
"""
63046288
The base executable type in CWL is the ``Process`` object defined by the document. Note that the ``Process`` object is abstract and cannot be directly executed.
@@ -6491,7 +6475,6 @@ def save(
64916475
attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"])
64926476

64936477

6494-
@trait
64956478
class CommandInputSchema(Saveable):
64966479
pass
64976480

@@ -8145,7 +8128,6 @@ def save(
81458128
)
81468129

81478130

8148-
@trait
81498131
class CommandLineBindable(Saveable):
81508132
pass
81518133

@@ -20076,7 +20058,6 @@ def save(
2007620058
)
2007720059

2007820060

20079-
@trait
2008020061
class Sink(Saveable):
2008120062
pass
2008220063

whatever.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)