Skip to content

Always import _giscanner as giscanner._giscanner, even when uninstalled

Simon McVittie requested to merge wip/smcv/issue429 into main
  • Always import _giscanner as giscanner._giscanner, even when uninstalled

    We don't want to add the giscanner/ subdirectory of the source or build root to the sys.path or PYTHONPATH, because that would cause our ast.py to shadow the Python standard library's ast module.

    Instead, add the source and build roots (only) to the search path, and always import the extension module as part of the giscanner namespace.

    Resolves: #429 (closed)

  • tests: Don't add UNINSTALLED_INTROSPECTION_SRCDIR to sys.path

    Meson copies Python source into the build directory, so that we can rely on being able to import compiled C extensions and Python code from the same place.

Edited by Simon McVittie

Merge request reports