Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • pygobject pygobject
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 307
    • Issues 307
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 30
    • Merge requests 30
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • pygobjectpygobject
  • Merge requests
  • !205

setup.py: look up pycairo headers without importing the module

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Christoph Reiter requested to merge creiter/pygobject:setuppy-pycairo-noimport into master Apr 09, 2022
  • Overview 0
  • Commits 1
  • Pipelines 2
  • Changes 1

Up until now pycairo provided a cairo.get_include() helper which could be used to find the required include directory matching the module, considering various scenarios.

Starting with 3.8 this leads to problems on Windows since CPython on Windows will no longer use PATH for the DLL lookup and expects the library user to explicitely pass the directory where the cairo DLL can be found.

In a build environment the user has no control over this though, so we have to find the include directory without loading/importing pycairo again.

This now uses a combination of importlib.util.find_spec() for finding the module and importlib.metadata.distribution() for finding the package version.

Hopefully this covers all cases.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: setuppy-pycairo-noimport