Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Reworked setup.py to use package_data and enabled wheel support. #984

Closed
wants to merge 31 commits into
from
Commits
Jump to file or symbol
Failed to load files and symbols.
+2,878 −1,248
Split
View
@@ -619,6 +619,7 @@ A big THANK YOU goes to:
Ian Bicking for convincing Adrian to ditch code generation.
- Mark Pilgrim for diveintopython.org, which unfortunately no longer exists.
+ Mark Pilgrim for "Dive Into Python" (http://diveintopython.net,
+ http://www.diveintopython3.net).
Guido van Rossum for creating Python.
View
@@ -10,7 +10,9 @@ recursive-include docs *
recursive-include scripts *
recursive-include extras *
recursive-include tests *
+recursive-include django/conf/app_template *
recursive-include django/conf/locale *
+recursive-include django/conf/project_template *
recursive-include django/contrib/*/locale *
recursive-include django/contrib/admin/templates *
recursive-include django/contrib/admin/static *
@@ -1,36 +1 @@
-from __future__ import absolute_import, unicode_literals
-
-from django.contrib.admindocs import views
-from django.db.models import fields as builtin_fields
-from django.utils import unittest
-from django.utils.translation import ugettext as _
-
-from . import fields
-
-
-class TestFieldType(unittest.TestCase):
- def setUp(self):
- pass
-
- def test_field_name(self):
- self.assertRaises(AttributeError,
- views.get_readable_field_data_type, "NotAField"
- )
-
- def test_builtin_fields(self):
- self.assertEqual(
- views.get_readable_field_data_type(builtin_fields.BooleanField()),
- _('Boolean (Either True or False)')
- )
-
- def test_custom_fields(self):
- self.assertEqual(
- views.get_readable_field_data_type(fields.CustomField()),
- 'A custom field type'
- )
- self.assertEqual(
- views.get_readable_field_data_type(fields.DescriptionLackingField()),
- _('Field of type: %(field_type)s') % {
- 'field_type': 'DescriptionLackingField'
- }
- )
+from .test_fields import TestFieldType
@@ -1,7 +0,0 @@
-from django.db import models
-
-class CustomField(models.Field):
- description = "A custom field type"
-
-class DescriptionLackingField(models.Field):
- pass
@@ -0,0 +1,42 @@
+from __future__ import absolute_import, unicode_literals
+
+from django.contrib.admindocs import views
+from django.db import models
+from django.db.models import fields
+from django.utils import unittest
+from django.utils.translation import ugettext as _
+
+
+class CustomField(models.Field):
+ description = "A custom field type"
+
+class DescriptionLackingField(models.Field):
+ pass
+
+
+class TestFieldType(unittest.TestCase):
+ def setUp(self):
+ pass
+
+ def test_field_name(self):
+ self.assertRaises(AttributeError,
+ views.get_readable_field_data_type, "NotAField"
+ )
+
+ def test_builtin_fields(self):
+ self.assertEqual(
+ views.get_readable_field_data_type(fields.BooleanField()),
+ _('Boolean (Either True or False)')
+ )
+
+ def test_custom_fields(self):
+ self.assertEqual(
+ views.get_readable_field_data_type(CustomField()),
+ 'A custom field type'
+ )
+ self.assertEqual(
+ views.get_readable_field_data_type(DescriptionLackingField()),
+ _('Field of type: %(field_type)s') % {
+ 'field_type': 'DescriptionLackingField'
+ }
+ )
@@ -1,29 +1,16 @@
-from django.contrib.auth.tests.custom_user import *
-from django.contrib.auth.tests.auth_backends import *
-from django.contrib.auth.tests.basic import *
-from django.contrib.auth.tests.context_processors import *
-from django.contrib.auth.tests.decorators import *
-from django.contrib.auth.tests.forms import *
-from django.contrib.auth.tests.remote_user import *
-from django.contrib.auth.tests.management import *
-from django.contrib.auth.tests.models import *
-from django.contrib.auth.tests.handlers import *
-from django.contrib.auth.tests.hashers import *
-from django.contrib.auth.tests.signals import *
-from django.contrib.auth.tests.tokens import *
-from django.contrib.auth.tests.views import *
+from django.contrib.auth.tests.test_custom_user import *
+from django.contrib.auth.tests.test_auth_backends import *
+from django.contrib.auth.tests.test_basic import *
+from django.contrib.auth.tests.test_context_processors import *
+from django.contrib.auth.tests.test_decorators import *
+from django.contrib.auth.tests.test_forms import *
+from django.contrib.auth.tests.test_remote_user import *
+from django.contrib.auth.tests.test_management import *
+from django.contrib.auth.tests.test_models import *
+from django.contrib.auth.tests.test_handlers import *
+from django.contrib.auth.tests.test_hashers import *
+from django.contrib.auth.tests.test_signals import *
+from django.contrib.auth.tests.test_tokens import *
+from django.contrib.auth.tests.test_views import *
# The password for the fixture data users is 'password'
-
-from django.dispatch import receiver
-from django.test.signals import setting_changed
-
-
-@receiver(setting_changed)
-def user_model_swapped(**kwargs):
- if kwargs['setting'] == 'AUTH_USER_MODEL':
- from django.db.models.manager import ensure_default_manager
- from django.contrib.auth.models import User
- # Reset User manager
- setattr(User, 'objects', User._default_manager)
- ensure_default_manager(User)
@@ -4,7 +4,7 @@
from django.conf import settings
from django.contrib.auth.models import User, Group, Permission, AnonymousUser
from django.contrib.auth.tests.utils import skipIfCustomUser
-from django.contrib.auth.tests.custom_user import ExtensionUser, CustomPermissionsUser, CustomUser
+from django.contrib.auth.tests.test_custom_user import ExtensionUser, CustomPermissionsUser, CustomUser
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.contrib.auth import authenticate
@@ -263,7 +263,7 @@ class RowlevelBackendTest(TestCase):
"""
Tests for auth backend that supports object level permissions
"""
- backend = 'django.contrib.auth.tests.auth_backends.SimpleRowlevelBackend'
+ backend = 'django.contrib.auth.tests.test_auth_backends.SimpleRowlevelBackend'
def setUp(self):
self.curr_auth = settings.AUTHENTICATION_BACKENDS
@@ -304,7 +304,7 @@ class AnonymousUserBackendTest(TestCase):
Tests for AnonymousUser delegating to backend.
"""
- backend = 'django.contrib.auth.tests.auth_backends.SimpleRowlevelBackend'
+ backend = 'django.contrib.auth.tests.test_auth_backends.SimpleRowlevelBackend'
def setUp(self):
self.curr_auth = settings.AUTHENTICATION_BACKENDS
@@ -348,7 +348,7 @@ class InActiveUserBackendTest(TestCase):
"""
Tests for a inactive user
"""
- backend = 'django.contrib.auth.tests.auth_backends.SimpleRowlevelBackend'
+ backend = 'django.contrib.auth.tests.test_auth_backends.SimpleRowlevelBackend'
def setUp(self):
self.curr_auth = settings.AUTHENTICATION_BACKENDS
@@ -386,7 +386,7 @@ class PermissionDeniedBackendTest(TestCase):
"""
Tests that other backends are not checked once a backend raises PermissionDenied
"""
- backend = 'django.contrib.auth.tests.auth_backends.PermissionDeniedBackend'
+ backend = 'django.contrib.auth.tests.test_auth_backends.PermissionDeniedBackend'
def setUp(self):
self.user1 = User.objects.create_user('test', 'test@example.com', 'test')
@@ -6,17 +6,29 @@
from django.contrib.auth import get_user_model
from django.contrib.auth.management.commands import createsuperuser
from django.contrib.auth.models import User, AnonymousUser
-from django.contrib.auth.tests.custom_user import CustomUser
+from django.contrib.auth.tests.test_custom_user import CustomUser
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command
+from django.dispatch import receiver
from django.test import TestCase
+from django.test.signals import setting_changed
from django.test.utils import override_settings
from django.utils import translation
from django.utils.encoding import force_str
from django.utils.six import binary_type, PY3, StringIO
+@receiver(setting_changed)
+def user_model_swapped(**kwargs):
+ if kwargs['setting'] == 'AUTH_USER_MODEL':
+ from django.db.models.manager import ensure_default_manager
+ from django.contrib.auth.models import User
+ # Reset User manager
+ setattr(User, 'objects', User._default_manager)
+ ensure_default_manager(User)
+
+
def mock_inputs(inputs):
"""
Decorator to temporarily replace input/getpass to allow interactive
@@ -1,5 +1,5 @@
from django.contrib.auth.decorators import login_required
-from django.contrib.auth.tests.views import AuthViewsTestCase
+from django.contrib.auth.tests.test_views import AuthViewsTestCase
from django.contrib.auth.tests.utils import skipIfCustomUser
@@ -137,7 +137,7 @@ class that doesn't create unknown users.
"""
backend =\
- 'django.contrib.auth.tests.remote_user.RemoteUserNoCreateBackend'
+ 'django.contrib.auth.tests.test_remote_user.RemoteUserNoCreateBackend'
def test_unknown_user(self):
num_users = User.objects.count()
@@ -174,7 +174,7 @@ class RemoteUserCustomTest(RemoteUserTest):
"""
backend =\
- 'django.contrib.auth.tests.remote_user.CustomRemoteUserBackend'
+ 'django.contrib.auth.tests.test_remote_user.CustomRemoteUserBackend'
# REMOTE_USER strings with email addresses for the custom backend to
# clean.
known_user = 'knownuser@example.com'
@@ -1,6 +1,6 @@
-from django.contrib.flatpages.tests.csrf import *
-from django.contrib.flatpages.tests.forms import *
-from django.contrib.flatpages.tests.models import *
-from django.contrib.flatpages.tests.middleware import *
-from django.contrib.flatpages.tests.templatetags import *
-from django.contrib.flatpages.tests.views import *
+from django.contrib.flatpages.tests.test_csrf import *
+from django.contrib.flatpages.tests.test_forms import *
+from django.contrib.flatpages.tests.test_models import *
+from django.contrib.flatpages.tests.test_middleware import *
+from django.contrib.flatpages.tests.test_templatetags import *
+from django.contrib.flatpages.tests.test_views import *
Oops, something went wrong.