Skip to content

Commit 59501f4

Browse files
CAOShurongmayeut
andauthored
Respect configured NuGet package sources (#2966)
* fix: respect configured NuGet package sources * test: use concise NuGet args name --------- Co-authored-by: Shurong Cao <[email protected]> Co-authored-by: Matthieu Darbois <[email protected]>
1 parent 885ead0 commit 59501f4

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

‎cibuildwheel/platforms/windows.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ def get_nuget_args(
8181
package_name,
8282
"-Version",
8383
version,
84-
"-FallbackSource",
85-
"https://api.nuget.org/v3/index.json",
8684
"-OutputDirectory",
8785
str(output_directory),
8886
]

‎unit_test/get_platform_test.py‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88

99
from cibuildwheel.ci import CIProvider, detect_ci_provider
1010
from cibuildwheel.errors import FatalError
11-
from cibuildwheel.platforms.windows import PythonConfiguration, setup_setuptools_cross_compile
11+
from cibuildwheel.platforms.windows import (
12+
PythonConfiguration,
13+
get_nuget_args,
14+
setup_setuptools_cross_compile,
15+
)
1216

1317
TYPE_CHECKING = False
1418
if TYPE_CHECKING:
@@ -30,6 +34,20 @@ def patched_environment(
3034
yield
3135

3236

37+
@pytest.mark.parametrize(
38+
("arch", "free_threaded", "package_name"),
39+
[("AMD64", False, "python"), ("ARM64", True, "pythonarm64-freethreaded")],
40+
)
41+
def test_get_nuget_args(arch: str, free_threaded: bool, package_name: str, tmp_path: Path) -> None:
42+
assert get_nuget_args("3.14.1", arch, free_threaded, tmp_path) == [
43+
package_name,
44+
"-Version",
45+
"3.14.1",
46+
"-OutputDirectory",
47+
str(tmp_path),
48+
]
49+
50+
3351
def test_x86(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
3452
environment: dict[str, str] = {}
3553
configuration = PythonConfiguration(version="irrelevant", identifier="cp314-win32", url=None)

0 commit comments

Comments
 (0)