From e2f9887076e800d1d4aca24c60ad7882be611eb6 Mon Sep 17 00:00:00 2001 From: Tyson Clugg Date: Wed, 6 Jan 2016 15:02:33 +1100 Subject: [PATCH] Don't include dddp.test as a package (moved out of dddp package). --- MANIFEST.in | 6 +++--- Makefile | 2 +- dddp/tests.py | 2 +- setup.py | 8 ++++---- {dddp/test => tests}/__init__.py | 0 {dddp/test => tests}/django_todos/__init__.py | 0 {dddp/test => tests}/django_todos/admin.py | 0 {dddp/test => tests}/django_todos/ddp.py | 4 +++- .../django_todos/migrations/0001_initial.py | 0 {dddp/test => tests}/django_todos/migrations/__init__.py | 0 {dddp/test => tests}/django_todos/models.py | 0 {dddp/test => tests}/django_todos/tests.py | 2 +- {dddp/test => tests}/django_todos/views.py | 5 +++-- {dddp/test => tests}/manage.py | 3 ++- .../meteor_todos/.meteor/.finished-upgraders | 0 {dddp/test => tests}/meteor_todos/.meteor/.gitignore | 0 {dddp/test => tests}/meteor_todos/.meteor/.id | 0 {dddp/test => tests}/meteor_todos/.meteor/packages | 0 {dddp/test => tests}/meteor_todos/.meteor/platforms | 0 {dddp/test => tests}/meteor_todos/.meteor/release | 0 {dddp/test => tests}/meteor_todos/.meteor/versions | 0 {dddp/test => tests}/meteor_todos/meteor_todos.css | 0 {dddp/test => tests}/meteor_todos/meteor_todos.html | 0 {dddp/test => tests}/meteor_todos/meteor_todos.js | 0 {dddp/test => tests}/test_project/__init__.py | 0 {dddp/test => tests}/test_project/settings.py | 6 +++--- {dddp/test => tests}/test_project/urls.py | 4 ++-- {dddp/test => tests}/test_project/wsgi.py | 4 ++-- tox.ini | 2 +- 29 files changed, 26 insertions(+), 22 deletions(-) rename {dddp/test => tests}/__init__.py (100%) rename {dddp/test => tests}/django_todos/__init__.py (100%) rename {dddp/test => tests}/django_todos/admin.py (100%) rename {dddp/test => tests}/django_todos/ddp.py (71%) rename {dddp/test => tests}/django_todos/migrations/0001_initial.py (100%) rename {dddp/test => tests}/django_todos/migrations/__init__.py (100%) rename {dddp/test => tests}/django_todos/models.py (100%) rename {dddp/test => tests}/django_todos/tests.py (91%) rename {dddp/test => tests}/django_todos/views.py (66%) rename {dddp/test => tests}/manage.py (85%) rename {dddp/test => tests}/meteor_todos/.meteor/.finished-upgraders (100%) rename {dddp/test => tests}/meteor_todos/.meteor/.gitignore (100%) rename {dddp/test => tests}/meteor_todos/.meteor/.id (100%) rename {dddp/test => tests}/meteor_todos/.meteor/packages (100%) rename {dddp/test => tests}/meteor_todos/.meteor/platforms (100%) rename {dddp/test => tests}/meteor_todos/.meteor/release (100%) rename {dddp/test => tests}/meteor_todos/.meteor/versions (100%) rename {dddp/test => tests}/meteor_todos/meteor_todos.css (100%) rename {dddp/test => tests}/meteor_todos/meteor_todos.html (100%) rename {dddp/test => tests}/meteor_todos/meteor_todos.js (100%) rename {dddp/test => tests}/test_project/__init__.py (100%) rename {dddp/test => tests}/test_project/settings.py (94%) rename {dddp/test => tests}/test_project/urls.py (83%) rename {dddp/test => tests}/test_project/wsgi.py (70%) diff --git a/MANIFEST.in b/MANIFEST.in index bbeef8a..179f6d0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,9 +6,9 @@ include requirements*.txt include .gitignore include Makefile exclude tox.ini -graft dddp/test/meteor_todos -prune dddp/test/build -prune dddp/test/meteor_todos/.meteor/local +graft tests/meteor_todos +prune tests/build +prune tests/meteor_todos/.meteor/local graft docs prune docs/_build prune docs/node_modules diff --git a/Makefile b/Makefile index 8deb08b..67009ce 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ clean-docs: $(MAKE) -C docs/ clean clean-dist: - rm -rf "${SDIST}" "${WHEEL}" dddp/test/build/ dddp/test/meteor_todos/.meteor/local/ + rm -rf "${SDIST}" "${WHEEL}" tests/build/ tests/meteor_todos/.meteor/local/ clean-pyc: find . -type f -name \*.pyc -print0 | xargs -0 rm -f diff --git a/dddp/tests.py b/dddp/tests.py index 50a8909..22a0081 100644 --- a/dddp/tests.py +++ b/dddp/tests.py @@ -16,7 +16,7 @@ from dddp.main import DDPLauncher # pylint: disable=E0611, F0401 from six.moves.urllib_parse import urljoin -os.environ['DJANGO_SETTINGS_MODULE'] = 'dddp.test.test_project.settings' +os.environ['DJANGO_SETTINGS_MODULE'] = 'test_project.settings' DOCTEST_MODULES = [ dddp.alea, diff --git a/setup.py b/setup.py index e7e4dda..b0802e2 100755 --- a/setup.py +++ b/setup.py @@ -198,9 +198,9 @@ setuptools.setup( 'liveupdate live-update livequery live-query' ], license='MIT', - packages=setuptools.find_packages(), + packages=setuptools.find_packages(exclude=['tests*']), include_package_data=True, # install data files specified in MANIFEST.in - zip_safe=False, # TODO: Move dddp.test into it's own package. + zip_safe=True, setup_requires=[ # packages required to run the setup script __requires__, @@ -254,7 +254,7 @@ setuptools.setup( ], }, classifiers=CLASSIFIERS, - test_suite='dddp.test.manage.run_tests', + test_suite='tests.manage.run_tests', tests_require=[ 'requests', 'websocket_client', @@ -270,7 +270,7 @@ setuptools.setup( }, 'build_meteor': { 'meteor_builds': [ - ('dddp.test', 'meteor_todos', 'build', []), + ('tests', 'meteor_todos', 'build', []), ], }, }, diff --git a/dddp/test/__init__.py b/tests/__init__.py similarity index 100% rename from dddp/test/__init__.py rename to tests/__init__.py diff --git a/dddp/test/django_todos/__init__.py b/tests/django_todos/__init__.py similarity index 100% rename from dddp/test/django_todos/__init__.py rename to tests/django_todos/__init__.py diff --git a/dddp/test/django_todos/admin.py b/tests/django_todos/admin.py similarity index 100% rename from dddp/test/django_todos/admin.py rename to tests/django_todos/admin.py diff --git a/dddp/test/django_todos/ddp.py b/tests/django_todos/ddp.py similarity index 71% rename from dddp/test/django_todos/ddp.py rename to tests/django_todos/ddp.py index b4bc31b..b4d04d8 100644 --- a/dddp/test/django_todos/ddp.py +++ b/tests/django_todos/ddp.py @@ -1,5 +1,7 @@ +from __future__ import absolute_import, unicode_literals + from dddp.api import API, Collection, Publication -from dddp.test.django_todos import models +from django_todos import models class Task(Collection): diff --git a/dddp/test/django_todos/migrations/0001_initial.py b/tests/django_todos/migrations/0001_initial.py similarity index 100% rename from dddp/test/django_todos/migrations/0001_initial.py rename to tests/django_todos/migrations/0001_initial.py diff --git a/dddp/test/django_todos/migrations/__init__.py b/tests/django_todos/migrations/__init__.py similarity index 100% rename from dddp/test/django_todos/migrations/__init__.py rename to tests/django_todos/migrations/__init__.py diff --git a/dddp/test/django_todos/models.py b/tests/django_todos/models.py similarity index 100% rename from dddp/test/django_todos/models.py rename to tests/django_todos/models.py diff --git a/dddp/test/django_todos/tests.py b/tests/django_todos/tests.py similarity index 91% rename from dddp/test/django_todos/tests.py rename to tests/django_todos/tests.py index 70500dc..a4b6997 100644 --- a/dddp/test/django_todos/tests.py +++ b/tests/django_todos/tests.py @@ -4,7 +4,7 @@ import doctest import os import unittest -os.environ['DJANGO_SETTINGS_MODULE'] = 'dddp.test.test_project.settings' +os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_project.settings' DOCTEST_MODULES = [ ] diff --git a/dddp/test/django_todos/views.py b/tests/django_todos/views.py similarity index 66% rename from dddp/test/django_todos/views.py rename to tests/django_todos/views.py index 536524b..dea83e1 100644 --- a/dddp/test/django_todos/views.py +++ b/tests/django_todos/views.py @@ -1,13 +1,14 @@ +from __future__ import absolute_import import os.path from dddp.views import MeteorView -import dddp.test +import tests class MeteorTodos(MeteorView): """Meteor Todos.""" json_path = os.path.join( - os.path.dirname(dddp.test.__file__), + os.path.dirname(tests.__file__), 'build', 'bundle', 'star.json' ) diff --git a/dddp/test/manage.py b/tests/manage.py similarity index 85% rename from dddp/test/manage.py rename to tests/manage.py index 1fb14bf..b6f1a70 100755 --- a/dddp/test/manage.py +++ b/tests/manage.py @@ -6,7 +6,8 @@ import sys import dddp dddp.greenify() -os.environ['DJANGO_SETTINGS_MODULE'] = 'dddp.test.test_project.settings' +os.environ['DJANGO_SETTINGS_MODULE'] = 'test_project.settings' +sys.path.insert(0, os.path.dirname(__file__)) def run_tests(): diff --git a/dddp/test/meteor_todos/.meteor/.finished-upgraders b/tests/meteor_todos/.meteor/.finished-upgraders similarity index 100% rename from dddp/test/meteor_todos/.meteor/.finished-upgraders rename to tests/meteor_todos/.meteor/.finished-upgraders diff --git a/dddp/test/meteor_todos/.meteor/.gitignore b/tests/meteor_todos/.meteor/.gitignore similarity index 100% rename from dddp/test/meteor_todos/.meteor/.gitignore rename to tests/meteor_todos/.meteor/.gitignore diff --git a/dddp/test/meteor_todos/.meteor/.id b/tests/meteor_todos/.meteor/.id similarity index 100% rename from dddp/test/meteor_todos/.meteor/.id rename to tests/meteor_todos/.meteor/.id diff --git a/dddp/test/meteor_todos/.meteor/packages b/tests/meteor_todos/.meteor/packages similarity index 100% rename from dddp/test/meteor_todos/.meteor/packages rename to tests/meteor_todos/.meteor/packages diff --git a/dddp/test/meteor_todos/.meteor/platforms b/tests/meteor_todos/.meteor/platforms similarity index 100% rename from dddp/test/meteor_todos/.meteor/platforms rename to tests/meteor_todos/.meteor/platforms diff --git a/dddp/test/meteor_todos/.meteor/release b/tests/meteor_todos/.meteor/release similarity index 100% rename from dddp/test/meteor_todos/.meteor/release rename to tests/meteor_todos/.meteor/release diff --git a/dddp/test/meteor_todos/.meteor/versions b/tests/meteor_todos/.meteor/versions similarity index 100% rename from dddp/test/meteor_todos/.meteor/versions rename to tests/meteor_todos/.meteor/versions diff --git a/dddp/test/meteor_todos/meteor_todos.css b/tests/meteor_todos/meteor_todos.css similarity index 100% rename from dddp/test/meteor_todos/meteor_todos.css rename to tests/meteor_todos/meteor_todos.css diff --git a/dddp/test/meteor_todos/meteor_todos.html b/tests/meteor_todos/meteor_todos.html similarity index 100% rename from dddp/test/meteor_todos/meteor_todos.html rename to tests/meteor_todos/meteor_todos.html diff --git a/dddp/test/meteor_todos/meteor_todos.js b/tests/meteor_todos/meteor_todos.js similarity index 100% rename from dddp/test/meteor_todos/meteor_todos.js rename to tests/meteor_todos/meteor_todos.js diff --git a/dddp/test/test_project/__init__.py b/tests/test_project/__init__.py similarity index 100% rename from dddp/test/test_project/__init__.py rename to tests/test_project/__init__.py diff --git a/dddp/test/test_project/settings.py b/tests/test_project/settings.py similarity index 94% rename from dddp/test/test_project/settings.py rename to tests/test_project/settings.py index 713a29a..9e1cb92 100644 --- a/dddp/test/test_project/settings.py +++ b/tests/test_project/settings.py @@ -38,7 +38,7 @@ INSTALLED_APPS = ( 'django.contrib.staticfiles', 'dddp', 'dddp.accounts', - 'dddp.test.django_todos', + 'django_todos', ) MIDDLEWARE_CLASSES = ( @@ -51,9 +51,9 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) -ROOT_URLCONF = 'dddp.test.test_project.urls' +ROOT_URLCONF = 'test_project.urls' -WSGI_APPLICATION = 'dddp.test.test_project.wsgi.application' +WSGI_APPLICATION = 'test_project.wsgi.application' # Database diff --git a/dddp/test/test_project/urls.py b/tests/test_project/urls.py similarity index 83% rename from dddp/test/test_project/urls.py rename to tests/test_project/urls.py index abb4bd4..6f2b3d6 100644 --- a/dddp/test/test_project/urls.py +++ b/tests/test_project/urls.py @@ -3,13 +3,13 @@ from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin -from dddp.test.django_todos.views import MeteorTodos +from django_todos.views import MeteorTodos urlpatterns = patterns( '', # Examples: - # url(r'^$', 'dddp.test.test_project.views.home', name='home'), + # url(r'^$', 'test_project.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), diff --git a/dddp/test/test_project/wsgi.py b/tests/test_project/wsgi.py similarity index 70% rename from dddp/test/test_project/wsgi.py rename to tests/test_project/wsgi.py index d076675..a7a5657 100644 --- a/dddp/test/test_project/wsgi.py +++ b/tests/test_project/wsgi.py @@ -1,5 +1,5 @@ """ -WSGI config for dddp.test.test_project project. +WSGI config for test_project project. It exposes the WSGI callable as a module-level variable named ``application``. @@ -8,7 +8,7 @@ https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os -os.environ["DJANGO_SETTINGS_MODULE"] = "dddp.test.test_project.settings" +os.environ["DJANGO_SETTINGS_MODULE"] = "test_project.settings" from django.core.wsgi import get_wsgi_application application = get_wsgi_application() diff --git a/tox.ini b/tox.ini index f774af1..9ee0806 100644 --- a/tox.ini +++ b/tox.ini @@ -120,7 +120,7 @@ install_command=sh -c 'pip install -U "setuptools>=18.5" "wheel>=0.25.0" "pip>=7 whitelist_externals=sh commands = - check-manifest --ignore "dddp/test/build*,dddp/test/meteor_todos/.meteor/local*" + check-manifest --ignore "tests/build*,tests/meteor_todos/.meteor/local*" {envpython} setup.py --no-user-cfg sdist --dist-dir={toxinidir}/dist/ {envpython} setup.py --no-user-cfg bdist_wheel --dist-dir={toxinidir}/dist/ sh -c "cd docs && sphinx-build -b html -d _build/doctrees -D latex_paper_size=a4 . _build/html"