aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2021-10-15 15:34:41 +0200
committerChristian Tismer <tismer@stackless.com>2021-10-18 11:56:06 +0200
commit3c005da473fa0b1b399e9d8aab98cfd7aa420754 (patch)
tree32b1df7a19449571285a9a9e77a9afba0acb1e5e
parent2bcc7ceb19b4042ae3fe320c53e1c21fd765b16a (diff)
Improve the MyPy support, basic step
The MyPy compatibility needed at least a py.typed file to continue. This was missing in the shiboken branch. Task-number: PYSIDE-1675 Change-Id: I5f5df2a084eb15e7b06dcbe97eb173c2f1fb26d0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--sources/shiboken6/shibokenmodule/CMakeLists.txt4
-rw-r--r--sources/shiboken6/shibokenmodule/py.typed.in1
2 files changed, 5 insertions, 0 deletions
diff --git a/sources/shiboken6/shibokenmodule/CMakeLists.txt b/sources/shiboken6/shibokenmodule/CMakeLists.txt
index e0693b8e2..085613510 100644
--- a/sources/shiboken6/shibokenmodule/CMakeLists.txt
+++ b/sources/shiboken6/shibokenmodule/CMakeLists.txt
@@ -46,7 +46,11 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.in"
# PYSIDE-1415: Copy Shiboken.pyi into the target.
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Shiboken.pyi"
"${CMAKE_CURRENT_BINARY_DIR}/../Shiboken.pyi" @ONLY)
+# typing support for mypy
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/py.typed.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../py.typed" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/../Shiboken.pyi"
+ "${CMAKE_CURRENT_BINARY_DIR}/../py.typed"
DESTINATION "${PYTHON_SITE_PACKAGES}/shiboken6")
# PYSIDE-1497: This `..` is the crucial trick to unify the path location of `Shiboken`.
diff --git a/sources/shiboken6/shibokenmodule/py.typed.in b/sources/shiboken6/shibokenmodule/py.typed.in
new file mode 100644
index 000000000..0e76a07dc
--- /dev/null
+++ b/sources/shiboken6/shibokenmodule/py.typed.in
@@ -0,0 +1 @@
+# this is a marker file for mypy