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

refactor!: remove safe_lxml import compatibility hack #30671

Merged
merged 1 commit into from
Sep 14, 2022
Merged

refactor!: remove safe_lxml import compatibility hack #30671

merged 1 commit into from
Sep 14, 2022

Conversation

kdmccormick
Copy link
Member

@kdmccormick kdmccormick commented Jun 29, 2022

Description

In the past, safe_lxml was located at ./common/lib/safe_lxml/safe_lxml,
and was imported as so:

  import safe_lxml

Now, safe_lxml is located at ./openedx/core/lib/safe_lxml, and is
imported as so:

  import openedx.core.lib.safe_lxml

We added in a temporary backwards-compatibility hack, in the form
of the module ./safe_lxml/__init__.py, to support the old import
format (with a warning written to the logs).

Enough time has passed that it we feel it is safe to
remove that compatibility hack. After this commit, imports in
the form `import safe_lxml` will raise an ImportError.

Supporting information

Testing instructions

edX/2U: Please search the LMS and CMS logs for the string: Importing from 'safe_lxml' instead of 'openedx.core.lib.safe_lxml' is deprecated.. There should be zero occurrences for the past month. If there are occurances, then we need to address those before merging this PR.

Deadline

None, although we should wrap this up before considering BOM-2579 "done".

Other information

Blocked until:

In the past, safe_lxml was located at ./common/lib/safe_lxml/safe_lxml,
and was imported as so:

  import safe_lxml

Now, safe_lxml is located at ./openedx/core/lib/safe_lxml, and is
imported as so:

  import openedx.core.lib.safe_lxml

We added in a temporary backwards-compatibility hack, in the form
of the module ./safe_lxml/__init__.py, to support the old import
format (with a warning written to the logs).

Enough time has passed that it we feel it is safe to
remove that compatibility hack. After this commit, imports in
the form `import safe_lxml` will raise an ImportError.
@kdmccormick
Copy link
Member Author

@awais786 says that the last log relevant edX.org message was:

Sep 13 09:02:59 ip-x-x-x-x [service_variant=lms][py.warnings][env:prod-edx-edxapp] WARNING [ip-x-x-x-x] [user None] [ip None] [warnings.py:109] - /edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/pkg_resources/__init__.py:2453: UserWarning: Importing from 'safe_lxml' instead of 'openedx.core.lib.safe_lxml' is deprecated.

Which is about an hour after the upgrade to edx-sga==0.20.0 (which incorporates mitodl/edx-sga#324) was deployed to edX production.

So, I believe that this is safe to merge.

@kdmccormick kdmccormick merged commit 57a1f58 into openedx:master Sep 14, 2022
@kdmccormick kdmccormick deleted the kdmccormick/safe-lxml-shim-removal branch September 14, 2022 14:07
@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.

1 similar comment
@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
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants