Skip to content

Commit 86e0165

Browse files
committed
Add Rye config via rawstr4c
1 parent 6b883db commit 86e0165

File tree

3 files changed

+28
-16
lines changed

3 files changed

+28
-16
lines changed

src/recipe/lang/Python/Rye.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* File Authors : Aoran Zeng <[email protected]>
55
* Contributors : Nul None <[email protected]>
66
* Created On : <2024-12-06>
7-
* Last Modified : <2025-07-21>
7+
* Last Modified : <2025-07-22>
88
*
99
* 由于Rye已经有后继uv了,所以我们不把该管理器纳入Python group中
1010
* ------------------------------------------------------------*/
@@ -38,22 +38,17 @@ pl_python_rye_getsrc (char *option)
3838
void
3939
pl_python_rye_setsrc (char *option)
4040
{
41-
/* 并不在 Python group 中,所以不考虑 target group 情况 */
41+
/* 并不在 Python group 中,所以不考虑 target group 情况,仅使用 Python group 提供的源 */
4242
chsrc_yield_source_and_confirm (pl_python_group);
4343

44-
const char *file =
45-
R"(
46-
[[sources]]
47-
name = "@1@"
48-
url = "@2@"
49-
)";
44+
const char *content = RAWSTR_pl_python_rye_config;
5045

51-
file = xy_str_gsub (file, "@1@", source.mirror->abbr);
52-
file = xy_str_gsub (file, "@2@", source.url);
46+
content = xy_str_gsub (content, "@1@", source.mirror->abbr);
47+
content = xy_str_gsub (content, "@2@", source.url);
5348

5449
char *rye_config = pl_python_find_rye_config ();
5550
chsrc_note2 (xy_strjoin (3, "请在配置文件 ", rye_config, " 中添加:"));
56-
println (file);
51+
print (content);
5752

5853
chsrc_determine_chgtype (ChgType_Manual);
5954
chsrc_conclude (&source);

src/recipe/lang/Python/rawstr4c.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#pragma once
22

33
/**
4-
* Generated by rawstr4c v0.2.1.0-2025/07/16
5-
*
6-
* Date: 2025-07-16T23:55:50.053226+08:00
4+
* Generated by rawstr4c v0.2.3-2025/07/22
75
*/
86

97
char RAWSTR_pl_python_uv_config_source_content[] = "\x5b\x5b\x69\x6e\x64\x65\x78\x5d\x5d\x0a\x75\x72\x6c\x20\x3d\x20\x22\x40\x75\x72\x6c\x22\x0a\x64\x65\x66\x61\x75\x6c\x74\x20\x3d\x20\x74\x72\x75\x65\x0a\x0a";
@@ -14,3 +12,5 @@ char RAWSTR_pl_python_set_uv_config[] = "\x40\x73\x65\x64\x40\x20\x27\x2f\x5e\x5
1412

1513
char RAWSTR_pl_python_final_uv_cmd[] = "\x67\x72\x65\x70\x20\x2d\x71\x20\x27\x5e\x5b\x5b\x69\x6e\x64\x65\x78\x5d\x5d\x24\x27\x20\x40\x66\x40\x20\x26\x26\x20\x40\x75\x63\x6d\x64\x40\x20\x7c\x7c\x20\x40\x61\x63\x6d\x64\x40\x0a";
1614

15+
char RAWSTR_pl_python_rye_config[] = "\x5b\x5b\x73\x6f\x75\x72\x63\x65\x73\x5d\x5d\x0a\x6e\x61\x6d\x65\x20\x3d\x20\x22\x40\x31\x40\x22\x0a\x75\x72\x6c\x20\x20\x3d\x20\x22\x40\x32\x40\x22\x0a";
16+

src/recipe/lang/Python/rawstr4c.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
! | happy game <[email protected]>
77
! Contributors : Nil Null <[email protected]>
88
! Created On : <2025-07-14>
9-
! Last Modified : <2025-07-14>
9+
! Last Modified : <2025-07-22>
1010
! ---------------------------------------------------------- -->
1111

1212
# rawstr4c input for Python
@@ -16,8 +16,12 @@
1616
- translate = `:hex`
1717
- keep-postfix = `false`
1818

19+
<br>
1920

2021

22+
23+
## uv
24+
2125
### uv config source content
2226

2327
```toml
@@ -42,9 +46,22 @@ grep -A 2 'index' @f@ | sed -n 's/^url = "\(.*\)"/\1/p'
4246
```
4347

4448

45-
4649
### Final uv cmd
4750

4851
```sh
4952
grep -q '^[[index]]$' @f@ && @ucmd@ || @acmd@
5053
```
54+
55+
<br>
56+
57+
58+
59+
## Rye
60+
61+
- name = `rye_config`
62+
63+
```toml
64+
[[sources]]
65+
name = "@1@"
66+
url = "@2@"
67+
```

0 commit comments

Comments
 (0)