Skip to content

Commit f2188ac

Browse files
authored
Upload timeout fix (#200)
1 parent 2673f21 commit f2188ac

File tree

3 files changed

+36
-15
lines changed

3 files changed

+36
-15
lines changed

appveyor.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,6 @@ artifacts:
8181
- path: keywords/keywords.xml
8282
name: keywords.xml
8383
deploy_script:
84-
- ps: |
85-
if($env:APPVEYOR_REPO_TAG -eq 'true') {
86-
Write-Output ("Deploying " + $env:APPVEYOR_REPO_TAG_NAME + " to PyPI...")
87-
88-
python -m twine upload --skip-existing dist/*.whl
89-
90-
python -m twine upload --skip-existing dist/*.tar.gz
91-
92-
} else {
93-
Write-Output "No tag for deployment"
94-
}
84+
- ps: .\deploy.ps1
9585
on_finish:
96-
- ps: >-
97-
$wc = New-Object 'System.Net.WebClient'
98-
99-
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\result\xunit.xml))
86+
- ps: .\testreport.ps1

deploy.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
if($env:APPVEYOR_REPO_TAG -eq 'true') {
2+
Write-Output ("Deploying " + $env:APPVEYOR_REPO_TAG_NAME + " to PyPI...")
3+
python -m twine upload --skip-existing dist/*.whl
4+
python -m twine upload --skip-existing dist/*.tar.gz
5+
}
6+
else
7+
{
8+
Write-Output "No tag for deployment"
9+
}

testreport.ps1

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
$Source = @"
2+
using System.Net;
3+
4+
public class ExtendedWebClient : WebClient {
5+
public int Timeout;
6+
7+
protected override WebRequest GetWebRequest(System.Uri address) {
8+
WebRequest request = base.GetWebRequest(address);
9+
if (request != null) {
10+
request.Timeout = Timeout;
11+
}
12+
return request;
13+
}
14+
15+
public ExtendedWebClient() {
16+
Timeout = 100000;
17+
}
18+
}
19+
"@;
20+
21+
Add-Type -TypeDefinition $Source -Language CSharp
22+
23+
$webClient = New-Object ExtendedWebClient;
24+
$webClient.Timeout = 300000;
25+
$webClient.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\result\xunit.xml))

0 commit comments

Comments
 (0)