Skip to content

Commit

Permalink
First import
Browse files Browse the repository at this point in the history
  • Loading branch information
astagi committed Oct 9, 2017
0 parents commit cd87965
Show file tree
Hide file tree
Showing 12 changed files with 174 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = */**/__init__.py
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# System
venv
*.pyc
*.zip
.DS_Store
*.sqlite3
*.rdb
.coverage
.cache
coverage
htmlcov
.vscode

# Settings
local_settings.py
deploy_settings.py
deploy_settings.sh

# Static, media and libs
static/
libs/
node_modules
media/

# Logs
error_logs.log

# Sockets
*.socket

#Build
dist/
djlotrek.egg-info/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Lotrek 2017

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include LICENSE
include README.md
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

clean:
@find . -name "*.pyc" | xargs rm -rf
@find . -name "*.pyo" | xargs rm -rf
@find . -name "__pycache__" -type d | xargs rm -rf

test: clean
@python runtests.py --with-coverage
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Cattp


## Run tests

$ pip install -r requirements-dev.txt
$ ./runtests.py --with-coverage
10 changes: 10 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Cattp
=====

Run tests
---------

::

$ pip install -r requirements-dev.txt
$ ./runtests.py --with-coverage
Empty file added cattp/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-r requirements.txt

coverage==4.3.4
django-nose==1.4.5
mock==2.0.0
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Django==1.11.5
62 changes: 62 additions & 0 deletions runtests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env python
import sys
import logging
from optparse import OptionParser

from django.conf import settings

logging.disable(logging.CRITICAL)


def configure(nose_args=None):
if not settings.configured:
settings.configure(
DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3'}},
TEMPLATES=[{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
}],
AES_ENCRIPTION_KEY = 'abcdefgh01234567',
INSTALLED_APPS=[
'django.contrib.contenttypes',
'django.contrib.auth',
],
NOSE_ARGS=nose_args
)


def runtests(*test_args):
from django_nose import NoseTestSuiteRunner
runner = NoseTestSuiteRunner()

if not test_args:
test_args = ['cattp']
num_failures = runner.run_tests(test_args)
if num_failures:
sys.exit(num_failures)


if __name__ == '__main__':
parser = OptionParser()
parser.add_option('--with-coverage', dest='coverage', default=False,
action='store_true')
parser.add_option('--with-xunit', dest='xunit', default=False,
action='store_true')
parser.add_option('--with-spec', dest='with_spec', default=False,
action='store_true')
parser.add_option('--pdb', dest='pdb', default=False,
action='store_true')
options, args = parser.parse_args()

nose_args = []
if options.pdb:
nose_args.append('--pdb')

if options.coverage:
# Nose automatically uses any options passed to runtests.py, which is
# why the coverage trigger uses '--with-coverage' and why we don't need
# to explicitly include it here.
nose_args.extend([
'--cover-package=cattp', '--cover-branch', '--cover-html', '--cover-html-dir=htmlcov', '--nocapture'])
configure(nose_args)
runtests()
21 changes: 21 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from setuptools import setup, find_packages

setup(
name='cattp',
version='0.0.1',
url='https://github.com/lotrekagency/cattp',
install_requires=[],
description="Cattp",
long_description=open('README.rst', 'r').read(),
license="MIT",
author="Lotrek",
author_email="dimmitutto@lotrek.it",
packages=find_packages(),
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 3'
]
)

0 comments on commit cd87965

Please sign in to comment.