Skip to content

Commit 03767cc

Browse files
committed
Initial setup for the testing framework; includes setup tools configuration and readme
0 parents  commit 03767cc

11 files changed

Lines changed: 197 additions & 0 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.pyc
2+
build/
3+
.coverage
4+
coverage
5+
dist/
6+
MANIFEST

Makefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.PHONY: build sdist cover test clean-files clean-docs doc all
2+
3+
all:
4+
$(info Possible targets:)
5+
$(info doc)
6+
$(info clean-docs)
7+
$(info clean-files)
8+
$(info clean)
9+
$(info test)
10+
$(info coverage)
11+
$(info build)
12+
$(info sdist)
13+
14+
doc:
15+
cd docs && make html
16+
17+
clean-docs:
18+
cd docs && make clean
19+
20+
clean-files:
21+
git clean -fx
22+
23+
clean: clean-files clean-docs
24+
25+
test:
26+
nosetests
27+
28+
coverage:
29+
nosetests --with-coverage --cover-package=smmap
30+
31+
build:
32+
./setup.py build
33+
34+
sdist:
35+
./setup.py sdist
36+
37+

README.rst

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
####################
2+
Sliding MMap (smmap)
3+
####################
4+
A straight forward implementation of a slidinging memory map.
5+
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.
6+
7+
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.
8+
9+
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.
10+
11+
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.
12+
13+
For convenience, a stream class is provided which hides the usage of the memory manager behind a simple stream interface.
14+
15+
************
16+
LIMITATIONS
17+
************
18+
The access is readonly by design.
19+
20+
************
21+
REQUIREMENTS
22+
************
23+
* Python 2.4 or higher
24+
25+
*******
26+
Install
27+
*******
28+
TODO
29+
30+
******
31+
Source
32+
******
33+
The source is available at git://github.com/Byron/smmap.git and can be cloned using::
34+
35+
git clone git://github.com/Byron/smmap.git
36+
37+
************
38+
MAILING LIST
39+
************
40+
http://groups.google.com/group/git-python
41+
42+
*************
43+
ISSUE TRACKER
44+
*************
45+
https://github.com/Byron/smmap/issues
46+
47+
*******
48+
LICENSE
49+
*******
50+
New BSD License

setup.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env python
2+
import os
3+
import codecs
4+
try:
5+
from setuptools import setup, find_packages
6+
except ImportError:
7+
from ez_setup import use_setuptools
8+
use_setuptools()
9+
from setuptools import setup, find_packages
10+
11+
import smmap
12+
13+
if os.path.exists("README.rst"):
14+
long_description = codecs.open('README.rst', "r", "utf-8").read()
15+
else:
16+
long_description = "See http://github.com/nvie/smmap/tree/master"
17+
18+
setup(
19+
name="smmap",
20+
version=smmap.__version__,
21+
description="A pure git implementation of a sliding window memory map manager",
22+
author=smmap.__author__,
23+
author_email=smmap.__contact__,
24+
url=smmap.__homepage__,
25+
platforms=["any"],
26+
license="BSD",
27+
packages=find_packages(),
28+
zip_safe=True,
29+
classifiers=[
30+
# Picked from
31+
# http://pypi.python.org/pypi?:action=list_classifiers
32+
#"Development Status :: 1 - Planning",
33+
#"Development Status :: 2 - Pre-Alpha",
34+
#"Development Status :: 3 - Alpha",
35+
"Development Status :: 4 - Beta",
36+
#"Development Status :: 5 - Production/Stable",
37+
#"Development Status :: 6 - Mature",
38+
#"Development Status :: 7 - Inactive",
39+
"Environment :: Console",
40+
"Intended Audience :: Developers",
41+
"License :: OSI Approved :: BSD License",
42+
"Operating System :: OS Independent",
43+
"Operating System :: POSIX",
44+
"Operating System :: Windows",
45+
"Operating System :: OSX",
46+
"Programming Language :: Python",
47+
],
48+
long_description=long_description,
49+
)

smmap/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""Intialize the smmap package"""
2+
3+
__author__ = "Sebastian Thiel"
4+
__contact__ = "byronimo@gmail.com"
5+
__homepage__ = "https://github.com/Byron/smmap"
6+
version_info = (0, 8, 0)
7+
__version__ = '.'.join(str(i) for i in version_info)

smmap/mman.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""Module containnig a memory memory manager which provides a sliding window on a number of memory mapped files"""
2+
3+
__all__ = []

smmap/stream.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""Module with a simple stream implementation using the memory manager"""
2+
3+
from mman import *
4+
5+
__all__ = []
6+
7+

smmap/test/__init__.py

Whitespace-only changes.

smmap/test/lib.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""Provide base classes for the test system"""
2+
from unittest import TestCase
3+
4+
__all__ = ['TestBase']
5+
6+
7+
class TestBase(TestCase):
8+
"""Foundation used by all tests"""
9+
10+
#{ Configuration
11+
12+
#} END configuration
13+
14+
#{ Overrides
15+
@classmethod
16+
def setUpAll(cls):
17+
# nothing for now
18+
pass
19+
20+
#END overrides
21+
22+
#{ Interface
23+
24+
#} END interface

smmap/test/test_mman.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from lib import TestBase
2+
3+
from smmap.mman import *
4+
5+
class TestMMan(TestBase):
6+
def test_basics(self):
7+
assert False

0 commit comments

Comments
 (0)