Skip to content

Commit fc8fc11

Browse files
committed
fix(use): Fix provider configuration
1 parent c3906fc commit fc8fc11

7 files changed

Lines changed: 66 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.0.1] - 2025-05-20
11+
12+
### Fixed
13+
14+
- Use provider configuration had `v` prefix in the version number
15+
- Use provider configuration was missing a quote at the beginning of source
16+
- Use provider configuration has a proper format (aligned `=`)
17+
1018
## [1.0.0] - 2025-05-19
1119

1220
### Added

tests/__snapshots__/test_snapshots/test_toggle_fullscreen.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/__snapshots__/test_snapshots/test_use.svg

Lines changed: 5 additions & 5 deletions
Loading

tests/__snapshots__/test_snapshots/test_welcome.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/test_provider.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import json
2+
3+
from tofuref.data.providers import Provider
4+
5+
PROVIDER_JSON = json.loads("""{
6+
"addr": {
7+
"display": "0username/rabbitmq",
8+
"namespace": "0username",
9+
"name": "rabbitmq"
10+
},
11+
"link": "",
12+
"canonical_addr": null,
13+
"reverse_aliases": [],
14+
"description": "",
15+
"popularity": 0,
16+
"fork_count": 0,
17+
"fork_of": {
18+
"display": "",
19+
"namespace": "",
20+
"name": ""
21+
},
22+
"upstream_popularity": 0,
23+
"upstream_fork_count": 0,
24+
"versions": [
25+
{
26+
"id": "v1.9.1",
27+
"published": "2023-06-05T15:03:47Z"
28+
},
29+
{
30+
"id": "v1.8.1",
31+
"published": "2022-05-06T00:10:58Z"
32+
},
33+
{
34+
"id": "v1.7.0",
35+
"published": "2022-04-27T20:42:44Z"
36+
}
37+
],
38+
"is_blocked": false
39+
}
40+
""")
41+
42+
43+
def test_provider_use():
44+
provider = Provider.from_json(PROVIDER_JSON)
45+
assert provider.use_configuration == """ rabbitmq = {
46+
source = "0username/rabbitmq"
47+
version = "1.9.1"
48+
}"""

tofuref/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.0.0"
1+
__version__ = "1.0.1"

tofuref/data/providers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ def _endpoint(self) -> str:
6969
@property
7070
def use_configuration(self) -> str:
7171
return f""" {self.name} = {{
72-
source = {self.organization}/{self.name}"
73-
version = "{self.active_version}"
72+
source = "{self.organization}/{self.name}"
73+
version = "{self.active_version.lstrip('v')}"
7474
}}"""
7575

7676
async def overview(self) -> str:

0 commit comments

Comments
 (0)