~/talk

Using Python's import machinery to handle API deprecations

Talkat PyCon US 2023 · 2023-04-19..04-27· [developer-experience]
links:none on file
slides:none on file

A demonstration of using Python's importlib to implement backward-compatible API deprecations by intercepting imports and redirecting moved, split, or removed modules and attributes. It covers importlib-based techniques to keep deprecated import paths functional (with deprecation warnings) so a single codebase can serve both old and new layouts without maintaining duplicate packages. The approach is practical and extensible for maintainers facing large codebase restructures.

AI-written summary · about

  1. 0:00Start
  2. 9:28The Great IDAES Module Relocation
  3. 16:03Looking for a deal with the import system
  4. 22:12Make sure our Finder knows about our relocation mapping
  5. 23:30Find the spec for the new import path using a Finder for source files
  6. 24:36Step 4: Create the spec for the old import using the file location from the new
  7. 26:19Adding a notification for the client
  8. 26:56Activating the Finder
  9. 29:41Library code: Enable compatibility from environment
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.