Skip to content

Commit 6385739

Browse files
Merge pull request #2443 from hanagasira/nuget_python_fix
nuget python package error fix
2 parents 62b9bc7 + 116c515 commit 6385739

5 files changed

+30
-8
lines changed

modules/vstudio/tests/vc2010/test_ensure_nuget_imports.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
if http ~= nil and _OPTIONS["test-all"] then
4646
function suite.structureIsCorrect()
47-
nuget { "boost:1.59.0-b1", "sdl2.v140:2.0.3", "sdl2.v140.redist:2.0.3", "WinPixEventRuntime:1.0.220810001", "Microsoft.Direct3D.D3D12:1.608.2" }
47+
nuget { "boost:1.59.0-b1", "sdl2.v140:2.0.3", "sdl2.v140.redist:2.0.3", "WinPixEventRuntime:1.0.220810001", "Microsoft.Direct3D.D3D12:1.608.2", "python:3.13.2" }
4848
prepare()
4949
test.capture [[
5050
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
@@ -57,6 +57,7 @@ if http ~= nil and _OPTIONS["test-all"] then
5757
<Error Condition="!Exists('packages\WinPixEventRuntime.1.0.220810001\build\WinPixEventRuntime.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\WinPixEventRuntime.1.0.220810001\build\WinPixEventRuntime.targets'))" />
5858
<Error Condition="!Exists('packages\Microsoft.Direct3D.D3D12.1.608.2\build\native\Microsoft.Direct3D.D3D12.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Direct3D.D3D12.1.608.2\build\native\Microsoft.Direct3D.D3D12.props'))" />
5959
<Error Condition="!Exists('packages\Microsoft.Direct3D.D3D12.1.608.2\build\native\Microsoft.Direct3D.D3D12.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Direct3D.D3D12.1.608.2\build\native\Microsoft.Direct3D.D3D12.targets'))" />
60+
<Error Condition="!Exists('packages\python.3.13.2\build\native\python.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\python.3.13.2\build\native\python.props'))" />
6061
</Target>
6162
]]
6263
end

modules/vstudio/tests/vc2010/test_extension_settings.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@
3434

3535
if http ~= nil and _OPTIONS["test-all"] then
3636
function suite.importOnlyNugetPackagesWithProps()
37-
nuget { "boost:1.59.0-b1", "sdl2.v140:2.0.3", "sdl2.v140.redist:2.0.3", "WinPixEventRuntime:1.0.220810001", "Microsoft.Direct3D.D3D12:1.608.2" }
37+
nuget { "boost:1.59.0-b1", "sdl2.v140:2.0.3", "sdl2.v140.redist:2.0.3", "WinPixEventRuntime:1.0.220810001", "Microsoft.Direct3D.D3D12:1.608.2", "python:3.13.2" }
3838
prepare()
3939
test.capture [[
4040
<ImportGroup Label="ExtensionSettings">
4141
<Import Project="packages\Microsoft.Direct3D.D3D12.1.608.2\build\native\Microsoft.Direct3D.D3D12.props" Condition="Exists('packages\Microsoft.Direct3D.D3D12.1.608.2\build\native\Microsoft.Direct3D.D3D12.props')" />
42+
<Import Project="packages\python.3.13.2\build\native\python.props" Condition="Exists('packages\python.3.13.2\build\native\python.props')" />
4243
</ImportGroup>
4344
]]
4445
end

modules/vstudio/tests/vc2010/test_extension_targets.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
if http ~= nil and _OPTIONS["test-all"] then
6767
function suite.addsImport_onEachNuGetPackage()
68-
nuget { "boost:1.59.0-b1", "sdl2.v140:2.0.3", "sdl2.v140.redist:2.0.3", "WinPixEventRuntime:1.0.220810001", "Microsoft.Direct3D.D3D12:1.608.2" }
68+
nuget { "boost:1.59.0-b1", "sdl2.v140:2.0.3", "sdl2.v140.redist:2.0.3", "WinPixEventRuntime:1.0.220810001", "Microsoft.Direct3D.D3D12:1.608.2", "python:3.13.2" }
6969
prepare()
7070
test.capture [[
7171
<ImportGroup Label="ExtensionTargets">

modules/vstudio/tests/vc2010/test_nuget_packages_config.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
--
4545

4646
function suite.structureIsCorrect()
47-
nuget { "boost:1.59.0-b1", "sdl2.v140:2.0.3", "sdl2.v140.redist:2.0.3", "WinPixEventRuntime:1.0.220810001", "Microsoft.Direct3D.D3D12:1.608.2" }
47+
nuget { "boost:1.59.0-b1", "sdl2.v140:2.0.3", "sdl2.v140.redist:2.0.3", "WinPixEventRuntime:1.0.220810001", "Microsoft.Direct3D.D3D12:1.608.2", "python:3.13.2" }
4848
prepare()
4949
test.capture [[
5050
<?xml version="1.0" encoding="utf-8"?>
@@ -54,6 +54,7 @@
5454
<package id="sdl2.v140.redist" version="2.0.3" targetFramework="native" />
5555
<package id="WinPixEventRuntime" version="1.0.220810001" targetFramework="native" />
5656
<package id="Microsoft.Direct3D.D3D12" version="1.608.2" targetFramework="native" />
57+
<package id="python" version="3.13.2" targetFramework="native" />
5758
</packages>
5859
]]
5960
end

modules/vstudio/vs2010_nuget.lua

+23-4
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,30 @@
224224

225225
for _, page in ipairs(response.items) do
226226
if not page.items or #page.items == 0 then
227-
p.error("Failed to understand NuGet API response (got a page with no items for package '%s')", id)
228-
end
227+
local itemResponse, err, code = http.get(page["@id"])
228+
if err ~= "OK" then
229+
if code == 404 then
230+
p.error("NuGet package '%s' for project '%s' couldn't be found in the repository", id, prj.name)
231+
else
232+
p.error("NuGet API error (%d)\n%s", code, err)
233+
end
234+
end
229235

230-
for _, item in ipairs(page.items) do
231-
table.insert(items, item)
236+
itemResponse, err = json.decode(itemResponse)
237+
if not itemResponse then
238+
p.error("Failed to decode NuGet API response (%s)", err)
239+
end
240+
if not itemResponse.items or #itemResponse.items == 0 then
241+
p.error("Failed to understand NuGet API response (got a page with no items for package '%s')", id)
242+
end
243+
244+
for _, item in ipairs(itemResponse.items) do
245+
table.insert(items, item)
246+
end
247+
else
248+
for _, item in ipairs(page.items) do
249+
table.insert(items, item)
250+
end
232251
end
233252
end
234253

0 commit comments

Comments
 (0)