Skip to content

Commit af8fa79

Browse files
[Plugin API] Allow Version Ranges (#99)
* VersionSpecifier support * Fixup * PR comments fixes * JSON/TOML Config using Constants * PR review comments Co-authored-by: Michał Górny <[email protected]> * PR Review comments * Unmake variant Fix * Update tests/utils.py Co-authored-by: Michał Górny <[email protected]> --------- Co-authored-by: Michał Górny <[email protected]>
1 parent d74d105 commit af8fa79

Some content is hidden

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

47 files changed

+1055
-536
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: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"$schema": "https://variants-schema.wheelnext.dev/",
3+
"default-priorities": {
4+
"namespace": [
5+
"installable_plugin"
6+
]
7+
},
8+
"providers": {
9+
"installable_plugin": {
10+
"requires": [
11+
"test-plugin-package"
12+
]
13+
}
14+
},
15+
"variants": {
16+
"00000000": {},
17+
"5d8be4b9": {
18+
"installable_plugin": {
19+
"feat1": [
20+
"val1c"
21+
],
22+
"feat2": [
23+
"val2b"
24+
]
25+
}
26+
},
27+
"60567bd9": {
28+
"installable_plugin": {
29+
"feat1": [
30+
"val1c"
31+
]
32+
}
33+
},
34+
"fbe82642": {
35+
"installable_plugin": {
36+
"feat2": [
37+
"val2b"
38+
]
39+
}
40+
}
41+
}
42+
}

tests/artifacts/test-package/pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@ 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"]

0 commit comments

Comments
 (0)