From 73c7c435b867f1db6d156d6359bcae471fc69152 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: May 08 2019 21:28:46 +0000 Subject: Python3, and tox. Signed-off-by: Ralph Bean --- diff --git a/.gitignore b/.gitignore index 0d20b64..ee14752 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ *.pyc +.eggs +.tox +robosignatory.egg-info diff --git a/README.rst b/README.rst index 60da5e3..16bead7 100644 --- a/README.rst +++ b/README.rst @@ -11,6 +11,12 @@ RoboSignatory is composed of multiple consumers: - AtomicConsumer is a consumer that listens for messages about composed rpmostree trees and signs those, optionally updating the tag. +Development +----------- + +Run the tests with:: + + $ tox Signing Configuration --------------------- diff --git a/robosignatory/cli.py b/robosignatory/cli.py index 4ecafd9..899a023 100644 --- a/robosignatory/cli.py +++ b/robosignatory/cli.py @@ -12,13 +12,13 @@ logging.basicConfig(level=logging.INFO) def tagsigner(): if len(sys.argv) not in [4, 5]: - print 'Usage: %s [--tag]' % sys.argv[0] + print('Usage: %s [--tag]' % sys.argv[0]) sys.exit(1) skiptag = True if len(sys.argv) == 5: if sys.argv[4] != '--tag': - print 'Usage: %s [--tag]' % sys.argv[0] + print('Usage: %s [--tag]' % sys.argv[0]) sys.exit(1) skiptag = False @@ -32,7 +32,7 @@ def tagsigner(): def atomicsigner(): if len(sys.argv) not in [3, 4]: - print 'Usage: %s [--ref-update]' % sys.argv[0] + print('Usage: %s [--ref-update]' % sys.argv[0]) sys.exit(1) ref = sys.argv[1] @@ -41,7 +41,7 @@ def atomicsigner(): doref = False if len(sys.argv) == 4: if sys.argv[3] != '--ref-update': - print 'Usage: %s [--ref-update]' % sys.argv[0] + print('Usage: %s [--ref-update]' % sys.argv[0]) sys.exit(1) doref = True @@ -51,7 +51,7 @@ def atomicsigner(): signer = utils.get_signing_helper(**signing_config) if ref not in config['robosignatory.ostree_refs']: - print 'Ref %s not found' % ref + print('Ref %s not found' % ref) sys.exit(1) val = config['robosignatory.ostree_refs'][ref] diff --git a/setup.py b/setup.py index 9bc64eb..7aeb103 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,12 @@ setup( license='gplv2+', install_requires=[ "fedmsg", + "koji", + "psutil", + "moksha.hub", + ], + tests_require=[ + "nose", ], packages=[ 'robosignatory', diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..32ff2e5 --- /dev/null +++ b/tox.ini @@ -0,0 +1,8 @@ +[tox] +envlist = py27,py37,py38 +# If the user is missing an interpreter, don't fail +skip_missing_interpreters = True + +[testenv] +commands = + python setup.py test