Skip to content

Commit

Permalink
Add py_modules=[] to setup() to disable automatic discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
skatsuta committed Jul 21, 2023
1 parent c2471de commit d8c524e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,15 @@ def setup_package():
python_requires=">=3.6",
install_requires=min_deps.tag_to_packages['install'],
package_data={'': ['*.pxd']},
# Because the scikit-learn repository contains multiple top-level directories,
# automatic discovery of the package layout does not work properly
# and the package cannot be compiled by default.
# Ref. https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#automatic-discovery
#
# Therefore, disable automatic discovery by specifying an empty array
# for the py_modules argument, as per the following comment:
# https://github.com/pypa/setuptools/issues/3197#issuecomment-1078770109
py_modules=[],
**extra_setuptools_args)

commands = [arg for arg in sys.argv[1:] if not arg.startswith('-')]
Expand Down

0 comments on commit d8c524e

Please sign in to comment.