Skip to content

Commit 5f90e62

Browse files
authored
Fix pypi uploads from appveyor (#26)
1 parent ee6971c commit 5f90e62

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

Diff for: .appveyor.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,6 @@ artifacts:
8383
- path: "*.whl"
8484

8585
deploy_script:
86-
- "%PYTHON_DEF%\\python.exe ci/appveyor/pypi_upload.py *.whl"
86+
# Calling twine requires we set path
87+
- "SET PATH=%PYTHON_DEF%;%PYTHON_DEF%\\Scripts;%PATH%"
88+
- python ci/appveyor/pypi_upload.py *.whl

Diff for: Changelog.rst

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Changes
1717

1818
* Added function for setting GSS-API credentials delegation option to session.
1919
* Updated error handling for all user authentication session functions to raise specific authentication errors.
20+
* `ssh.Key.import_privkey_*` now defaults to empty passphrase.
2021

2122

2223
0.5.0

Diff for: ci/appveyor/pypi_upload.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@
44

55

66
def upload_pypi(files):
7-
repo_tag = os.environ['APPVEYOR_REPO_TAG']
7+
repo_tag = os.environ.get('APPVEYOR_REPO_TAG', 'false')
88
if repo_tag == 'false':
99
sys.stderr.write("Not a tagged release, skipping upload" + os.linesep)
1010
return
11-
_user, _pass = os.environ['PYPI_USER'], os.environ['PYPI_PASS']
12-
try:
13-
subprocess.check_call(['twine', 'upload', '-u', _user,
14-
'-p', _pass, files])
15-
except Exception:
11+
_user, _pass = os.environ.get('PYPI_USER'), os.environ.get('PYPI_PASS')
12+
if not _user or not _pass:
13+
sys.stderr.write("No PyPi credentials set" + os.linesep)
14+
sys.exit(1)
15+
proc = subprocess.run(['twine', 'upload', '-u', _user,
16+
'-p', _pass, files])
17+
if proc.returncode:
1618
sys.stderr.write("Error uploading to PyPi" + os.linesep)
19+
sys.exit(1)
1720

1821

1922
if __name__ == "__main__":

0 commit comments

Comments
 (0)