Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix import from patches.py in script/lib/git.py #41430

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

miniak
Copy link
Contributor

@miniak miniak commented Feb 24, 2024

We are getting this error in our internal builds

Traceback (most recent call last):
  File "/Volumes/Builds/work/electron-28/src/microsoft/scripts/import_patches.py", line 20, in <module>
    import git  # pylint: disable=wrong-import-position
    ^^^^^^^^^^
  File "/Volumes/Builds/work/electron-28/src/electron/script/lib/git.py", line 18, in <module>
    from .patches import PATCH_FILENAME_PREFIX, is_patch_location_line
ImportError: attempted relative import with no known parent package

our script does this

SCRIPTS_LIB_DIR = os.path.join(ELECTRON_DIR, 'script', 'lib')
sys.path.append(SCRIPTS_LIB_DIR)

import git
from patches import patch_from_dir

Notes: none

@miniak miniak requested a review from ckerr February 24, 2024 14:02
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Feb 24, 2024
@miniak miniak self-assigned this Feb 24, 2024
@miniak miniak added semver/none target/27-x-y PR should also be added to the "27-x-y" branch. target/28-x-y PR should also be added to the "28-x-y" branch. target/29-x-y PR should also be added to the "29-x-y" branch. target/30-x-y PR should also be added to the "30-x-y" branch. labels Feb 24, 2024
@ckerr
Copy link
Member

ckerr commented Feb 25, 2024

@miniak thanks for this fix. I have another patch that I'm working on and this was going to be a subset of it, but this fix is worthwhile on it's own 👍

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Feb 25, 2024
@miniak
Copy link
Contributor Author

miniak commented Feb 25, 2024

@ckerr It would be great if we can get it merged including the backports for the next releases

@zcbenz zcbenz merged commit 3394ee7 into main Feb 26, 2024
33 checks passed
@zcbenz zcbenz deleted the miniak/python-git-import branch February 26, 2024 02:36
Copy link

release-clerk bot commented Feb 26, 2024

No Release Notes

@trop
Copy link
Contributor

trop bot commented Feb 26, 2024

I have automatically backported this PR to "28-x-y", please check out #41434

@trop trop bot added in-flight/28-x-y and removed target/28-x-y PR should also be added to the "28-x-y" branch. labels Feb 26, 2024
@trop
Copy link
Contributor

trop bot commented Feb 26, 2024

I have automatically backported this PR to "27-x-y", please check out #41435

@trop
Copy link
Contributor

trop bot commented Feb 26, 2024

I have automatically backported this PR to "30-x-y", please check out #41436

@trop
Copy link
Contributor

trop bot commented Feb 26, 2024

I have automatically backported this PR to "29-x-y", please check out #41437

@trop trop bot added in-flight/30-x-y and removed target/27-x-y PR should also be added to the "27-x-y" branch. labels Feb 26, 2024
@trop trop bot added in-flight/29-x-y merged/29-x-y PR was merged to the "29-x-y" branch. merged/30-x-y PR was merged to the "30-x-y" branch. merged/27-x-y PR was merged to the "27-x-y" branch. merged/28-x-y PR was merged to the "28-x-y" branch. and removed target/30-x-y PR should also be added to the "30-x-y" branch. target/29-x-y PR should also be added to the "29-x-y" branch. in-flight/29-x-y in-flight/30-x-y in-flight/27-x-y in-flight/28-x-y labels Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/27-x-y PR was merged to the "27-x-y" branch. merged/28-x-y PR was merged to the "28-x-y" branch. merged/29-x-y PR was merged to the "29-x-y" branch. merged/30-x-y PR was merged to the "30-x-y" branch. semver/none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants