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

Rename sys_path_hacks/ to import_shims/ and silence DeprecatedEdxPlatformImportWarning by default #25458

Merged
merged 5 commits into from
Oct 30, 2020

Conversation

kdmccormick
Copy link
Member

@kdmccormick kdmccormick commented Oct 27, 2020

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 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.

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

@kdmccormick kdmccormick force-pushed the kdmccormick/sys-path-hacks-rename-to-import-shims branch 2 times, most recently from e32e321 to 077ef47 Compare October 27, 2020 20:26
@kdmccormick kdmccormick changed the title Rename sys_path_hacks/ to import_shims/ Rename sys_path_hacks/ to import_shims/ and silence DeprecatedEdxPlatformImportWarning by default Oct 27, 2020
@kdmccormick kdmccormick force-pushed the kdmccormick/sys-path-hacks-rename-to-import-shims branch 2 times, most recently from 086c470 to 1593e4e Compare October 27, 2020 20:42
@kdmccormick kdmccormick marked this pull request as ready for review October 27, 2020 20:44
@kdmccormick
Copy link
Member Author

fyi @cpennington

@kdmccormick kdmccormick force-pushed the kdmccormick/sys-path-hacks-rename-to-import-shims branch from 1593e4e to 4b88c94 Compare October 28, 2020 12:49
@kdmccormick kdmccormick force-pushed the kdmccormick/sys-path-hacks-rename-to-import-shims branch from 4b88c94 to 6d39491 Compare October 28, 2020 19:40
@kdmccormick
Copy link
Member Author

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
@kdmccormick kdmccormick force-pushed the kdmccormick/sys-path-hacks-rename-to-import-shims branch from 6d39491 to edc3ab1 Compare October 30, 2020 13:52
@edx-status-bot
Copy link

Your PR has finished running tests. There were no failures.

@kdmccormick kdmccormick merged commit 854502b into master Oct 30, 2020
@kdmccormick kdmccormick deleted the kdmccormick/sys-path-hacks-rename-to-import-shims branch October 30, 2020 14:20
@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants