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

always use --index-url #141

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 6 additions & 12 deletions light_the_torch/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import itertools
import optparse
import os
import platform
import re
import sys
import unittest.mock
Expand Down Expand Up @@ -253,7 +252,7 @@ def postprocessing(input, output):
yield


def get_extra_index_urls(computation_backends, channel):
def get_index_urls(computation_backends, channel):
if channel == Channel.STABLE:
channel_paths = [""]
else:
Expand Down Expand Up @@ -284,9 +283,7 @@ def context(input):
{
requirement.name
for requirement in input.root_reqs
if requirement.user_supplied
and not is_pinned(requirement)
and requirement.name in THIRD_PARTY_PACKAGES
if requirement.user_supplied and is_pinned(requirement)
},
):
yield
Expand All @@ -305,12 +302,10 @@ def context(input):


@contextlib.contextmanager
def patch_link_collection(
computation_backends, channel, user_supplied_third_party_packages
):
def patch_link_collection(computation_backends, channel, user_supplied_pinned_packages):
search_scope = SearchScope(
find_links=[],
index_urls=get_extra_index_urls(computation_backends, channel),
index_urls=get_index_urls(computation_backends, channel),
no_index=False,
)

Expand All @@ -319,9 +314,8 @@ def context(input):
if not (
input.project_name in PYTORCH_DISTRIBUTIONS
or (
channel == Channel.NIGHTLY
and platform.system() == "Linux"
and input.project_name not in user_supplied_third_party_packages
input.project_name in THIRD_PARTY_PACKAGES
and input.project_name not in user_supplied_pinned_packages
)
):
yield
Expand Down
9 changes: 4 additions & 5 deletions scripts/check_pytorch_package_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from light_the_torch._cb import _MINIMUM_DRIVER_VERSIONS, CPUBackend, CUDABackend
from light_the_torch._patch import (
Channel,
get_extra_index_urls,
get_index_urls,
PYTORCH_DISTRIBUTIONS,
THIRD_PARTY_PACKAGES,
)
Expand Down Expand Up @@ -40,19 +40,18 @@
}
COMPUTATION_BACKENDS.add(CPUBackend())

EXTRA_INDEX_URLS = sorted(
INDEX_URLS = sorted(
set(
itertools.chain.from_iterable(
get_extra_index_urls(COMPUTATION_BACKENDS, channel)
for channel in iter(Channel)
get_index_urls(COMPUTATION_BACKENDS, channel) for channel in iter(Channel)
)
)
)


def main():
available = set()
for url in tqdm.tqdm(EXTRA_INDEX_URLS):
for url in tqdm.tqdm(INDEX_URLS):
response = requests.get(url)
if not response.ok:
continue
Expand Down
Loading