Skip to content

Commit

Permalink
Install xcffib if possible during the wheel generation
Browse files Browse the repository at this point in the history
Fix #212.
  • Loading branch information
liZe committed Apr 15, 2023
1 parent fcf964d commit e70945d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions utils/build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import importlib.util
import subprocess
import sys
from pathlib import Path

Expand All @@ -15,6 +16,13 @@ def build_sdist(*args, **kwargs):


def build_wheel(*args, **kwargs):
# Try to install xcffib for XCB support
try:
pip = Path(sys.executable).parent / 'pip'
subprocess.run([str(pip), 'install', 'xcffib'])
except Exception:
pass

spec = importlib.util.spec_from_file_location(
'ffi_build', folder / 'ffi_build.py')
module = importlib.util.module_from_spec(spec)
Expand Down

0 comments on commit e70945d

Please sign in to comment.