Skip to content

Commit

Permalink
setup test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
akolpakov committed Mar 8, 2016
1 parent aeb0b8f commit 5128435
Show file tree
Hide file tree
Showing 18 changed files with 379 additions and 174 deletions.
22 changes: 22 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file is part of django-unused-media.
# https://github.com/akolpakov/django-unused-media

# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2015, Andrey Kolpakov <[email protected]>

[run]
omit =
*tests.py
branch = True
source =
django_unused_media

[report]
exclude_lines =
pragma: no cover
def __repr__
raise NotImplementedError
if __name__ == .__main__.:
from urllib.parse import parse_qs
except ImportError:
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# This file is part of django-unused-media.
# https://github.com/akolpakov/django-unused-media

# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2015, Andrey Kolpakov <[email protected]>

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -52,4 +59,8 @@ coverage.xml
# Sphinx documentation
docs/_build/

.idea
# IDE
.idea

# sandbox
sandbox
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file is part of django-unused-media.
# https://github.com/akolpakov/django-unused-media

# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2015, Andrey Kolpakov <[email protected]>

language: python

python:
- "2.7"
- "3.4"
- "pypy"

install:
# install python requirements
- make setup

script:
# run tests
- make test
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include LICENSE
include README.rst
include README.md
include MANIFEST.in
37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This file is part of django-unused-media.
# https://github.com/akolpakov/django-unused-media

# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2015, Andrey Kolpakov <[email protected]>

# lists all available targets
list:
@sh -c "$(MAKE) -p no_targets__ | awk -F':' '/^[a-zA-Z0-9][^\$$#\/\\t=]*:([^=]|$$)/ {split(\$$1,A,/ /);for(i in A)print A[i]}' | grep -v '__\$$' | grep -v 'make\[1\]' | grep -v 'Makefile' | sort"
# required for list
no_targets__:

# install all dependencies (do not forget to create a virtualenv first)
setup:
@pip install -U -e .\[tests\]

# test your application (tests in the tests/ directory)
test: unit

unit:
@coverage run ./tests/runtests.py -vv --with-yanc
@coverage report -m --fail-under=80

# show coverage in html format
coverage-html: unit
@coverage html

# run tests against all supported python versions
tox:
@tox

#docs:
#@cd django_paynova/docs && make html && open _build/html/index.html

upload:
@python setup.py sdist upload
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Delete unused media files from Django project

TODO: description


# Installation
1. Install ``django-unused-media``:
```
pip install django-unused-media
```
Python 2.7, 3.3, 3.4, PyPy are supported<br/>
Django 1.6, 1.7, 1.8 are supported
2. Add ``django-unused-media`` to ``INSTALLED_APPS``:
```python
INSTALLED_APPS = (
...
'django_unused_media',
...
)
```
# Usage
TODO: usage
# Tests
At first make sure that you are in virtualenv.
Install all dependencies:
```
make setup
```
To run tests:
```
make test
```
# License
[MIT licence](./LICENSE)
54 changes: 0 additions & 54 deletions README.rst

This file was deleted.

22 changes: 0 additions & 22 deletions django_unused_media/tests/settings.py

This file was deleted.

49 changes: 0 additions & 49 deletions django_unused_media/tests/test_fields.py

This file was deleted.

Loading

0 comments on commit 5128435

Please sign in to comment.