Skip to content

Commit 2137040

Browse files
committed
Maybe this?
1 parent 4a415c5 commit 2137040

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

setup.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"""
4242
import contextlib
4343
import os
44-
import sys
4544
import tempfile
4645
from importlib.util import module_from_spec, spec_from_file_location
4746
from types import ModuleType
@@ -116,8 +115,8 @@ def _set_manifest_path(manifest_dir: str, aggregate: bool = False) -> Generator:
116115
setup_tools = _load_py_module(name="setup_tools", location=os.path.join(_PATH_ROOT, ".actions", "setup_tools.py"))
117116
assistant = _load_py_module(name="assistant", location=os.path.join(_PATH_ROOT, ".actions", "assistant.py"))
118117

119-
is_wheel_install = "sdist" not in sys.argv and "bdist_wheel" not in sys.argv and not os.path.exists(_PATH_SRC)
120-
print("is_wheel_install:", is_wheel_install, sys.argv)
118+
is_wheel_install = not os.path.exists(_PATH_SRC) or "PEP517_BUILD_BACKEND" in os.environ
119+
print("is_wheel_install:", is_wheel_install)
121120

122121
if not is_wheel_install:
123122
# copy the version information to all packages
@@ -136,7 +135,7 @@ def _set_manifest_path(manifest_dir: str, aggregate: bool = False) -> Generator:
136135
# if it's a wheel, iterate over all possible packages until we find one that can be installed.
137136
# the wheel should have included only the relevant files of the package to install
138137
possible_packages = (
139-
_PACKAGE_MAPPING.values() if _PACKAGE_NAME is None or is_wheel_install else [_PACKAGE_MAPPING[_PACKAGE_NAME]]
138+
_PACKAGE_MAPPING.values() if _PACKAGE_NAME is None and is_wheel_install else [_PACKAGE_MAPPING[_PACKAGE_NAME]]
140139
)
141140
for pkg in possible_packages:
142141
pkg_path = os.path.join(_PATH_SRC, pkg)

0 commit comments

Comments
 (0)