Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix/2892 #2922

Merged
merged 2 commits into from
Sep 23, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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):
neutrinoceros marked this conversation as resolved.
Show resolved Hide resolved
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",
)