Skip to content

Commit 4358d64

Browse files
author
Sylvain MARIE
committed
setup.py improvements: now including py.typed, excluding tests folder, and using zip_safe=False
1 parent 5824cb4 commit 4358d64

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

autoclass/py.typed

Whitespace-only changes.

setup.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102

103103
# You can just specify the packages manually here if your project is
104104
# simple. Or you can use find_packages().
105-
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
105+
packages=find_packages(exclude=['contrib', 'docs', '*tests*']),
106106

107107
# Alternatively, if you want to distribute just a my_module.py, uncomment
108108
# this:
@@ -130,14 +130,16 @@
130130
# $ pip install -e .[dev,test]
131131
extras_require=EXTRAS_REQUIRE,
132132

133-
obsoletes=OBSOLETES
133+
obsoletes=OBSOLETES,
134134

135135
# If there are data files included in your packages that need to be
136136
# installed, specify them here. If using Python 2.6 or less, then these
137137
# have to be included in MANIFEST.in as well.
138-
# package_data={
139-
# 'sample': ['package_data.dat'],
140-
# },
138+
# Note: we use the empty string so that this also works with submodules
139+
package_data={"": ['py.typed', '*.pyi']},
140+
# IMPORTANT: DO NOT set the `include_package_data` flag !! It triggers inclusion of all git-versioned files
141+
# see https://github.com/pypa/setuptools_scm/issues/190#issuecomment-351181286
142+
# include_package_data=True,
141143

142144
# Although 'package_data' is the preferred approach, in some case you may
143145
# need to place data files outside of your packages. See:
@@ -153,4 +155,10 @@
153155
# 'sample=sample:main',
154156
# ],
155157
# },
158+
159+
# explicitly setting the flag to avoid `ply` being downloaded
160+
# see https://github.com/smarie/python-getversion/pull/5
161+
# and to make mypy happy
162+
# see https://mypy.readthedocs.io/en/latest/installed_packages.html
163+
zip_safe=False,
156164
)

0 commit comments

Comments
 (0)