23 lines
471 B
Python
23 lines
471 B
Python
|
from dataclasses import dataclass
|
||
|
import json
|
||
|
|
||
|
|
||
|
@dataclass
|
||
|
class Context:
|
||
|
repo_url: str = ""
|
||
|
repo_branch: str = ""
|
||
|
repo_commit: str = ""
|
||
|
package_name: str = ""
|
||
|
|
||
|
project_original_path: str = "project/original"
|
||
|
|
||
|
temp_project_path: str = ""
|
||
|
# 本地的版本号
|
||
|
local_repo_branch: str = ""
|
||
|
local_repo_commit: str = ""
|
||
|
|
||
|
@classmethod
|
||
|
def from_json(cls, json_str: str):
|
||
|
data = json.loads(json_str)
|
||
|
return cls(**data)
|