From 0e66be073f3938dab027cbb57545dc5ba73a7b9f Mon Sep 17 00:00:00 2001 From: Kyle McCormick Date: Wed, 29 Jun 2022 09:57:05 -0400 Subject: [PATCH] refactor!: remove safe_lxml import compatibility hack 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. --- safe_lxml/__init__.py | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 safe_lxml/__init__.py diff --git a/safe_lxml/__init__.py b/safe_lxml/__init__.py deleted file mode 100644 index e07cbde02d52..000000000000 --- a/safe_lxml/__init__.py +++ /dev/null @@ -1,36 +0,0 @@ -""" -Temporary import path shim module for openedx.core.lib.safe_lxml. - -Previously, the safe_lxml package was housed in common/lib/safe_lxml. -It was installed as its own Python project, so instead of its import path -being, as one would expect: - - import common.lib.safe_lxml.safe_lxml - -it was instead just: - - import safe_lxml - -To increase the sanity of edx-platform and simplify its tooling, we have -moved the safe_lxml package to openedx/core/lib (in tihs same repo) and -changing its import path to: - - import openedx.core.lib.safe_lxml - -For details, see: -https://openedx.atlassian.net/browse/BOM-2583 (public, but requires account) - -In order to maintain backwards-compatibility with code using the -old import path for one release, we expose this temporary compatibility -module and raise a warning when the old import path is used. -This entire `safe_lxml` shim folder can be removed after 2023-01-01. -In the Poplar release, 'import safe_lxml' will stop working entirely. -""" -import warnings - -warnings.warn( - "Importing from 'safe_lxml' instead of 'openedx.core.lib.safe_lxml' is deprecated.", - stacklevel=3, # Should surface the line that is doing the importing. -) - -from openedx.core.lib.safe_lxml import * # pylint: disable=unused-wildcard-import,wrong-import-order