create py.typed for python module (PEP 561)

This commit is contained in:
Sebastian Goeldi 2022-12-12 17:05:45 +01:00
parent 6369a1f993
commit d30199fe26
3 changed files with 6 additions and 0 deletions

3
.gitignore vendored
View File

@ -58,6 +58,9 @@ src/klayout.pro.user
build/
dist/
# python type hints
py.typed
# IDEs
.vscode

View File

@ -19,3 +19,4 @@ include src/plugins/*/db_plugin/*.h
include src/plugins/*/*/db_plugin/*.h
recursive-include src/plugins/common *.h
include version.sh
include src/py.typed

View File

@ -57,6 +57,7 @@ and won't find them. So we need to take away the path with
from typing import List
from setuptools import setup, Distribution, find_packages
from setuptools.extension import Extension, Library
from pathlib import Path
import glob
import os
import re
@ -904,6 +905,7 @@ lay = Extension(config.root + '.laycore',
# Core setup function
if __name__ == "__main__":
(Path(__file__).parent / "src/py.typed").touch()
setup(
name=config.root,
version=config.version(),