main
py 33 lines 1.12 KB
Raw
1 # SPDX-License-Identifier: Apache-2.0
2 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 """Generates specialized requirements files for nightly PyTorch testing.
4
5 This script reads the main test requirements input file (`requirements/test/cuda.in`)
6 and splits its content into two files:
7 1. `requirements/test/nightly-torch.txt`: Contains dependencies
8 except PyTorch-related.
9 2. `torch_nightly_test.txt`: Contains only PyTorch-related packages.
10 """
11
12 input_file = "requirements/test/cuda.in"
13 output_file = "requirements/test/nightly-torch.txt"
14
15 # white list of packages that are not compatible with PyTorch nightly directly
16 # with pip install. Please add your package to this list if it is not compatible
17 # or make the dependency test fails.
18 white_list = ["torch", "torchaudio", "torchvision", "mamba_ssm"]
19
20 with open(input_file) as f:
21 lines = f.readlines()
22
23 skip_next = False
24
25 for line in lines:
26 if skip_next:
27 if line.startswith((" ", "\t")) or line.strip() == "":
28 continue
29 skip_next = False
30
31 if any(k in line.lower() for k in white_list):
32 skip_next = True
33 continue