-
Notifications
You must be signed in to change notification settings - Fork 7
Configuration Guide
Complete reference for PCART configuration files.
Place your JSON configuration file in the Configure/ directory.
| 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 |
Absolute path to your project root directory.
Linux:
"projPath": "/home/user/myproject"Windows:
"projPath": "C:\\Users\\user\\myproject"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:
- If the command starts with a Python executable name (
python,python3,python3.x), PCART locates the matching interpreter inside the configured virtual environment (currentEnvortargetEnv). - If the command starts with the Windows
pylauncher, the version selector (-3.9,-3) is stripped and the remaining command is run with the virtual environment's Python. - If the command starts with
-mor a.pyfile directly, it is treated as a Python command. - 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/targetEnvpaths 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.exeor<env>/Scripts/python.exe
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" |
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"The current and target library versions you want to upgrade between.
"currentVersion": "1.7.1",
"targetVersion": "1.9.0"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"{
"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"
}{
"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"
}- 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
pylauncher version selectors (-3.9,-3) are automatically stripped - Console scripts are resolved from
<env>/bin/on Linux and<env>/Scripts/on Windows
- Quick-Start: Basic usage tutorial
- Examples: More configuration examples
- How-It-Works: Internal mechanism and data flow