Skip to content

Commit aa41e13

Browse files
VersionSpecifier support
1 parent d74d105 commit aa41e13

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+784
-385
lines changed

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,13 @@ cython_debug/
169169

170170
# PyPI configuration file
171171
.pypirc
172-
173172
variantlib/example.json
174-
175173
variants.toml
176174

175+
# MacOS
177176
.DS_Store
177+
178+
# Artifacts
179+
!tests/artifacts/**/dist/
180+
!tests/artifacts/**/*.json
181+
!tests/artifacts/**/*.whl

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ test = [
5252
"virtualenv>=20.0.0,<21.0.0",
5353
"tomlkit>=0.13,<0.14",
5454
"trycast==1.2.1",
55-
"uv>=0.7,<0.8",
5655
]
5756

5857
[project.scripts]

tests/artifacts/test-package/Makefile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.PHONY: clean build
2+
3+
# ============================================================================ #
4+
# CLEAN COMMANDS
5+
# ============================================================================ #
6+
7+
clean: clean-build clean-pyc ## remove all build, test, coverage and Python artifacts
8+
9+
clean-build: ## remove build artifacts
10+
rm -fr build/
11+
rm -fr dist/
12+
rm -fr .eggs/
13+
find . -name '*.egg-info' -exec rm -fr {} +
14+
find . -name '*.egg' -exec rm -f {} +
15+
16+
clean-pyc: ## remove Python file artifacts
17+
find . -name '*.pyc' -exec rm -f {} +
18+
find . -name '*.pyo' -exec rm -f {} +
19+
find . -name '*~' -exec rm -f {} +
20+
find . -name '__pycache__' -exec rm -fr {} +
21+
22+
# ============================================================================ #
23+
# BUILD COMMANDS
24+
# ============================================================================ #
25+
26+
build: clean ## builds source and wheel package
27+
28+
flit build --format wheel
29+
30+
flit build --format wheel --null-variant
31+
32+
flit build --format wheel \
33+
-p "installable_plugin :: feat1 :: val1c"
34+
35+
flit build --format wheel \
36+
-p "installable_plugin :: feat2 :: val2b"
37+
38+
flit build --format wheel \
39+
-p "installable_plugin :: feat1 :: val1c" \
40+
-p "installable_plugin :: feat2 :: val2b"
41+
42+
variantlib generate-index-json -d dist/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/wheelnext/pep_xxx_wheel_variants/refs/heads/version_specifier_support/schema/variants.schema.json",
3+
"default-priorities": {
4+
"namespace": [
5+
"installable_plugin"
6+
]
7+
},
8+
"providers": {
9+
"installable_plugin": {
10+
"plugin-api": "test_plugin_package",
11+
"requires": [
12+
"test-plugin-package"
13+
]
14+
}
15+
},
16+
"variants": {
17+
"00000000": {},
18+
"5d8be4b9": {
19+
"installable_plugin": {
20+
"feat1": [
21+
"val1c"
22+
],
23+
"feat2": [
24+
"val2b"
25+
]
26+
}
27+
},
28+
"60567bd9": {
29+
"installable_plugin": {
30+
"feat1": [
31+
"val1c"
32+
]
33+
}
34+
},
35+
"fbe82642": {
36+
"installable_plugin": {
37+
"feat2": [
38+
"val2b"
39+
]
40+
}
41+
}
42+
}
43+
}
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
[build-system]
22
requires = ["flit_core >=3.11,<4"]
3-
build-backend = "flit_core.buildapi"
3+
build-backend = 'flit_core.buildapi'
44

55
[project]
66
name = "test-package"
77
version = "0"
88
description = "Installable package for testing"
99
requires-python = ">=3.9"
10+
11+
[variant.default-priorities]
12+
namespace = ["installable_plugin"]
13+
14+
[variant.providers.installable_plugin]
15+
requires = ["test-plugin-package"]
16+
plugin-api = "test_plugin_package"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.PHONY: clean build
2+
3+
# ============================================================================ #
4+
# CLEAN COMMANDS
5+
# ============================================================================ #
6+
7+
clean: clean-build clean-pyc ## remove all build, test, coverage and Python artifacts
8+
9+
clean-build: ## remove build artifacts
10+
rm -fr build/
11+
rm -fr dist/
12+
rm -fr .eggs/
13+
find . -name '*.egg-info' -exec rm -fr {} +
14+
find . -name '*.egg' -exec rm -f {} +
15+
16+
clean-pyc: ## remove Python file artifacts
17+
find . -name '*.pyc' -exec rm -f {} +
18+
find . -name '*.pyo' -exec rm -f {} +
19+
find . -name '*~' -exec rm -f {} +
20+
find . -name '__pycache__' -exec rm -fr {} +
21+
22+
# ============================================================================ #
23+
# BUILD COMMANDS
24+
# ============================================================================ #
25+
26+
build: clean ## builds source and wheel package
27+
28+
flit build --format wheel
29+
Binary file not shown.

tests/artifacts/test-plugin-package/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
requires = ["flit_core >=3.11,<4"]
3-
build-backend = "flit_core.buildapi"
3+
build-backend = 'flit_core.buildapi'
44

