From b833de13258dd24b5843954c12d32c4a04ae07f5 Mon Sep 17 00:00:00 2001 From: Jeff Knupp Date: Mon, 21 Apr 2014 16:05:44 -0400 Subject: [PATCH] Fix missing requirement for Flask-HTTPAuth (fixes #72) --- README.md | 4 ++++ README.rst | 6 ++++++ sandman/sandmanctl.py | 20 +++++++++++++++----- setup.py | 1 + tox.ini | 1 + 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8d41b4e..27c8a7a 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,10 @@ Questions or comments about `sandman`? Hit me up at [jeff@jeffknupp.com](mailto: # Changelog +## Version 0.9.4 + +* Fixes a critical bug in the requirements portion of `setup.py`, adding `Flask-HTTPAuth` + ## Version 0.9.3 * Authentication supported! diff --git a/README.rst b/README.rst index 658ded8..0c42345 100644 --- a/README.rst +++ b/README.rst @@ -256,6 +256,12 @@ jeff@jeffknupp.com. Changelog ========= +Version 0.9.4 +------------- + +- Fixes a critical bug in the requirements portion of ``setup.py``, + adding ``Flask-HTTPAuth`` + Version 0.9.3 ------------- diff --git a/sandman/sandmanctl.py b/sandman/sandmanctl.py index 1a1e004..1bf7765 100644 --- a/sandman/sandmanctl.py +++ b/sandman/sandmanctl.py @@ -1,7 +1,8 @@ """Script to run sandman via command line Usage: - sandmanctl.py URI [--show-pks --generate-pks] [--host=host] [--port=port] + sandmanctl.py URI [--show-pks --generate-pks] [--host=host] [--port=port] [--version] + sandmanctl.py --version Start sandman and connect to database at URI @@ -27,14 +28,15 @@ Options: -h --help Show this screen. - -s --show-primary-keys Display primary key columns in the admin + -s --show-primary-keys Display primary key columns in the admin interface -g --generate-pks Use the combination of all columns as the primary key for tables without primary keys (primary keys are required by the mapping engine). Implies --primary-keys - --host=host Host to run sandmanctl on - --port=port Port to run sandmanctl on + -v --version Display current version of sandman and exit + --host Host to run sandmanctl on + --port Port to run sandmanctl on 'postgresql+psycopg2://scott:tiger@localhost/test' 'postgresql+psycopg2://scott:tiger@localhost/test' --generate-pks --host localhost --port 8080 @@ -43,6 +45,7 @@ """ from __future__ import absolute_import +import sys from docopt import docopt @@ -51,7 +54,14 @@ def main(test_options=None): """Main entry point for script.""" - options = test_options or docopt(__doc__) + import pkg_resources + version = None + try: + version = pkg_resources.get_distribution('sandman').version + finally: + del pkg_resources + + options = test_options or docopt(__doc__, version=version) URI = options['URI'] app.config['SQLALCHEMY_DATABASE_URI'] = options['URI'] app.config['SANDMAN_GENERATE_PKS'] = options['--generate-pks'] or False diff --git a/setup.py b/setup.py index 954bbe7..25f6be1 100644 --- a/setup.py +++ b/setup.py @@ -44,6 +44,7 @@ def run_tests(self): 'Flask-SQLAlchemy>=1.0', 'SQLAlchemy>=0.8.2', 'Flask-Admin>=1.0.6', + 'Flask-HTTPAuth>=2.2.1', 'docopt>=0.6.1', ], cmdclass={'test': PyTest}, diff --git a/tox.ini b/tox.ini index 49b5a3c..1a8584a 100644 --- a/tox.ini +++ b/tox.ini @@ -12,3 +12,4 @@ deps = pytest flask-sqlalchemy flask-admin + Flask-HTTPAuth