Skip to content

fix: pass no-uninstall flag to generate_oss_compliance.sh to prevent prettytable corruption#5750

Merged
junpuf merged 2 commits intomainfrom
fix/prettytable-oss-compliance
Mar 17, 2026
Merged

fix: pass no-uninstall flag to generate_oss_compliance.sh to prevent prettytable corruption#5750
junpuf merged 2 commits intomainfrom
fix/prettytable-oss-compliance

Conversation

@junpuf
Copy link
Copy Markdown
Contributor

@junpuf junpuf commented Mar 16, 2026

Problem

generate_oss_compliance.sh (downloaded from S3 at build time) installs PTable — an old prettytable fork that shares the same prettytable/ package directory — then uninstalls it after generating the compliance report. The uninstall removes __init__.py and prettytable.py from the shared directory, corrupting the prettytable install that was already placed there by uv.

This causes all 3 Lambda GPU images to have a broken prettytable:

ImportError: cannot import name 'HRuleStyle' from 'prettytable' (unknown location)

Which breaks pip-licenses out of the box (it depends on prettytable).

Fix

Pass true as the NO_UNINSTALL argument to generate_oss_compliance.sh. This skips the pip uninstall step after compliance generation, leaving the pre-installed prettytable intact.

The NO_UNINSTALL argument was added to generate_oss_compliance.sh in the upstream Asimov-tools package, which also replaces PTable with prettytable in the compliance script's requirements and updates piplicenses.py for prettytable 3.x compatibility. The S3 zip has already been updated with those changes.

Testing

Built and verified base-py3 and cupy-py3 targets on a devbox — from prettytable import HRuleStyle, PrettyTable, RowType succeeds in both images after this fix.

@aws-deep-learning-containers-ci aws-deep-learning-containers-ci Bot added authorized Size:XS Determines the size of the PR labels Mar 16, 2026
generate_oss_compliance.sh installs PTable (an old prettytable fork) then
uninstalls it, which corrupts the prettytable package directory already
installed in the image by uv. This breaks pip-licenses and any other
package depending on prettytable.

Pass 'true' as the NO_UNINSTALL argument to skip the pip uninstall step.
The upstream fix is tracked in CR-260711330 (Asimov-tools).

Signed-off-by: Junpu Fan <junpu@amazon.com>
@junpuf junpuf force-pushed the fix/prettytable-oss-compliance branch from daa2217 to 2ce7969 Compare March 16, 2026 21:27
@junpuf junpuf merged commit b95d519 into main Mar 17, 2026
25 checks passed
@junpuf junpuf deleted the fix/prettytable-oss-compliance branch March 17, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

authorized Size:XS Determines the size of the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants