30
30
from variantlib .constants import VALIDATION_FEATURE_NAME_REGEX
31
31
from variantlib .constants import VALIDATION_NAMESPACE_REGEX
32
32
from variantlib .constants import VALIDATION_VALUE_REGEX
33
- from variantlib .constants import VARIANT_METADATA_DEFAULT_PRIO_KEY
34
- from variantlib .constants import VARIANT_METADATA_NAMESPACE_KEY
35
- from variantlib .constants import VARIANT_METADATA_PROVIDER_DATA_KEY
36
- from variantlib .constants import VARIANT_METADATA_PROVIDER_PLUGIN_API_KEY
37
- from variantlib .constants import VARIANT_METADATA_PROVIDER_REQUIRES_KEY
33
+ from variantlib .constants import VARIANT_INFO_DEFAULT_PRIO_KEY
34
+ from variantlib .constants import VARIANT_INFO_NAMESPACE_KEY
35
+ from variantlib .constants import VARIANT_INFO_PROVIDER_DATA_KEY
36
+ from variantlib .constants import VARIANT_INFO_PROVIDER_PLUGIN_API_KEY
37
+ from variantlib .constants import VARIANT_INFO_PROVIDER_REQUIRES_KEY
38
38
from variantlib .constants import VARIANTS_JSON_SCHEMA_URL
39
39
from variantlib .constants import VARIANTS_JSON_VARIANT_DATA_KEY
40
40
from variantlib .constants import VariantsJsonDict
41
41
from variantlib .models import provider as pconfig
42
42
from variantlib .models import variant as vconfig
43
43
from variantlib .models .configuration import VariantConfiguration as VConfigurationModel
44
- from variantlib .models .metadata import ProviderInfo
45
- from variantlib .models .metadata import VariantMetadata
44
+ from variantlib .models .variant_info import ProviderInfo
45
+ from variantlib .models .variant_info import VariantInfo
46
46
from variantlib .pyproject_toml import VariantPyProjectToml
47
47
from variantlib .variants_json import VariantsJson
48
48
@@ -91,13 +91,13 @@ def test_get_variant_hashes_by_priority_roundtrip(
91
91
92
92
variants_json = {
93
93
"$schema" : VARIANTS_JSON_SCHEMA_URL ,
94
- VARIANT_METADATA_DEFAULT_PRIO_KEY : {
95
- VARIANT_METADATA_NAMESPACE_KEY : namespace_priorities ,
94
+ VARIANT_INFO_DEFAULT_PRIO_KEY : {
95
+ VARIANT_INFO_NAMESPACE_KEY : namespace_priorities ,
96
96
},
97
- VARIANT_METADATA_PROVIDER_DATA_KEY : {
97
+ VARIANT_INFO_PROVIDER_DATA_KEY : {
98
98
namespace : {
99
- VARIANT_METADATA_PROVIDER_PLUGIN_API_KEY : plugin_api ,
100
- VARIANT_METADATA_PROVIDER_REQUIRES_KEY : [],
99
+ VARIANT_INFO_PROVIDER_PLUGIN_API_KEY : plugin_api ,
100
+ VARIANT_INFO_PROVIDER_REQUIRES_KEY : [],
101
101
}
102
102
for namespace , plugin_api in plugin_apis .items ()
103
103
},
@@ -262,7 +262,7 @@ def test_validation_result_properties() -> None:
262
262
263
263
264
264
def test_validate_variant (mocked_plugin_apis : list [str ]) -> None :
265
- vmeta = VariantMetadata (
265
+ variant_info = VariantInfo (
266
266
namespace_priorities = [
267
267
"test_namespace" ,
268
268
"second_namespace" ,
@@ -296,7 +296,7 @@ def test_validate_variant(mocked_plugin_apis: list[str]) -> None:
296
296
VariantProperty ("private" , "build_type" , "debug" ),
297
297
]
298
298
),
299
- metadata = vmeta ,
299
+ variant_info = variant_info ,
300
300
use_auto_install = False ,
301
301
)
302
302
@@ -392,7 +392,7 @@ def test_make_variant_dist_info(
392
392
VariantProperty ("ns2" , "f1" , "p1" ),
393
393
]
394
394
),
395
- variant_metadata = VariantPyProjectToml (pyproject_toml ) # type: ignore[arg-type]
395
+ variant_info = VariantPyProjectToml (pyproject_toml ) # type: ignore[arg-type]
396
396
if pyproject_toml is not None
397
397
else None ,
398
398
)
@@ -402,8 +402,8 @@ def test_make_variant_dist_info(
402
402
403
403
404
404
@pytest .fixture
405
- def common_metadata () -> VariantMetadata :
406
- return VariantMetadata (
405
+ def common_variant_info () -> VariantInfo :
406
+ return VariantInfo (
407
407
namespace_priorities = ["test_namespace" , "second_namespace" ],
408
408
providers = {
409
409
"test_namespace" : ProviderInfo (
@@ -440,21 +440,21 @@ def common_metadata() -> VariantMetadata:
440
440
],
441
441
)
442
442
def test_check_variant_supported_dist (
443
- common_metadata : VariantMetadata , vdesc : VariantDescription , expected : bool
443
+ common_variant_info : VariantInfo , vdesc : VariantDescription , expected : bool
444
444
) -> None :
445
- variant_json = VariantsJson (common_metadata )
445
+ variant_json = VariantsJson (common_variant_info )
446
446
variant_json .variants [vdesc .hexdigest ] = vdesc
447
447
assert (
448
448
check_variant_supported (
449
- metadata = variant_json , use_auto_install = False , venv_path = None
449
+ variant_info = variant_json , use_auto_install = False , venv_path = None
450
450
)
451
451
is expected
452
452
)
453
453
454
454
455
455
def test_check_variant_supported_generic () -> None :
456
- # metadata should only be used to load plugins
457
- vmeta = VariantMetadata (
456
+ # variant_info should only be used to load plugins
457
+ variant_info = VariantInfo (
458
458
namespace_priorities = ["test_namespace" , "second_namespace" ],
459
459
providers = {
460
460
"test_namespace" : ProviderInfo (
@@ -469,7 +469,7 @@ def test_check_variant_supported_generic() -> None:
469
469
# test the null variant
470
470
assert check_variant_supported (
471
471
vdesc = VariantDescription (),
472
- metadata = vmeta ,
472
+ variant_info = variant_info ,
473
473
use_auto_install = False ,
474
474
venv_path = None ,
475
475
)
@@ -482,15 +482,15 @@ def test_check_variant_supported_generic() -> None:
482
482
VariantProperty ("second_namespace" , "name3" , "val3a" ),
483
483
]
484
484
),
485
- metadata = vmeta ,
485
+ variant_info = variant_info ,
486
486
use_auto_install = False ,
487
487
venv_path = None ,
488
488
)
489
489
490
490
# test an usupported variant
491
491
assert not check_variant_supported (
492
492
vdesc = VariantDescription ([VariantProperty ("test_namespace" , "name1" , "val1c" )]),
493
- metadata = vmeta ,
493
+ variant_info = variant_info ,
494
494
use_auto_install = False ,
495
495
venv_path = None ,
496
496
)
0 commit comments