Skip to content

Conversation

@blag
Copy link
Contributor

@blag blag commented Jan 26, 2021

We were a little overzealous when ripping out Python 2 support code, and removed some Python 3 support as well. This PR adds that feature back in.

This PR re-enables pack authors to use implicit relative import paths when importing from actions/lib (eg: from lib.mymodule import myfunction`).

Python 3 has removed support for implicit relative imports for legitimate reasons, so we should try to push pack authors to use explicit relative imports (eg: from .lib.mymodule import myfunction - note the preceding . before lib.mymodule). But we should both document this quirk and take steps to remove it in a future ST2 release (tracking issue incoming).

Closes #5126.

@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines. Good size to review. label Jan 26, 2021
@blag blag added this to the 3.4.0 milestone Jan 26, 2021
@blag
Copy link
Contributor Author

blag commented Jan 27, 2021

Now that I have a bit more time before the v3.4 release, I'd like to add some additional tests for this before it's merged.

@blag blag mentioned this pull request Feb 12, 2021
@blag
Copy link
Contributor Author

blag commented Feb 12, 2021

Closed by #5142.

@blag blag closed this Feb 12, 2021
@blag blag deleted the fix-implicit-relative-pack-actions-lib-import branch February 12, 2021 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug python3 regression size/M PR that changes 30-99 lines. Good size to review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Packs that have actions in sub-directories importing modules in same sub-directory fail

2 participants