Skip to content

Commit

Permalink
Updated PyPI notes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtesta committed Jul 11, 2020
1 parent f80e3f2 commit 8e3f3c6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 15 additions & 1 deletion packages/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -42,3 +53,6 @@
"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)

0 comments on commit 8e3f3c6

Please sign in to comment.