mirror of
https://github.com/jazzband/django-analytical.git
synced 2026-03-16 22:20:25 +00:00
Refactored setup.py to remove cmdclass and test packages
This commit is contained in:
parent
51ae4433cb
commit
f3669b0082
4 changed files with 3 additions and 38 deletions
|
|
@ -8,26 +8,6 @@ from django.template import Template, Context, RequestContext
|
|||
from django.test.testcases import TestCase
|
||||
|
||||
|
||||
def run_tests():
|
||||
"""
|
||||
Use the Django test runner to run the tests.
|
||||
|
||||
Sets the return code to the number of failed tests.
|
||||
"""
|
||||
import sys
|
||||
import django
|
||||
try:
|
||||
django.setup()
|
||||
except AttributeError:
|
||||
pass
|
||||
try:
|
||||
from django.test.runner import DiscoverRunner as TestRunner
|
||||
except ImportError:
|
||||
from django.test.simple import DjangoTestSuiteRunner as TestRunner
|
||||
runner = TestRunner()
|
||||
sys.exit(runner.run_tests(["analytical"]))
|
||||
|
||||
|
||||
class TagTestCase(TestCase):
|
||||
"""
|
||||
Tests for a template tag.
|
||||
|
|
|
|||
|
|
@ -7,4 +7,4 @@ all_files = 1
|
|||
upload-dir = build/docs/html
|
||||
|
||||
[tool:pytest]
|
||||
DJANGO_SETTINGS_MODULE = analytical.tests.settings
|
||||
DJANGO_SETTINGS_MODULE = analytical.tests.settings
|
||||
|
|
|
|||
18
setup.py
18
setup.py
|
|
@ -1,24 +1,13 @@
|
|||
import os
|
||||
|
||||
try:
|
||||
from setuptools import setup
|
||||
except ImportError:
|
||||
from distutils.core import setup
|
||||
from setuptools import setup
|
||||
|
||||
cmdclass = {}
|
||||
|
||||
try:
|
||||
from sphinx.setup_command import BuildDoc
|
||||
|
||||
cmdclass['build_sphinx'] = BuildDoc
|
||||
except ImportError:
|
||||
pass
|
||||
import analytical as package
|
||||
|
||||
|
||||
def read_file(fname):
|
||||
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
||||
|
||||
import analytical as package # noqa
|
||||
|
||||
setup(
|
||||
name='django-analytical',
|
||||
|
|
@ -32,8 +21,6 @@ setup(
|
|||
packages=[
|
||||
'analytical',
|
||||
'analytical.templatetags',
|
||||
'analytical.tests',
|
||||
'analytical.tests.templatetags',
|
||||
],
|
||||
keywords=['django', 'analytics'],
|
||||
classifiers=[
|
||||
|
|
@ -61,5 +48,4 @@ setup(
|
|||
platforms=['any'],
|
||||
url='https://github.com/jazzband/django-analytical',
|
||||
download_url='https://github.com/jazzband/django-analytical/archive/master.zip',
|
||||
cmdclass=cmdclass,
|
||||
)
|
||||
|
|
|
|||
1
tox.ini
1
tox.ini
|
|
@ -10,7 +10,6 @@ envlist =
|
|||
description = Unit tests
|
||||
deps =
|
||||
coverage
|
||||
pytest
|
||||
pytest-django
|
||||
django111: Django>=1.11,<2.0
|
||||
django22: Django>=2.2,<3.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue