-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Rename sys_path_hacks/ to import_shims/ and silence DeprecatedEdxPlatformImportWarning by default #25458
Rename sys_path_hacks/ to import_shims/ and silence DeprecatedEdxPlatformImportWarning by default #25458
Conversation
e32e321
to
077ef47
Compare
086c470
to
1593e4e
Compare
fyi @cpennington |
1593e4e
to
4b88c94
Compare
4b88c94
to
6d39491
Compare
Planning to roll this out tomorrow morning or when the tasks issues quiet down, whichever comes later. |
The old folder name is somewhat confusing, because the folder contains shims to _compensate for the removal of sys.path hacks_, but does not contain the sys.path hacks themselves. Furthermore, this import_shims/ system could also be used for other import path changes, such as turning the locally-installed packages in common/lib/ into regular, importable modules (e.g. `from common.lib.xmodule import abc` instead of `from xmodule import abc`). So, a name that is not specific to the sys.path hacks may be better in the medium-to-long term. Along the same lines, we also rename SysPathHackWarning to DeprecatedEdxPlatformImportWarning.
Command: import_shims/generate_shims.sh lms/djangoapps import_shims/lms
Command: import_shims/generate_shims.sh cms/djangoapps import_shims/studio
6d39491
to
edc3ab1
Compare
Your PR has finished running tests. There were no failures. |
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
EdX Release Notice: This PR has been deployed to the production environment. |
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
EdX Release Notice: This PR has been deployed to the production environment. |
This PR changes 2300 files, but only changes like 7 of them interestingly. For reviewers, I recommend actually reviewing commits 1 and 2, and then just briefly looking at commits 3-5 to get an idea of what they do.
Commit 1: Rename sys_path_hacks/ to import_shims/
The old folder name is somewhat confusing, because the
folder contains shims to compensate for the removal
of sys.path hacks, but does not contain the sys.path
hacks themselves.
Furthermore, this import_shims/ system could also be
used for other import path changes, such as turning
the locally-installed packages in common/lib/
into regular, importable modules
(e.g.
from common.lib.xmodule import abc
instead offrom xmodule import abc
). So, a name that is notspecific to the sys.path hacks may be better
in the medium-to-long term.
Along the same lines, we also rename SysPathHackWarning
to DeprecatedEdxPlatformImportWarning.
Commit 2: Silence DeprecatedEdxPlatformImportWarning by default
The influx of sys.path-hack-removal warnings is causing developers pain, as every test run and LMS/Studio startup is accompanied by ~200 warning messages that are generally irrelevant to most developers. I have a PR to actually fix most of those warnings, but it needs time for review and thoughtful roll-out. This commit will shut up the warnings by default in the mean time.
Commits 3-5: Rename sys_path_hacks module tree, regenerate LMS modules, and regenerate Studio modules
These are in separate commits to make the interesting diffs (commits 1 and 2) more readable.
Post-merge follow-up
Send email instructing devs to remove the SysPathHackWarning lines from private.py
Next up