Skip to content

Commit

Permalink
Adding test packaging, bumping version. Reanming.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpresta committed Dec 6, 2013
1 parent a69f03a commit efd5663
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 19 deletions.
41 changes: 41 additions & 0 deletions .gitignore
@@ -0,0 +1,41 @@
*.py[cod]

# Docs
docs/_build

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
nosetests.xml

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# PyCharm
.idea
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2010, Cody Soyland
Copyright (c) 2013, Cody Soyland, Seán Hayes, Tore Birkeland, Wave Accounting Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
23 changes: 22 additions & 1 deletion README.rst
@@ -1,7 +1,28 @@
======================
django-inmemorystorage
dj-inmemorystorage
======================

A non-persistent in-memory data storage backend for Django.

Compatible with Django's `storage API <https://docs.djangoproject.com/en/dev/ref/files/storage/>`_.

=====
Usage
=====

In your test settings file, add

.. code:: python
DEFAULT_FILE_STORAGE = 'inmemorystorage.InMemoryStorage'
===========
Differences
===========

This library is based on `django-inmemorystorage <https://github.com/codysoyland/django-inmemorystorage>`_ by Cody Soyland,
with `modifications <https://github.com/SeanHayes/django-inmemorystorage>`_ made by Seán Hayes with support for the ``url`` method,
with `additional support <https://github.com/Vostopia/django-inmemorystorage>`_ for writing.

Wave's modifications include packaging, and test modifications such that ``python setup.py test`` works. This version
also bumps the version to ``1.0.0`` and renames it to dj-inmemorystorage such that it doesn't conflict on PyPI.
35 changes: 18 additions & 17 deletions setup.py
@@ -1,25 +1,26 @@
import os
from distutils.core import setup
from setuptools import setup

def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()

README = read('README.rst')
requires = ['Django >= 1.4']
tests_require = requires

setup(
name = "django-inmemorystorage",
version = "0.1.1",
url = 'http://github.com/codysoyland/django-inmemorystorage',
license = 'BSD',
description = "A non-persistent in-memory data storage backend for Django.",
long_description = README,
author = 'Cody Soyland',
author_email = 'cody@soyland.com',
packages = [
name="dj-inmemorystorage",
description="A non-persistent in-memory data storage backend for Django.",
version="1.0.0",
url="https://github.com/waveaccounting/django-inmemorystorage",
license=open('LICENSE').read(),
long_description=open('README.rst').read(),
author='Cody Soyland, Seán Hayes, Tore Birkeland, Nick Presta',
author_email='opensource@waveapps.com',
packages=[
'inmemorystorage',
],
classifiers = [
'Development Status :: 4 - Beta',
zip_safe=True,
install_requires=requires,
tests_require=tests_require,
test_suite='inmemorystorage.storage_tests',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
Expand Down
4 changes: 4 additions & 0 deletions tests.py
Expand Up @@ -2,9 +2,13 @@
from inmemorystorage import InMemoryStorage
from inmemorystorage.storage import InMemoryDir, InMemoryFile
from django.core.files.base import ContentFile
from django.conf import settings


class MemoryStorageTests(unittest.TestCase):
def setUp(self):
if not settings.configured:
settings.configure(MEDIA_URL='')
self.storage = InMemoryStorage()
self.filesystem = self.storage.filesystem

Expand Down

0 comments on commit efd5663

Please sign in to comment.