Skip to content

Commit db11fd5

Browse files
authored
Fix upload script (#26)
1 parent 16a13bd commit db11fd5

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

ci/release.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
#
44
# This build can run for every commit, as by default it does no signing.
55
# When run manually, signing should be enabled.
6-
#
7-
# Releases must be uploaded manually - the 'Publish' option has no effect.
86

97
name: $(Date:yyyyMMdd).$(Rev:r)
108

ci/upload.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import subprocess
33
import sys
44
from pathlib import Path
5+
from urllib import Request, urlopen
56
from xml.etree import ElementTree as ET
67

78
UPLOAD_URL_PREFIX = os.getenv("UPLOAD_URL_PREFIX", "https://www.python.org/ftp/")
@@ -76,7 +77,7 @@ def _run(*args):
7677

7778

7879
def call_ssh(*args, allow_fail=True):
79-
if not UPLOAD_HOST or NO_UPLOAD or LOCAL_INDEX:
80+
if not UPLOAD_HOST or NO_UPLOAD:
8081
print("Skipping", args, "because UPLOAD_HOST is missing")
8182
return
8283
try:
@@ -87,7 +88,7 @@ def call_ssh(*args, allow_fail=True):
8788

8889

8990
def upload_ssh(source, dest):
90-
if not UPLOAD_HOST or NO_UPLOAD or LOCAL_INDEX:
91+
if not UPLOAD_HOST or NO_UPLOAD:
9192
print("Skipping upload of", source, "because UPLOAD_HOST is missing")
9293
return
9394
_run(*_std_args(PSCP), source, f"{UPLOAD_USER}@{UPLOAD_HOST}:{dest}")
@@ -103,7 +104,7 @@ def download_ssh(source, dest):
103104

104105

105106
def ls_ssh(dest):
106-
if not UPLOAD_HOST or LOCAL_INDEX:
107+
if not UPLOAD_HOST:
107108
print("Skipping ls of", dest, "because UPLOAD_HOST is missing")
108109
return
109110
try:
@@ -120,8 +121,6 @@ def url2path(url):
120121
if not url:
121122
raise ValueError("Unexpected empty URL")
122123
if not url.startswith(UPLOAD_URL_PREFIX):
123-
if LOCAL_INDEX:
124-
return url
125124
raise ValueError(f"Unexpected URL: {url}")
126125
return UPLOAD_PATH_PREFIX + url[len(UPLOAD_URL_PREFIX) :]
127126

0 commit comments

Comments
 (0)