Skip to content

Commit a7af795

Browse files
authored
fix(build): update ga4gh.vrs/submodules + forbid extra attrs (#11)
* Update ga4gh.vrs + submodules * forbid extra attributes when additionalProperties is set to False
1 parent 3c7cb1c commit a7af795

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "submodules/cat_vrs"]
22
path = submodules/cat_vrs
33
url = https://github.com/ga4gh/cat-vrs
4-
branch = 1.0.0-ballot.2024-11
4+
branch = 1.0.0-snapshot.2025-02

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ keywords = [
3232
requires-python = ">=3.10"
3333
dynamic = ["version"]
3434
dependencies = [
35-
"ga4gh.vrs==2.0.0a13",
35+
"ga4gh.vrs==2.0.0a14",
3636
"pydantic==2.*",
3737
]
3838

src/ga4gh/cat_vrs/models.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
from typing import Literal
99

1010
from ga4gh.core.models import (
11+
BaseModelForbidExtra,
1112
ConceptMapping,
1213
Entity,
1314
MappableConcept,
1415
iriReference,
1516
)
1617
from ga4gh.vrs.models import Allele, CopyChange, Range, SequenceLocation, Variation
17-
from pydantic import BaseModel, Field, RootModel, field_validator
18+
from pydantic import Field, RootModel, field_validator
1819

1920

2021
class Relation(str, Enum):
@@ -27,7 +28,7 @@ class Relation(str, Enum):
2728
TRANSCRIBES_TO = "transcribes_to"
2829

2930

30-
class DefiningAlleleConstraint(BaseModel):
31+
class DefiningAlleleConstraint(BaseModelForbidExtra):
3132
"""The defining allele and its associated relationships that are congruent with
3233
member variants.
3334
"""
@@ -42,7 +43,7 @@ class DefiningAlleleConstraint(BaseModel):
4243
)
4344

4445

45-
class DefiningLocationConstraint(BaseModel):
46+
class DefiningLocationConstraint(BaseModelForbidExtra):
4647
"""The defining location and its associated relationships that are congruent with
4748
member locations.
4849
"""
@@ -61,7 +62,7 @@ class DefiningLocationConstraint(BaseModel):
6162
)
6263

6364

64-
class CopyCountConstraint(BaseModel):
65+
class CopyCountConstraint(BaseModelForbidExtra):
6566
"""The exact or range of copies that members of this categorical variant must
6667
satisfy.
6768
"""
@@ -75,7 +76,7 @@ class CopyCountConstraint(BaseModel):
7576
)
7677

7778

78-
class CopyChangeConstraint(BaseModel):
79+
class CopyChangeConstraint(BaseModelForbidExtra):
7980
"""A representation of copy number change"""
8081

8182
type: Literal["CopyChangeConstraint"] = Field(
@@ -114,7 +115,7 @@ class Constraint(RootModel):
114115
) = Field(..., discriminator="type")
115116

116117

117-
class CategoricalVariant(Entity):
118+
class CategoricalVariant(Entity, BaseModelForbidExtra):
118119
"""A representation of a categorically-defined domain for variation, in which
119120
individual Constraintual variation instances may be members of the domain.
120121
"""

submodules/cat_vrs

Submodule cat_vrs updated 75 files

tests/validation/test_cat_vrs_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def defining_loc_constr():
4646
MappableConcept(primaryCode=code(models.Relation.LIFTOVER_TO.value))
4747
],
4848
location="location.json#/1",
49-
matchCharacteristic=MappableConcept(label="test"),
49+
matchCharacteristic=MappableConcept(name="test"),
5050
)
5151

5252

@@ -119,7 +119,7 @@ def test_protein_sequence_consequence(defining_loc_constr, members):
119119
invalid_params["constraints"] = [
120120
models.Constraint(
121121
root=models.DefiningAlleleConstraint(
122-
relations=[MappableConcept(label=models.Relation.LIFTOVER_TO.value)],
122+
relations=[MappableConcept(name=models.Relation.LIFTOVER_TO.value)],
123123
allele=DUMMY_ALLELE_IRI,
124124
)
125125
)

0 commit comments

Comments
 (0)