Skip to content

Commit

Permalink
Fix type stub packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettheel committed Jan 15, 2019
1 parent b1f557f commit e3b1ecf
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions setup.py
Expand Up @@ -3,6 +3,17 @@

from setuptools import setup, find_packages


def find_stubs(package):
stubs = []
for root, dirs, files in os.walk(package):
for f in files:
path = os.path.join(root, f).replace(package + os.sep, '', 1)
if path.endswith('.pyi') or path.endswith('py.typed'):
stubs.append(path)
return {package: stubs}


if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
os.system('python setup.py bdist_wheel upload')
Expand Down Expand Up @@ -42,7 +53,5 @@
extras_require={
'signals': ['blinker>=1.3,<2.0'],
},
package_data={
'pynamodb': ['py.typed'],
},
package_data=find_stubs('pynamodb'),
)

0 comments on commit e3b1ecf

Please sign in to comment.