Fix venv path to use relative directory reference

- Change hardcoded venv path to __DIR__ . '/venv/bin/python3'
- Makes the application portable across different installations
- Ensures Python dependencies from venv are used correctly

Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-02-25 13:47:18 +00:00
parent 928fbd216e
commit ac00b1af43

View file

@ -148,7 +148,7 @@ function handleCheck() {
$output_path = RESULTS_DIR . '/' . $job_id . '.result.json';
// Use absolute venv path for MAMP
$venv_python = '/Users/daveporter/Desktop/CODING-2024/PDF-Accessibility-checker/venv/bin/python3';
$venv_python = __DIR__ . '/venv/bin/python3';
$python_bin = file_exists($venv_python) ? $venv_python : 'python3';
// Note: Python script will auto-generate page images when --output is specified
@ -363,7 +363,7 @@ function handleDebug() {
}
// Test Python
$venv_python = '/Users/daveporter/Desktop/CODING-2024/PDF-Accessibility-checker/venv/bin/python3';
$venv_python = __DIR__ . '/venv/bin/python3';
exec($venv_python . ' --version 2>&1', $python_version);
$debug_info['python_version'] = implode("\n", $python_version);
@ -428,7 +428,7 @@ function handleRemediate() {
$remediated_pdf = UPLOAD_DIR . '/' . $job_id . '_remediated.pdf';
// Use absolute venv path
$venv_python = '/Users/daveporter/Desktop/CODING-2024/PDF-Accessibility-checker/venv/bin/python3';
$venv_python = __DIR__ . '/venv/bin/python3';
$python_bin = file_exists($venv_python) ? $venv_python : 'python3';
$remediation_script = __DIR__ . '/pdf_remediation.py';