Permalink
Browse files

Initial setup for the testing framework; includes setup tools configu…

…ration and readme
  • Loading branch information...
0 parents commit 03767cc17c6111c4c39cd4dde0517f5415515598 @Byron Byron committed Jun 8, 2011
Showing with 197 additions and 0 deletions.
  1. +6 −0 .gitignore
  2. +37 −0 Makefile
  3. +50 −0 README.rst
  4. +49 −0 setup.py
  5. +7 −0 smmap/__init__.py
  6. +3 −0 smmap/mman.py
  7. +7 −0 smmap/stream.py
  8. 0 smmap/test/__init__.py
  9. +24 −0 smmap/test/lib.py
  10. +7 −0 smmap/test/test_mman.py
  11. +7 −0 smmap/test/test_stream.py
@@ -0,0 +1,6 @@
+*.pyc
+build/
+.coverage
+coverage
+dist/
+MANIFEST
@@ -0,0 +1,37 @@
+.PHONY: build sdist cover test clean-files clean-docs doc all
+
+all:
+ $(info Possible targets:)
+ $(info doc)
+ $(info clean-docs)
+ $(info clean-files)
+ $(info clean)
+ $(info test)
+ $(info coverage)
+ $(info build)
+ $(info sdist)
+
+doc:
+ cd docs && make html
+
+clean-docs:
+ cd docs && make clean
+
+clean-files:
+ git clean -fx
+
+clean: clean-files clean-docs
+
+test:
+ nosetests
+
+coverage:
+ nosetests --with-coverage --cover-package=smmap
+
+build:
+ ./setup.py build
+
+sdist:
+ ./setup.py sdist
+
+
@@ -0,0 +1,50 @@
+####################
+Sliding MMap (smmap)
+####################
+A straight forward implementation of a slidinging memory map.
+The idea is that every access to a file goes through a memory map manager, which will on demand map a region of a file and provide a string-like object for reading.
+
+When reading from it, you will have to check whether you are still within your window boundary, and possibly obtain a new window as required.
+
+The great benefit of this system is that you can use it to map files of any size even on 32 bit systems. Additionally it will be able to close unused windows right away to return system resources. If there are multiple clients for the same file and location, the same window will be reused as well.
+
+As there is a global management facility, you are also able to forcibly free all open handles which is handy on windows, which would otherwise prevent the deletion of the involved files.
+
+For convenience, a stream class is provided which hides the usage of the memory manager behind a simple stream interface.
+
+************
+LIMITATIONS
+************
+The access is readonly by design.
+
+************
+REQUIREMENTS
+************
+* Python 2.4 or higher
+
+*******
+Install
+*******
+TODO
+
+******
+Source
+******
+The source is available at git://github.com/Byron/smmap.git and can be cloned using::
+
+ git clone git://github.com/Byron/smmap.git
+
+************
+MAILING LIST
+************
+http://groups.google.com/group/git-python
+
+*************
+ISSUE TRACKER
+*************
+https://github.com/Byron/smmap/issues
+
+*******
+LICENSE
+*******
+New BSD License
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+import os
+import codecs
+try:
+ from setuptools import setup, find_packages
+except ImportError:
+ from ez_setup import use_setuptools
+ use_setuptools()
+ from setuptools import setup, find_packages
+
+import smmap
+
+if os.path.exists("README.rst"):
+ long_description = codecs.open('README.rst', "r", "utf-8").read()
+else:
+ long_description = "See http://github.com/nvie/smmap/tree/master"
+
+setup(
+ name="smmap",
+ version=smmap.__version__,
+ description="A pure git implementation of a sliding window memory map manager",
+ author=smmap.__author__,
+ author_email=smmap.__contact__,
+ url=smmap.__homepage__,
+ platforms=["any"],
+ license="BSD",
+ packages=find_packages(),
+ zip_safe=True,
+ classifiers=[
+ # Picked from
+ # http://pypi.python.org/pypi?:action=list_classifiers
+ #"Development Status :: 1 - Planning",
+ #"Development Status :: 2 - Pre-Alpha",
+ #"Development Status :: 3 - Alpha",
+ "Development Status :: 4 - Beta",
+ #"Development Status :: 5 - Production/Stable",
+ #"Development Status :: 6 - Mature",
+ #"Development Status :: 7 - Inactive",
+ "Environment :: Console",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: BSD License",
+ "Operating System :: OS Independent",
+ "Operating System :: POSIX",
+ "Operating System :: Windows",
+ "Operating System :: OSX",
+ "Programming Language :: Python",
+ ],
+ long_description=long_description,
+)
@@ -0,0 +1,7 @@
+"""Intialize the smmap package"""
+
+__author__ = "Sebastian Thiel"
+__contact__ = "byronimo@gmail.com"
+__homepage__ = "https://github.com/Byron/smmap"
+version_info = (0, 8, 0)
+__version__ = '.'.join(str(i) for i in version_info)
@@ -0,0 +1,3 @@
+"""Module containnig a memory memory manager which provides a sliding window on a number of memory mapped files"""
+
+__all__ = []
@@ -0,0 +1,7 @@
+"""Module with a simple stream implementation using the memory manager"""
+
+from mman import *
+
+__all__ = []
+
+
No changes.
@@ -0,0 +1,24 @@
+"""Provide base classes for the test system"""
+from unittest import TestCase
+
+__all__ = ['TestBase']
+
+
+class TestBase(TestCase):
+ """Foundation used by all tests"""
+
+ #{ Configuration
+
+ #} END configuration
+
+ #{ Overrides
+ @classmethod
+ def setUpAll(cls):
+ # nothing for now
+ pass
+
+ #END overrides
+
+ #{ Interface
+
+ #} END interface
@@ -0,0 +1,7 @@
+from lib import TestBase
+
+from smmap.mman import *
+
+class TestMMan(TestBase):
+ def test_basics(self):
+ assert False
@@ -0,0 +1,7 @@
+from lib import TestBase
+
+from smmap.stream import *
+
+class TestStream(TestBase):
+ def test_basics(self):
+ assert False

0 comments on commit 03767cc

Please sign in to comment.