mirror of
https://github.com/RubyMetric/chsrc
synced 2025-09-10 10:20:28 +08:00
Add Rye
config via rawstr4c
This commit is contained in:
parent
6b883db9ac
commit
86e0165733
@ -4,7 +4,7 @@
|
|||||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||||
* Contributors : Nul None <nul@none.org>
|
* Contributors : Nul None <nul@none.org>
|
||||||
* Created On : <2024-12-06>
|
* Created On : <2024-12-06>
|
||||||
* Last Modified : <2025-07-21>
|
* Last Modified : <2025-07-22>
|
||||||
*
|
*
|
||||||
* 由于Rye已经有后继uv了,所以我们不把该管理器纳入Python group中
|
* 由于Rye已经有后继uv了,所以我们不把该管理器纳入Python group中
|
||||||
* ------------------------------------------------------------*/
|
* ------------------------------------------------------------*/
|
||||||
@ -38,22 +38,17 @@ pl_python_rye_getsrc (char *option)
|
|||||||
void
|
void
|
||||||
pl_python_rye_setsrc (char *option)
|
pl_python_rye_setsrc (char *option)
|
||||||
{
|
{
|
||||||
/* 并不在 Python group 中,所以不考虑 target group 情况 */
|
/* 并不在 Python group 中,所以不考虑 target group 情况,仅使用 Python group 提供的源 */
|
||||||
chsrc_yield_source_and_confirm (pl_python_group);
|
chsrc_yield_source_and_confirm (pl_python_group);
|
||||||
|
|
||||||
const char *file =
|
const char *content = RAWSTR_pl_python_rye_config;
|
||||||
R"(
|
|
||||||
[[sources]]
|
|
||||||
name = "@1@"
|
|
||||||
url = "@2@"
|
|
||||||
)";
|
|
||||||
|
|
||||||
file = xy_str_gsub (file, "@1@", source.mirror->abbr);
|
content = xy_str_gsub (content, "@1@", source.mirror->abbr);
|
||||||
file = xy_str_gsub (file, "@2@", source.url);
|
content = xy_str_gsub (content, "@2@", source.url);
|
||||||
|
|
||||||
char *rye_config = pl_python_find_rye_config ();
|
char *rye_config = pl_python_find_rye_config ();
|
||||||
chsrc_note2 (xy_strjoin (3, "请在配置文件 ", rye_config, " 中添加:"));
|
chsrc_note2 (xy_strjoin (3, "请在配置文件 ", rye_config, " 中添加:"));
|
||||||
println (file);
|
print (content);
|
||||||
|
|
||||||
chsrc_determine_chgtype (ChgType_Manual);
|
chsrc_determine_chgtype (ChgType_Manual);
|
||||||
chsrc_conclude (&source);
|
chsrc_conclude (&source);
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated by rawstr4c v0.2.1.0-2025/07/16
|
* Generated by rawstr4c v0.2.3-2025/07/22
|
||||||
*
|
|
||||||
* Date: 2025-07-16T23:55:50.053226+08:00
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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";
|
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
|
|||||||
|
|
||||||
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";
|
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";
|
||||||
|
|
||||||
|
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";
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
! | happy game <happygame1024@gmail.com>
|
! | happy game <happygame1024@gmail.com>
|
||||||
! Contributors : Nil Null <nil@null.org>
|
! Contributors : Nil Null <nil@null.org>
|
||||||
! Created On : <2025-07-14>
|
! Created On : <2025-07-14>
|
||||||
! Last Modified : <2025-07-14>
|
! Last Modified : <2025-07-22>
|
||||||
! ---------------------------------------------------------- -->
|
! ---------------------------------------------------------- -->
|
||||||
|
|
||||||
# rawstr4c input for Python
|
# rawstr4c input for Python
|
||||||
@ -16,8 +16,12 @@
|
|||||||
- translate = `:hex`
|
- translate = `:hex`
|
||||||
- keep-postfix = `false`
|
- keep-postfix = `false`
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## uv
|
||||||
|
|
||||||
### uv config source content
|
### uv config source content
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
@ -42,9 +46,22 @@ grep -A 2 'index' @f@ | sed -n 's/^url = "\(.*\)"/\1/p'
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Final uv cmd
|
### Final uv cmd
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
grep -q '^[[index]]$' @f@ && @ucmd@ || @acmd@
|
grep -q '^[[index]]$' @f@ && @ucmd@ || @acmd@
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Rye
|
||||||
|
|
||||||
|
- name = `rye_config`
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[[sources]]
|
||||||
|
name = "@1@"
|
||||||
|
url = "@2@"
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user