Skip to content

Commit 534a9ae

Browse files
authored
Exclude tests from package discovery (#6552)
* Clean up MANIFEST.in * Remove useless option from setup.py * Exclude tests from package discovery * Make get_data not look at local files anymore This seems to be a relic of the past when `tests/data` contained data files. It is not the case anymore.
1 parent b57cabe commit 534a9ae

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

MANIFEST.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
recursive-include tests/data *
2-
recursive-include source *
3-
# because of an upload-size limit by PyPI, we're temporarily removing docs from the tarball:
4-
recursive-exclude docs *
51
include requirements.txt
62
include *.md *.rst
73
include scripts/*.sh

pymc/data.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
# limitations under the License.
1414

1515
import io
16-
import os
17-
import pkgutil
1816
import urllib.request
1917
import warnings
2018

@@ -63,12 +61,8 @@ def get_data(filename):
6361
-------
6462
BytesIO of the data
6563
"""
66-
data_pkg = "tests"
67-
try:
68-
content = pkgutil.get_data(data_pkg, os.path.join("data", filename))
69-
except FileNotFoundError:
70-
with urllib.request.urlopen(BASE_URL.format(filename=filename)) as handle:
71-
content = handle.read()
64+
with urllib.request.urlopen(BASE_URL.format(filename=filename)) as handle:
65+
content = handle.read()
7266
return io.BytesIO(content)
7367

7468

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,10 @@
6565
url=URL,
6666
long_description=LONG_DESCRIPTION,
6767
long_description_content_type="text/x-rst",
68-
packages=find_packages(),
68+
packages=find_packages(exclude=["tests*"]),
6969
# because of an upload-size limit by PyPI, we're temporarily removing docs from the tarball.
7070
# Also see MANIFEST.in
7171
# package_data={'docs': ['*']},
72-
include_package_data=True,
7372
classifiers=classifiers,
7473
python_requires=">=3.8",
7574
install_requires=install_reqs,

0 commit comments

Comments
 (0)