Python 3 Migration

Perforce QAC (v3.1.0/2021.3) replaced our internal version of Python 2 with Python 3. Any projects or CCTs created with earlier version of Perforce QAC are unlikely to work without upgrading their CIP generation scripts. Typical output seen when using an invalid CIP script would look like:

$ qacli analyze -f -P .
QAC has issued the following command:
C:\Users\Morpheus\AppData\Local\Perforce\QAC-2021.2\samples\sample_inspect_c-2021.2\prqa\configs\Initial\config\DATA\QAC_Generic_C\Script\QAC_Generic_C.py
but the command failed.
Exit Code: 1 (0x1)
C:\Users\Morpheus\AppData\Local\Perforce\QAC-2021.2\samples\sample_inspect_c-2021.2\src\inspect.c:qac:23:1:0
Progress(File-based Analysis): ................................... done

0 successes and 1 failure.
See log for more details: C:\Users\Morpheus\AppData\Local\Perforce\QAC-2021.3\app\logs\QAC_20211122T13281583_17040.log

Additionally, if you see the following in the logfile then this also indicates an old Python 2 script is being used:

13:39:38.237   30932 QAF.debug: PRQA::QAAPI::QAUtils::startProcess: ===     import dircache
13:39:38.237   30932 QAF.debug: PRQA::QAAPI::QAUtils::startProcess: === ModuleNotFoundError: No module named 'dircache'

Depending upon your requirements, you can either upgrade an existing project to be Python 3 compatible or you may upgrade an existing CCT to be Python 3 compatible. This CCT can then be used later when creating projects.

Project Upgrading

Perforce QAC 2026.2 does not support upgrading CIP scripts to Python 3. If you need to do this, install a slightly older version (e.g. QAC 2026.1) and run the upgrade process using that version first.

The easiest way to upgrade a project is to use the qacli project upgrade command mentioned in the following section. This updates the component versions in the projects.