Skip to content

Commit c7c6077

Browse files
committed
lint
1 parent 5903c07 commit c7c6077

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed

.github/workflows/windows_wheel.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ jobs:
188188
189189
# Prepare conda
190190
set +x && eval "$($(which conda) shell.bash hook)" && set -x
191-
191+
192192
echo '::group::Create build environment'
193193
conda create \
194194
--name ci \
@@ -199,29 +199,29 @@ jobs:
199199
200200
# Install PyTorch
201201
python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
202-
202+
203203
# Install build dependencies
204204
conda install cmake pkg-config pybind11 "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge
205-
205+
206206
# Ensure FFmpeg DLLs are in PATH for Windows
207207
conda_env_path=$(conda info --base)/envs/ci
208208
library_bin_path="$conda_env_path/Library/bin"
209209
echo "Adding conda Library/bin to PATH: $library_bin_path"
210210
echo "$library_bin_path" >> $GITHUB_PATH
211-
211+
212212
# Verify FFmpeg is available
213213
ffmpeg -version
214-
214+
215215
# Install torchcodec from source in development mode
216216
pip install -e ".[dev]" --no-build-isolation -vv
217-
217+
218218
# Add torchcodec source directory to DLL search path for Windows
219219
torchcodec_dll_path="$(pwd)/src/torchcodec"
220220
echo "Adding torchcodec DLL path: $torchcodec_dll_path"
221221
export PATH="$torchcodec_dll_path:$PATH"
222-
222+
223223
# Test torchcodec import with detailed error reporting
224224
python -c "import torch; import torchcodec"
225-
225+
226226
# Run tests
227227
pytest test -vvv

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,14 @@ def _build_all_extensions_with_cmake(self):
135135
["cmake", str(_ROOT_DIR)] + cmake_args, cwd=self.build_temp
136136
)
137137
print("Calling cmake --build", flush=True)
138-
subprocess.check_call(["cmake", "--build", ".","--config",cmake_build_type], cwd=self.build_temp)
138+
subprocess.check_call(
139+
["cmake", "--build", ".", "--config", cmake_build_type], cwd=self.build_temp
140+
)
139141
print("Calling cmake --install", flush=True)
140-
subprocess.check_call(["cmake", "--install", ".","--config",cmake_build_type], cwd=self.build_temp)
142+
subprocess.check_call(
143+
["cmake", "--install", ".", "--config", cmake_build_type],
144+
cwd=self.build_temp,
145+
)
141146

142147
def copy_extensions_to_source(self):
143148
"""Copy built extensions from temporary folder back into source tree.

src/torchcodec/_core/ops.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
import io
88
import json
9-
import os
10-
import sys
119
import warnings
1210
from types import ModuleType
1311
from typing import List, Optional, Tuple, Union
@@ -49,27 +47,20 @@ def load_torchcodec_shared_libraries():
4947
custom_ops_library_name = f"libtorchcodec_custom_ops{ffmpeg_major_version}"
5048
pybind_ops_library_name = f"libtorchcodec_pybind_ops{ffmpeg_major_version}"
5149
try:
52-
print(f"Loading {decoder_library_name}", flush=True)
5350
torch.ops.load_library(_get_extension_path(decoder_library_name))
54-
print(f"successfully loaded {decoder_library_name}", flush=True)
55-
56-
print(f"Loading {custom_ops_library_name}", flush=True)
5751
torch.ops.load_library(_get_extension_path(custom_ops_library_name))
58-
print(f"successfully loaded {custom_ops_library_name}", flush=True)
5952

60-
print(f"Loading {pybind_ops_library_name}", flush=True)
6153
pybind_ops_library_path = _get_extension_path(pybind_ops_library_name)
6254
global _pybind_ops
6355
_pybind_ops = _load_pybind11_module(
6456
pybind_ops_module_name, pybind_ops_library_path
6557
)
66-
print(f"successfully loaded {pybind_ops_library_name}", flush=True)
6758
return
6859
except Exception as e:
6960
# TODO: recording and reporting exceptions this way is OK for now as it's just for debugging,
7061
# but we should probably handle that via a proper logging mechanism.
7162
exceptions.append((ffmpeg_major_version, e))
72-
63+
7364
traceback = (
7465
"\n[start of libtorchcodec loading traceback]\n"
7566
+ "\n".join(f"FFmpeg version {v}: {str(e)}" for v, e in exceptions)

0 commit comments

Comments
 (0)