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

Use a devpi host Windows can handle. #2697

Merged
merged 1 commit into from
Feb 25, 2025
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
2 changes: 1 addition & 1 deletion testing/bin/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def main():
parser.add_argument(
"--devpi-host",
type=str,
default="0.0.0.0",
default="127.0.0.1",
help="The domain/ip address to have the local devpi server listen on.",
)
parser.add_argument(
Expand Down
36 changes: 21 additions & 15 deletions tests/integration/cli/commands/test_lock_resolve_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from pex.common import safe_rmtree
from pex.compatibility import PY2
from pex.pip.version import PipVersion
from pex.typing import TYPE_CHECKING
from testing import IntegResults, make_env, run_pex_command
from testing.cli import run_pex3
Expand Down Expand Up @@ -57,7 +58,7 @@ def do_GET(self):
self.send_header("WWW-Authenticate", 'Basic realm="Foo"')
self.end_headers()

server = HTTPServer(("", 0), BasicHTTPAuthHandler)
server = HTTPServer(("127.0.0.1", 0), BasicHTTPAuthHandler)
server_dispatch_thread = Thread(target=server.serve_forever)
server_dispatch_thread.daemon = True
cwd = os.getcwd()
Expand All @@ -73,22 +74,29 @@ def do_GET(self):


@pytest.fixture(scope="module")
def ansicolors_find_links_directory(
def ansicolors_and_pip_find_links_directory(
tmpdir_factory, # type: TempdirFactory
request, # type: Any
):
# type: (...) -> str
find_links = str(tmpdir_factory.mktemp("find_links", request=request))

requirements = ["ansicolors==1.1.8"]
if PipVersion.DEFAULT is not PipVersion.VENDORED:
requirements.extend(map(str, PipVersion.DEFAULT.requirements))

run_pex_command(
args=[
"ansicolors==1.1.8",
"--include-tools",
"--",
"repository",
"extract",
"--find-links",
find_links,
],
args=(
requirements
+ [
"--include-tools",
"--",
"repository",
"extract",
"--find-links",
find_links,
]
),
env=make_env(PEX_TOOLS=1),
).assert_success()
return find_links
Expand Down Expand Up @@ -122,7 +130,7 @@ def repo_url_with_credentials(self):

@pytest.fixture
def secured_ansicolors_lock(
ansicolors_find_links_directory, # type: str
ansicolors_and_pip_find_links_directory, # type: str
tmpdir, # type: Any
):
# type: (...) -> Iterator[SecuredLock]
Expand All @@ -132,7 +140,7 @@ def secured_ansicolors_lock(
with serve_authenticated(
username=username,
password=password,
find_links=ansicolors_find_links_directory,
find_links=ansicolors_and_pip_find_links_directory,
) as address:
lock = os.path.join(str(tmpdir), "lock")
pex_root = os.path.join(str(tmpdir), "pex_root")
Expand All @@ -152,8 +160,6 @@ def secured_ansicolors_lock(
"--no-pypi",
"--find-links",
secured_lock.repo_url_with_credentials,
# Since we have no PyPI access, ensure we're using vendored Pip for this test.
"--pip-version=vendored",
"ansicolors",
"--indent",
"2",
Expand Down
Loading