Skip to content

Configuration Guide

PCART Bot edited this page May 8, 2026 · 3 revisions

Configuration Guide

Complete reference for PCART configuration files.

Configuration File Location

Place your JSON configuration file in the Configure/ directory.

Configuration Fields

Field Type Required Description
projPath string Yes Absolute path to your project root directory
runCommand string Yes Command to run your project (see supported formats below)
runFilePath string Yes Path to source files relative to projPath
libName string Yes Library name as used in your code
currentVersion string Yes Current library version
targetVersion string Yes Target library version
currentEnv string Yes Path to virtual environment root directory with current version
targetEnv string Yes Path to virtual environment root directory with target version

Field Details

projPath

Absolute path to your project root directory.

Linux:

"projPath": "/home/user/myproject"

Windows:

"projPath": "C:\\Users\\user\\myproject"

runCommand

The command used to run your project. PCART automatically detects the Python executable from your virtual environment and normalizes the command using shlex-based parsing.

Supported formats:

Format Example Notes
python <script> python run.py Most common
python <script> <args> python run.py --verbose Arguments preserved
python3 <script> python3 main.py Linux only
py -X.Y <script> py -3.9 train.py Windows py launcher
python -m <module> python -m pytest Module execution
Console script pytest, flask run Resolved from currentEnv/targetEnv bin or Scripts dir

How PCART resolves the Python executable:

  1. If the command starts with a Python executable name (python, python3, python3.x), PCART locates the matching interpreter inside the configured virtual environment (currentEnv or targetEnv).
  2. If the command starts with the Windows py launcher, the version selector (-3.9, -3) is stripped and the remaining command is run with the virtual environment's Python.
  3. If the command starts with -m or a .py file directly, it is treated as a Python command.
  4. Otherwise, PCART treats it as a console script and resolves the executable from <env>/bin/ (Linux) or <env>/Scripts/ (Windows).

Examples:

// Standard Python script
"runCommand": "python run.py"

// Python script with arguments
"runCommand": "python run.py --epochs 100 --batch-size 32"

// Linux python3
"runCommand": "python3 src/main.py"

// Windows py launcher
"runCommand": "py -3.9 test_script.py"

// Module execution
"runCommand": "python -m pytest tests/"

// Console script (Flask, pytest, etc.)
"runCommand": "flask run"

Note: The currentEnv/targetEnv paths must be the root directory of the virtual environment (e.g., /home/user/anaconda3/envs/myenv), not the full path to the Python executable. PCART internally locates the interpreter based on the platform conventions:

  • Linux: <env>/bin/python
  • Windows: <env>/python.exe or <env>/Scripts/python.exe

runFilePath

Path to the directory containing source files to analyze, relative to projPath.

Scenario Example
Entry file in project root "runFilePath": ""
Entry file in first-level subdirectory "runFilePath": "src"

Examples:

runCommand projPath runFilePath
python run.py /home/user/project ""
python src/main.py /home/user/project "src"
python src/utils/main.py /home/user/project "src/utils"

libName

The library name as it appears in your Python code imports.

Library libName
PyTorch torch
NumPy numpy
SciPy scipy
Pillow PIL
scikit-learn sklearn
Matplotlib matplotlib
Pandas pandas

Example:

# In your code
import torch
from PIL import Image

# Configuration
"libName": "torch"
# or
"libName": "PIL"

currentVersion / targetVersion

The current and target library versions you want to upgrade between.

"currentVersion": "1.7.1",
"targetVersion": "1.9.0"

currentEnv / targetEnv

Paths to the virtual environment root directories containing the respective library versions. Do not use the full path to the Python executable.

Conda environments:

"currentEnv": "/home/user/anaconda3/envs/myproject_v1",
"targetEnv": "/home/user/anaconda3/envs/myproject_v2"

Virtualenv:

"currentEnv": "/home/user/venv/myproject_v1",
"targetEnv": "/home/user/venv/myproject_v2"

Windows conda:

"currentEnv": "C:\\Users\\user\\anaconda3\\envs\\myproject_v1",
"targetEnv": "C:\\Users\\user\\anaconda3\\envs\\myproject_v2"

Complete Example

Linux Configuration

{
  "projPath": "/home/user/myproject",
  "runCommand": "python run.py",
  "runFilePath": "",
  "libName": "torch",
  "currentVersion": "1.7.1",
  "targetVersion": "1.9.0",
  "currentEnv": "/home/user/anaconda3/envs/torch_v1",
  "targetEnv": "/home/user/anaconda3/envs/torch_v2"
}

Windows Configuration

{
  "projPath": "C:\\Users\\user\\myproject",
  "runCommand": "python run.py",
  "runFilePath": "",
  "libName": "torch",
  "currentVersion": "1.7.1",
  "targetVersion": "1.9.0",
  "currentEnv": "C:\\Users\\user\\anaconda3\\envs\\torch_v1",
  "targetEnv": "C:\\Users\\user\\anaconda3\\envs\\torch_v2"
}

Cross-Platform Notes

  • On Windows, you can use either backslashes (\\) or forward slashes (/) in paths
  • PCART automatically handles path separator conversion internally
  • Use absolute paths for all path fields
  • Windows py launcher version selectors (-3.9, -3) are automatically stripped
  • Console scripts are resolved from <env>/bin/ on Linux and <env>/Scripts/ on Windows

Related Pages

Clone this wiki locally