Updated PyPI notes.

This commit is contained in:
Joe Testa 2020-07-11 12:42:11 -04:00
parent f80e3f22ce
commit 8e3f3c6044
2 changed files with 16 additions and 2 deletions

View File

@ -7,7 +7,7 @@ $ virtualenv -p /usr/bin/python3 /tmp/pypi_upload
$ cd /tmp/pypi_upload; source bin/activate
$ pip3 install twine
$ cp -R path/to/ssh-audit .
$ cd ssh-audit/pypi
$ cd ssh-audit/packages
$ make -f Makefile.pypi
$ make -f Makefile.pypi uploadtest

View File

@ -2,10 +2,21 @@
import re
import sys
from setuptools import setup
print_warning = False
m = re.search(r'^VERSION\s*=\s*\'v(\d\.\d\.\d)\'', open('sshaudit/sshaudit.py').read(), re.M)
if m is None:
# If we failed to parse the stable version, see if this is the development version.
m = re.search(r'^VERSION\s*=\s*\'v(\d\.\d\.\d-dev)\'', open('sshaudit/sshaudit.py').read(), re.M)
if m is None:
print("Error: could not parse VERSION variable from ssh-audit.py.")
sys.exit(1)
else: # Continue with the development version, but print a warning later.
print_warning = True
version = re.search(r'^VERSION\s*=\s*\'v(\d\.\d\.\d)\'', open('sshaudit/sshaudit.py').read(), re.M).group(1)
version = m.group(1)
print("\n\nPackaging ssh-audit v%s...\n\n" % version)
with open("sshaudit/README.md", "rb") as f:
@ -42,3 +53,6 @@ setup(
"Topic :: Security",
"Topic :: Security :: Cryptography"
])
if print_warning:
print("\n\n !!! WARNING: development version detected (%s). Are you sure you want to package this version? Probably not...\n" % version)