PCART  v1.4
Automated Repair of Python API Parameter Compatibility Issues
Classes | Functions
workspace Namespace Reference

Run workspace helpers for isolating PCART execution artifacts. More...

Classes

class  RunWorkspace
 Run workspace path object PCART单次运行的工作区路径对象 More...
 

Functions

def cleanupRunWorkspace (workspace)
 Remove one completed PCART run workspace 删除一次已完成的PCART运行工作区 More...
 
def createRunWorkspace (repoRoot, projPath, runCommand, runPath, libName, currentVersion, targetVersion, currentEnv, targetEnv, commandId='cmd-001', timestamp=None)
 Create an isolated workspace for one PCART run command 为一次PCART运行命令创建隔离工作区 More...
 
def exportRunReport (workspace)
 Export internal report files to user-visible report directory 将工作区内部报告导出到用户可见报告目录 More...
 
def getRepoRoot ()
 Get PCART repository root path 获取PCART仓库根目录路径 More...
 
def getRuntimePaths (workspace)
 Return runtime artifact paths for the current execution 返回当前执行使用的运行产物路径 More...
 
def slugifyProjectName (projPath)
 Convert project path/name to a filesystem-safe slug 将项目路径或项目名转换为可作为目录名使用的slug. More...
 
def workspaceCwd (path)
 
def writeMetadata (workspace, metadata)
 Write workspace metadata 写入运行工作区元数据 More...
 

Detailed Description

Run workspace helpers for isolating PCART execution artifacts.

Provides createRunWorkspace() to create isolated run directories under PCARTRuns/runs/ with unique run_id and command_id, exportRunReport() to export internal reports to Report/runs/, and workspaceCwd() for temporary working directory switching. Each workspace contains Copy/, Dynamic/, data/, temp/, Report/ subdirectories and a metadata.json snapshot. 提供createRunWorkspace()在PCARTRuns/runs/下创建带唯一run_id和command_id的 隔离运行目录,exportRunReport()导出内部报告到Report/runs/,workspaceCwd() 用于临时切换工作目录。每个工作区包含Copy/、Dynamic/、data/、temp/、Report/ 子目录和metadata.json快照。

提供PCART运行工作区的创建、编号、元数据记录和报告导出能力

Function Documentation

◆ cleanupRunWorkspace()

def workspace.cleanupRunWorkspace (   workspace)

Remove one completed PCART run workspace 删除一次已完成的PCART运行工作区

Only a direct child of <repo>/PCARTRuns/runs can be removed. 只允许删除<repo>/PCARTRuns/runs的直接子目录。

Parameters
workspaceRunWorkspace object for this execution
Returns
None

Definition at line 264 of file workspace.py.

Here is the caller graph for this function:

◆ createRunWorkspace()

def workspace.createRunWorkspace (   repoRoot,
  projPath,
  runCommand,
  runPath,
  libName,
  currentVersion,
  targetVersion,
  currentEnv,
  targetEnv,
  commandId = 'cmd-001',
  timestamp = None 
)

Create an isolated workspace for one PCART run command 为一次PCART运行命令创建隔离工作区

The workspace stores intermediate Copy/Dynamic/data/temp/Report artifacts under PCARTRuns, while user-visible reports are exported under Report/runs. 运行中间态保存在PCARTRuns中,用户可见报告导出到Report/runs中。

Parameters
repoRootThe PCART repository root path
projPathThe project path under test
runCommandThe project run command
runPathThe relative path of the run file
libNameThe upgraded Python third-party library name
currentVersionThe current library version
targetVersionThe target library version
currentEnvThe virtual environment for current library version
targetEnvThe virtual environment for target library version
commandIdThe command id under this run, default cmd-001
timestampOptional timestamp, mainly used by tests
Returns
RunWorkspace object

Definition at line 113 of file workspace.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportRunReport()

def workspace.exportRunReport (   workspace)

Export internal report files to user-visible report directory 将工作区内部报告导出到用户可见报告目录

Parameters
workspaceThe RunWorkspace object
Returns
None

Definition at line 239 of file workspace.py.

Here is the caller graph for this function:

◆ getRepoRoot()

def workspace.getRepoRoot ( )

Get PCART repository root path 获取PCART仓库根目录路径

Returns
The absolute repository root path

Definition at line 52 of file workspace.py.

Here is the caller graph for this function:

◆ getRuntimePaths()

def workspace.getRuntimePaths (   workspace)

Return runtime artifact paths for the current execution 返回当前执行使用的运行产物路径

Internal pipeline code should use these paths instead of cwd-relative Copy/Dynamic/data/Report paths. 流水线内部代码应使用这些路径,而非相对于当前工作目录的Copy/Dynamic/data/Report路径。

Parameters
workspaceRunWorkspace object
Returns
Dict of Copy/Dynamic/data/temp/Report roots

Definition at line 207 of file workspace.py.

Here is the caller graph for this function:

◆ slugifyProjectName()

def workspace.slugifyProjectName (   projPath)

Convert project path/name to a filesystem-safe slug 将项目路径或项目名转换为可作为目录名使用的slug.

Parameters
projPathThe project path or project name
Returns
A safe project slug used in run id

Definition at line 61 of file workspace.py.

Here is the caller graph for this function:

◆ workspaceCwd()

def workspace.workspaceCwd (   path)

Definition at line 225 of file workspace.py.

Here is the caller graph for this function:

◆ writeMetadata()

def workspace.writeMetadata (   workspace,
  metadata 
)

Write workspace metadata 写入运行工作区元数据

Parameters
workspaceThe RunWorkspace object
metadataAdditional metadata collected from config
Returns
None

Definition at line 192 of file workspace.py.

Here is the caller graph for this function: