-
Notifications
You must be signed in to change notification settings - Fork 2
/
pdm_build.py
43 lines (32 loc) · 850 Bytes
/
pdm_build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from __future__ import annotations
from sys import platform
from typing import TypedDict
from setuptools import Extension
class Build(TypedDict):
"""
Summary
-------
a typed dictionary for the build
Attributes
----------
ext_modules (list[Extension]) : a list of extensions
"""
ext_modules: list[Extension]
def pdm_build_initialize(_):
"""
Summary
-------
initialise the build
"""
if platform in ('win32', 'cygwin', 'cli'):
return
raise RuntimeError('keywin only supports Windows!')
def pdm_build_update_setup_kwargs(_, kwargs: Build):
"""
Summary
-------
update the setup kwargs with the extension modules
"""
kwargs.update(
ext_modules=[Extension('keywin.send_input', ['keywin/send_input/send_input.c'], libraries=['user32'])]
)