Skip to content

Commit f068010

Browse files
committed
Added coverage reporting.
In the process, I removed tox as it made things so much more complex for me.
1 parent 8a60e9e commit f068010

5 files changed

Lines changed: 57 additions & 50 deletions

File tree

.coveragerc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[run]
2+
source = smmap
3+
4+
; to make nosetests happy
5+
[report]
6+
omit =
7+
*/yaml*
8+
*/tests/*
9+
*/python?.?/*
10+
*/site-packages/nose/*

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
build/
33
.coverage
44
coverage
5+
cover/
56
dist/
67
MANIFEST
78
.tox

.travis.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
language: python
2-
env:
3-
- TOXENV=py26
4-
- TOXENV=py27
5-
- TOXENV=py33
6-
- TOXENV=py34
2+
python:
3+
- "2.6"
4+
- "2.7"
5+
- "3.3"
76
install:
8-
- pip install tox
7+
- pip install coveralls
98
script:
10-
- tox
9+
- nosetests --with-coverage
10+
after_success:
11+
- coveralls

README.rst renamed to README.md

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
###########
2-
Motivation
3-
###########
1+
## Motivation
2+
43
When reading from many possibly large files in a fashion similar to random access, it is usually the fastest and most efficient to use memory maps.
54

65
Although memory maps have many advantages, they represent a very limited system resource as every map uses one file descriptor, whose amount is limited per process. On 32 bit systems, the amount of memory you can have mapped at a time is naturally limited to theoretical 4GB of memory, which may not be enough for some applications.
76

8-
########
9-
Overview
10-
########
117

12-
.. image:: https://travis-ci.org/Byron/smmap.svg?branch=master :target: https://travis-ci.org/Byron/smmap
8+
9+
## Overview
10+
11+
[![Build Status](https://travis-ci.org/Byron/smmap.svg?branch=master)](https://travis-ci.org/Byron/smmap)
12+
[![Coverage Status](https://coveralls.io/repos/Byron/smmap/badge.png)](https://coveralls.io/r/Byron/smmap)
1313

1414
Smmap wraps an interface around mmap and tracks the mapped files as well as the amount of clients who use it. If the system runs out of resources, or if a memory limit is reached, it will automatically unload unused maps to allow continued operation.
1515

@@ -21,42 +21,49 @@ Although the library can be used most efficiently with its native interface, a B
2121

2222
For performance critical 64 bit applications, a simplified version of memory mapping is provided which always maps the whole file, but still provides the benefit of unloading unused mappings on demand.
2323

24-
#############
25-
Prerequisites
26-
#############
24+
25+
26+
## Prerequisites
27+
2728
* Python 2.4, 2.5 or 2.6
2829
* OSX, Windows or Linux
2930

3031
The package was tested on all of the previously mentioned configurations.
3132

32-
###########
33-
Limitations
34-
###########
33+
34+
35+
## Limitations
36+
3537
* The memory access is read-only by design.
3638
* In python below 2.6, memory maps will be created in compatibility mode which works, but creates inefficient memory mappings as they always start at offset 0.
3739
* It wasn't tested on python 2.7 and 3.x.
3840

39-
################
40-
Installing smmap
41-
################
42-
Its easiest to install smmap using the *easy_install* or *pip* program, which is part of the `setuptools`_ or `pip`_ respectively::
41+
42+
## Installing smmap
43+
44+
Its easiest to install smmap using the *easy_install* or *pip* program, which is part of the [setuptools](http://peak.telecommunity.com/DevCenter/setuptools) or [pip](http://www.pip-installer.org/en/latest) respectively:
4345

44-
$ easy_install smmap
45-
# or
46-
$ pip install smmap
46+
```bash
47+
$ easy_install smmap
48+
# or
49+
$ pip install smmap
50+
```
4751

4852
As the command will install smmap in your respective python distribution, you will most likely need root permissions to authorize the required changes.
4953

50-
If you have downloaded the source archive, the package can be installed by running the ``setup.py`` script::
54+
If you have downloaded the source archive, the package can be installed by running the `setup.py` script:
5155

52-
$ python setup.py install
56+
```bash
57+
$ python setup.py install
58+
```
59+
60+
It is advised to have a look at the **Usage Guide** for a brief introduction on the different database implementations.
61+
5362

54-
It is advised to have a look at the :ref:`Usage Guide <tutorial-label>` for a brief introduction on the different database implementations.
5563

56-
##################
57-
Homepage and Links
58-
##################
59-
The project is home on github at `https://github.com/Byron/smmap <https://github.com/Byron/smmap>`_.
64+
## Homepage and Links
65+
66+
The project is home on github at https://github.com/Byron/smmap .
6067

6168
The latest source can be cloned from github as well:
6269

@@ -72,10 +79,9 @@ Issues can be filed on github:
7279

7380
* https://github.com/Byron/smmap/issues
7481

75-
###################
76-
License Information
77-
###################
82+
83+
84+
## License Information
85+
7886
*smmap* is licensed under the New BSD License.
7987

80-
.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools
81-
.. _pip: http://www.pip-installer.org/en/latest/

tox.ini

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)