Converters
version_set_from_specifier = specifier_to_version_set
module-attribute
An alias of specifier_to_version_set
.
specifier_from_version_set = version_set_to_specifier
module-attribute
An alias of version_set_to_specifier
.
simplify(specifier: Specifier) -> Specifier
Simplifies a Specifier
.
The simplification is accomplished through converting to the version set and back.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
specifier |
Specifier
|
The version specifier to simplify. |
required |
Returns:
Type | Description |
---|---|
Specifier
|
The simplified specifier. |
Source code in versions/converters.py
41 42 43 44 45 46 47 48 49 50 51 52 |
|
specifier_to_version_set(specifier: Specifier) -> VersionSet
Converts a Specifier
to VersionSet
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
specifier |
Specifier
|
The version specifier to convert. |
required |
Returns:
Type | Description |
---|---|
VersionSet
|
The converted version set. |
Source code in versions/converters.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|
version_set_to_specifier(version_set: VersionSet) -> Specifier
Converts a VersionSet
to Specifier
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
version_set |
VersionSet
|
The version set to convert. |
required |
Returns:
Type | Description |
---|---|
Specifier
|
The converted version specifier. |
Source code in versions/converters.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|