From: Mike Bayer Date: Thu, 22 Apr 2010 21:50:15 +0000 (-0400) Subject: a sandwich setup. X-Git-Tag: rel_0_1_0~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40c0f505dcd5191e6aab82673883dc5499fca07e;p=thirdparty%2Fsqlalchemy%2Falembic.git a sandwich setup. --- 40c0f505dcd5191e6aab82673883dc5499fca07e diff --git a/alembic/__init__.py b/alembic/__init__.py new file mode 100644 index 00000000..25b4cfe1 --- /dev/null +++ b/alembic/__init__.py @@ -0,0 +1,4 @@ +from command import main + +__version__ = "0.1" + diff --git a/alembic/command.py b/alembic/command.py new file mode 100644 index 00000000..9cf27e03 --- /dev/null +++ b/alembic/command.py @@ -0,0 +1,4 @@ +def main(options, command): + raise NotImplementedError("yeah yeah nothing here yet") + + diff --git a/scripts/alembic b/scripts/alembic new file mode 100644 index 00000000..10ab018f --- /dev/null +++ b/scripts/alembic @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +import alembic + +def main(argv=None): + from os.path import isfile + from sys import stdin + + if argv is None: + import sys + argv = sys.argv + + from optparse import OptionParser + + parser = OptionParser("usage: %prog [options] ") + + opts, args = parser.parse_args(argv[1:]) + if len(args) < 1: + parser.error("no command specified") # Will exit + + command = args[0] + alembic.main(options, command) + +if __name__ == "__main__": + main() + diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..54ee5612 --- /dev/null +++ b/setup.py @@ -0,0 +1,53 @@ +from setuptools import setup, find_packages +import os +import re + +v = open(os.path.join(os.path.dirname(__file__), 'alembic', '__init__.py')) +VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(v.read()).group(1) +v.close() + +setup(name='alembic', + version=VERSION, + description="A database migration tool for SQLAlchemy." + long_description="""\ +alembic allows the creation of script files which specify a particular revision of a database, +and its movements to other revisions. The scripting system executes within the context +of a particular connection and transactional configuration, and encourages the usage of +SQLAlchemy DDLElement constructs and table reflection in order to execute changes to +schemas. + +The current goal of the tool is to allow explicit but minimalistic scripting +between any two states, with only a simplistic model of dependency traversal +working in the background to execute a series of steps. + +The author is well aware that the goal of "minimal and simplistic" is how +tools both underpowered and massively bloated begin. It is hoped that +Alembic's basic idea is useful enough that the tool can remain straightforward +without the need for vast tracts of complexity to be added, but that +remains to be seen. + + +""", + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Console', + 'Intended Audience :: Developers', + 'Programming Language :: Python', + 'Topic :: Database :: Front-Ends', + ], + keywords='SQLAlchemy migrations', + author='Mike Bayer', + author_email='mike@zzzcomputing.com', + url='http://bitbucket.org/zzzeek/alembic', + license='MIT', + packages=find_packages('.', exclude=['examples*', 'test*']), + scripts=['scripts/alembic'], + tests_require = ['nose >= 0.11'], + test_suite = "nose.collector", + zip_safe=False, + install_requires=[ + 'SQLAlchemy>=0.6.0', + ], + entry_points=""" + """, +) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b