55
[project]
66
name = "test-plugin-package"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/wheelnext/pep_xxx_wheel_variants/refs/heads/version_specifier_support/schema/variants.schema.json",
3+
"default-priorities": {
4+
"namespace": [
5+
"fictional_hw",
6+
"fictional_tech"
7+
],
8+
"feature": {
9+
"fictional_hw": [
10+
"humor",
11+
"compute_accuracy"
12+
],
13+
"fictional_tech": [
14+
"quantum"
15+
]
16+
},
17+
"property": {
18+
"fictional_tech": {
19+
"technology": [
20+
"auto_chef"
21+
]
22+
}
23+
}
24+
},
25+
"providers": {
26+
"fictional_hw": {
27+
"requires": [
28+
"provider-fictional-hw == 1.0.0"
29+
],
30+
"enable-if": "python_version >= '3.12'",
31+
"plugin-api": "provider_fictional_hw.plugin:FictionalHWPlugin"
32+
},
33+
"fictional_tech": {
34+
"requires": [
35+
"provider-fictional-tech == 1.0.0"
36+
],
37+
"plugin-api": "provider_fictional_tech.plugin:FictionalTechPlugin"
38+
}
39+
},
40+
"variants": {
41+
"1d836653": {
42+
"fictional_hw": {
43+
"compute_capability": [
44+
">=4,<6"
45+
]
46+
}
47+
},
48+
"808c7f9d": {
49+
"fictional_tech": {
50+
"quantum": [
51+
"foam"
52+
],
53+
"risk_exposure": [
54+
"1000000000"
55+
],
56+
"technology": [
57+
"improb_drive"
58+
]
59+
}
60+
},
61+
"80fa16ff": {
62+
"fictional_hw": {
63+
"architecture": [
64+
"tars"
65+
],
66+
"compute_accuracy": [
67+
"8"
68+
],
69+
"compute_capability": [
70+
"8"
71+
],
72+
"humor": [
73+
"10"
74+
]
75+
}
76+
},
77+
"00000000": {},
78+
"3f7188c1": {
79+
"fictional_hw": {
80+
"architecture": [
81+
"hal9000"
82+
],
83+
"compute_accuracy": [
84+
"0"
85+
],
86+
"compute_capability": [
87+
"6"
88+
],
89+
"humor": [
90+
"2"
91+
]
92+
}
93+
},
94+
"a0d8855a": {
95+
"fictional_hw": {
96+
"compute_capability": [
97+
">=4,<8"
98+
]
99+
}
100+
},
101+
"7db6d39f": {
102+
"fictional_tech": {
103+
"quantum": [
104+
"superposition"
105+
],
106+
"risk_exposure": [
107+
"25"
108+
],
109+
"technology": [
110+
"auto_chef"
111+
]
112+
}
113+
},
114+
"092f6ea8": {
115+
"fictional_hw": {
116+
"compute_capability": [
117+
">=7"
118+
]
119+
}
120+
},
121+
"36028aca": {
122+
"fictional_hw": {
123+
"architecture": [
124+
"deepthought"
125+
],
126+
"compute_accuracy": [
127+
"10"
128+
],
129+
"compute_capability": [
130+
"10"
131+
],
132+
"humor": [
133+
"0"
134+
]
135+
},
136+
"fictional_tech": {
137+
"quantum": [
138+
"foam"
139+
]
140+
}
141+
},
142+
"03e04d5e": {
143+
"fictional_hw": {
144+
"architecture": [
145+
"mother"
146+
],
147+
"compute_capability": [
148+
"4"
149+
]
150+
}
151+
}
152+
}
153+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/wheelnext/pep_xxx_wheel_variants/refs/heads/version_specifier_support/schema/variants.schema.json",
3+
"default-priorities": {
4+
"namespace": [
5+
"fictional_tech",
6+
"fictional_hw"
7+
],
8+
"feature": {},
9+
"property": {}
10+
},
11+
"providers": {
12+
"fictional_hw": {
13+
"requires": [
14+
"provider-fictional-hw == 1.0.0"
15+
],
16+
"plugin-api": "provider_fictional_hw.plugin:FictionalHWPlugin"
17+
},
18+
"fictional_tech": {
19+
"requires": [
20+
"provider-fictional-tech == 1.0.0"
21+
],
22+
"plugin-api": "provider_fictional_tech.plugin:FictionalTechPlugin"
23+
}
24+
},
25+
"variants": {
26+
"00000000": {},
27+
"38ea48ce": {
28+
"fictional_hw": {
29+
"architecture": [
30+
"hal9000"
31+
]
32+
},
33+
"fictional_tech": {
34+
"quantum": [
35+
"foam"
36+
],
37+
"risk_exposure": [
38+
"1000000000"
39+
],
40+
"technology": [
41+
"improb_drive"
42+
]
43+
}
44+
},
45+
"3f7188c1": {
46+
"fictional_hw": {
47+
"architecture": [
48+
"hal9000"
49+
],
50+
"compute_accuracy": [
51+
"0"
52+
],
53+
"compute_capability": [
54+
"6"
55+
],
56+
"humor": [
57+
"2"
58+
]
59+
}
60+
},
61+
"03e04d5e": {
62+
"fictional_hw": {
63+
"architecture": [
64+
"mother"
65+
],
66+
"compute_capability": [
67+
"4"
68+
]
69+
}
70+
}
71+
}
72+
}

0 commit comments

Comments
 (0)