Skip to content

Commit b3e4582

Browse files
committed
Update
[ghstack-poisoned]
2 parents 33cbd3e + 4db9d92 commit b3e4582

File tree

2 files changed

+4
-27
lines changed

2 files changed

+4
-27
lines changed

.github/unittest/linux_olddeps/scripts_gym_0_13/environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,3 @@ dependencies:
2828
- av
2929
- h5py
3030
- numpy<2.0.0
31-
- pybind11[global]

setup.py

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,6 @@
1818
logger = logging.getLogger(__name__)
1919

2020
ROOT_DIR = Path(__file__).parent.resolve()
21-
22-
23-
def _check_pybind11():
24-
"""Check that pybind11 is installed and provide a clear error message if not.
25-
26-
Only checks when actually building extensions, not for commands like 'clean'.
27-
"""
28-
# Commands that don't require building C++ extensions
29-
skip_commands = {"clean", "egg_info", "sdist", "--version", "--help", "-h"}
30-
if skip_commands.intersection(sys.argv):
31-
return
32-
if importlib.util.find_spec("pybind11") is None:
33-
raise RuntimeError(
34-
"pybind11 is required to build TorchRL's C++ extensions but was not found.\n"
35-
"Please install it with:\n"
36-
" pip install 'pybind11[global]'\n"
37-
"Then re-run the installation."
38-
)
39-
40-
41-
_check_pybind11()
4221
_RELEASE_BRANCH_RE = re.compile(r"^release/v(?P<release_id>.+)$")
4322
_BUILD_INFO_FILE = ROOT_DIR / "build" / ".torchrl_build_info.json"
4423

@@ -68,14 +47,13 @@ def _check_and_clean_stale_builds():
6847
f"Python {old_python} -> {current_python_version}. "
6948
f"Cleaning stale build artifacts..."
7049
)
71-
# Clean stale extension files for current Python version
72-
ext = ".pyd" if sys.platform == "win32" else ".so"
73-
ext_pattern = (
50+
# Clean stale .so files for current Python version
51+
so_pattern = (
7452
ROOT_DIR
7553
/ "torchrl"
76-
/ f"_torchrl.cpython-{sys.version_info.major}{sys.version_info.minor}*{ext}"
54+
/ f"_torchrl.cpython-{sys.version_info.major}{sys.version_info.minor}*.so"
7755
)
78-
for so_file in glob.glob(str(ext_pattern)):
56+
for so_file in glob.glob(str(so_pattern)):
7957
logger.warning(f"Removing stale: {so_file}")
8058
os.remove(so_file)
8159
# Clean build directory

0 commit comments

Comments
 (0)