]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
a sandwich setup.
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 22 Apr 2010 21:50:15 +0000 (17:50 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 22 Apr 2010 21:50:15 +0000 (17:50 -0400)
alembic/__init__.py [new file with mode: 0644]
alembic/command.py [new file with mode: 0644]
scripts/alembic [new file with mode: 0644]
setup.py [new file with mode: 0644]
tests/__init__.py [new file with mode: 0644]

diff --git a/alembic/__init__.py b/alembic/__init__.py
new file mode 100644 (file)
index 0000000..25b4cfe
--- /dev/null
@@ -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 (file)
index 0000000..9cf27e0
--- /dev/null
@@ -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 (file)
index 0000000..10ab018
--- /dev/null
@@ -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] <command>")
+
+    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 (file)
index 0000000..54ee561
--- /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 (file)
index 0000000..e69de29