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]>
This commit is contained in:
co-authored by
Shurong Cao
Matthieu Darbois
parent
885ead0d98
commit
59501f4368
@@ -81,8 +81,6 @@ def get_nuget_args(
|
||||
package_name,
|
||||
"-Version",
|
||||
version,
|
||||
"-FallbackSource",
|
||||
"https://api.nuget.org/v3/index.json",
|
||||
"-OutputDirectory",
|
||||
str(output_directory),
|
||||
]
|
||||
|
||||
@@ -8,7 +8,11 @@ import setuptools._distutils.util
|
||||
|
||||
from cibuildwheel.ci import CIProvider, detect_ci_provider
|
||||
from cibuildwheel.errors import FatalError
|
||||
from cibuildwheel.platforms.windows import PythonConfiguration, setup_setuptools_cross_compile
|
||||
from cibuildwheel.platforms.windows import (
|
||||
PythonConfiguration,
|
||||
get_nuget_args,
|
||||
setup_setuptools_cross_compile,
|
||||
)
|
||||
|
||||
TYPE_CHECKING = False
|
||||
if TYPE_CHECKING:
|
||||
@@ -30,6 +34,20 @@ def patched_environment(
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("arch", "free_threaded", "package_name"),
|
||||
[("AMD64", False, "python"), ("ARM64", True, "pythonarm64-freethreaded")],
|
||||
)
|
||||
def test_get_nuget_args(arch: str, free_threaded: bool, package_name: str, tmp_path: Path) -> None:
|
||||
assert get_nuget_args("3.14.1", arch, free_threaded, tmp_path) == [
|
||||
package_name,
|
||||
"-Version",
|
||||
"3.14.1",
|
||||
"-OutputDirectory",
|
||||
str(tmp_path),
|
||||
]
|
||||
|
||||
|
||||
def test_x86(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
environment: dict[str, str] = {}
|
||||
configuration = PythonConfiguration(version="irrelevant", identifier="cp314-win32", url=None)
|
||||
|
||||
Reference in New Issue
Block a user