Skip to content

Commit

Permalink
Fix 2892
Browse files Browse the repository at this point in the history
  • Loading branch information
cphyc committed Sep 23, 2020
1 parent 11c916d commit b171ab6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from distutils.version import LooseVersion

import pkg_resources
from setuptools import find_packages, setup
from setuptools import Distribution, find_packages, setup

from setupext import (
check_for_openmp,
Expand Down Expand Up @@ -84,6 +84,16 @@
# This overrides using lib_exts, so it has to happen after lib_exts is fully defined
build_ext, sdist = create_build_ext(lib_exts, cythonize_aliases)

# Force setuptools to consider that there are ext modules, even if empty.
# See https://github.com/yt-project/yt/issues/2922 and
# https://stackoverflow.com/a/62668026/2601223 for the fix.
class BinaryDistribution(Distribution):
"""Distribution which always forces a binary package with platform name."""

def has_ext_modules(foo):
return True


if __name__ == "__main__":
setup(
name="yt",
Expand Down Expand Up @@ -141,6 +151,7 @@
license="BSD 3-Clause",
zip_safe=False,
scripts=["scripts/iyt"],
distclass=BinaryDistribution,
ext_modules=[], # !!! We override this inside build_ext above
python_requires=">=3.6",
)

0 comments on commit b171ab6

Please sign in to comment.