Skip to content

Commit

Permalink
Merge branch 'topic/ddraganov/missingtypehints' into 'master'
Browse files Browse the repository at this point in the history
Custom recursive addition of type annotations to package_data

See merge request api-platform/pyvmomi-public!8
  • Loading branch information
Daniel Draganov committed Feb 7, 2024
2 parents 35f2743 + c580055 commit 2ee06f8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ def read(fname):
with open('test-requirements.txt') as f:
required_for_tests = f.read().splitlines()


def getTypeAnnotationsPackageData():
allFiles = []
for root, dirs, files in os.walk(os.path.join(os.path.dirname(__file__), 'pyVmomi')):
for file in files:
if file.endswith('.pyi'):
fileRelPath = os.path.relpath(str(os.path.join(root, file)))
allFiles.append(fileRelPath.split(os.path.sep, 1)[1])
allFiles.append('py.typed')
return allFiles


setup(
name='pyvmomi',
version=version_info_str,
Expand All @@ -39,7 +51,7 @@ def read(fname):
author='VMware, Inc.',
author_email='jhu@vmware.com',
packages=['pyVmomi', 'pyVim'],
package_data={"pyVmomi": ["py.typed", "*.pyi", "**/*.pyi"]},
package_data={"pyVmomi": getTypeAnnotationsPackageData()},
install_requires=required,
license='License :: OSI Approved :: Apache Software License',
classifiers=[
Expand Down

0 comments on commit 2ee06f8

Please sign in to comment.