Skip to content

Commit 8342bed

Browse files
committed
测试pygit
1 parent b715687 commit 8342bed

13 files changed

Lines changed: 597 additions & 500 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ jobs:
260260
261261
# 准备离线运行所需的 .install 资源
262262
Invoke-WebRequest -Uri "https://github.com/OneDragon-Anything/OneDragon-Env/releases/download/ZenlessZoneZero-OneDragon/uv-x86_64-pc-windows-msvc.zip" -OutFile "$envDir/uv-x86_64-pc-windows-msvc.zip"
263-
Invoke-WebRequest -Uri "https://github.com/OneDragon-Anything/OneDragon-Env/releases/download/ZenlessZoneZero-OneDragon/MinGit.zip" -OutFile "$envDir/MinGit.zip"
264263
Invoke-WebRequest -Uri "https://github.com/OneDragon-Anything/OneDragon-Env/releases/download/ZenlessZoneZero-OneDragon/cpython-3.11.zip" -OutFile "$envDir/cpython-3.11.zip"
265264
266265
# 将安装器复制到仓库根目录

deploy/OneDragon-Launcher.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ a = Analysis(
66
pathex=[],
77
binaries=[],
88
datas=[],
9-
hiddenimports=[],
9+
hiddenimports=['_cffi_backend'],
1010
hookspath=[],
1111
hooksconfig={},
1212
runtime_hooks=[],

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dependencies = [
1717
"soundcard==0.4.3",
1818
"librosa==0.10.2.post1",
1919
"gensim==4.3.3",
20+
"pygit2==1.19.0",
2021
]
2122

2223
[dependency-groups]

src/one_dragon/base/operation/one_dragon_env_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def download_service(self):
3737

3838
@cached_property
3939
def git_service(self):
40-
return GitService(self.project_config, self.env_config, self.download_service)
40+
return GitService(self.project_config, self.env_config)
4141

4242
@cached_property
4343
def python_service(self):

src/one_dragon/envs/env_config.py

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
from one_dragon.utils import os_utils
88

99
DEFAULT_ENV_PATH = os_utils.get_path_under_work_dir('.install')
10-
DEFAULT_GIT_DIR_PATH = os.path.join(DEFAULT_ENV_PATH, 'MinGit') # 默认的git文件夹路径
11-
DEFAULT_GIT_PATH = os.path.join(DEFAULT_GIT_DIR_PATH, 'cmd', 'git.exe') # 默认的git.exe文件路径
1210
DEFAULT_UV_DIR_PATH = os.path.join(DEFAULT_ENV_PATH, 'uv') # 默认的uv文件夹路径
1311
DEFAULT_UV_PATH = os.path.join(DEFAULT_UV_DIR_PATH, 'uv.exe') # 默认的uv.exe文件路径
1412
DEFAULT_PYTHON_DIR_PATH = os.path.join(DEFAULT_ENV_PATH, 'python') # 默认的python文件夹路径
@@ -51,6 +49,11 @@ class PipSourceEnum(Enum):
5149
TSING_HUA = ConfigItem('清华大学', 'https://pypi.tuna.tsinghua.edu.cn/simple')
5250
ALIBABA = ConfigItem('阿里云', 'https://mirrors.aliyun.com/pypi/simple')
5351

52+
class GitRemoteEnum(Enum):
53+
54+
ORIGIN = ConfigItem('origin')
55+
UPSTREAM = ConfigItem('upstream')
56+
5457

5558
class GitBranchEnum(Enum):
5659

@@ -83,22 +86,6 @@ class EnvConfig(YamlConfig):
8386
def __init__(self):
8487
YamlConfig.__init__(self, module_name='env')
8588

86-
@property
87-
def git_path(self) -> str:
88-
"""
89-
:return: git的路径
90-
"""
91-
return self.get('git_path', '')
92-
93-
@git_path.setter
94-
def git_path(self, new_value: str) -> None:
95-
"""
96-
更新 git的路径 正常不需要调用
97-
:param new_value:
98-
:return:
99-
"""
100-
self.update('git_path', new_value)
101-
10289
@property
10390
def uv_path(self) -> str:
10491
"""
@@ -289,6 +276,22 @@ def pip_trusted_host(self) -> str:
289276
"""
290277
return urllib.parse.urlparse(self.pip_source).netloc
291278

279+
@property
280+
def git_remote(self) -> str:
281+
"""
282+
远程
283+
:return:
284+
"""
285+
return self.get('git_remote', GitRemoteEnum.ORIGIN.value.value)
286+
287+
@git_remote.setter
288+
def git_remote(self, new_value: str) -> None:
289+
"""
290+
远程
291+
:return:
292+
"""
293+
self.update('git_remote', new_value)
294+
292295
@property
293296
def git_branch(self) -> str:
294297
"""

0 commit comments

Comments
 (0)