Permalink
Browse files

Refactor: tests to a separated layout, wiki package in src/ subdirectory

  • Loading branch information...
benjaoming committed Apr 21, 2017
1 parent a235fb2 commit b0edb877c3f9adeb02767d724606acd80e7fa41f
Showing 466 changed files with 125 additions and 115 deletions.
View
@@ -5,6 +5,8 @@ dist
testproject/testproject/whoosh_index/
testproject/testproject/xapian_index/
tests/media
# Ignore compiled version of source language
wiki/locale/en/LC_MESSAGES/django.mo
View
@@ -1,8 +1,9 @@
include COPYING
include README.rst
include setup.cfg
recursive-include wiki *.html *.txt *.png *.js *.css *.gif *.less *.mo *.po *.otf *.svg *.woff *.woff2 *.eot *.ttf
prune wiki/attachments
recursive-include src *.html *.txt *.png *.js *.css *.gif *.less *.mo *.po *.otf *.svg *.woff *.woff2 *.eot *.ttf
prune src/wiki/attachments
prune src/wiki/images
# Exclude compiled version of source language, it's meaningless
exclude wiki/locale/en/LC_MESSAGES/django.mo
View
@@ -1,6 +1,5 @@
[pytest]
django_find_project = false
python_files=test_*.py
testpaths=wiki
testpaths=tests
norecursedirs=testproject .svn _build tmp* dist *.egg-info
DJANGO_SETTINGS_MODULE=wiki.tests.settings
DJANGO_SETTINGS_MODULE=tests.settings
View
@@ -1,12 +1,19 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from __future__ import absolute_import, print_function
import os
import sys
from glob import glob
from setuptools import find_packages, setup
from wiki import __version__
sys.path.append(
os.path.join(os.path.dirname(__file__), 'src')
)
# noqa
from wiki import __version__ # isort:skip # noqa
# Utility function to read the README file.
@@ -38,8 +45,6 @@ def read_file(fname):
"Markdown>=2.6,<2.7",
]
packages = find_packages()
setup(
name="wiki",
@@ -50,12 +55,14 @@ def read_file(fname):
description="A wiki system written for the Django framework.",
license="GPLv3",
keywords=["django", "wiki", "markdown"],
packages=find_packages(exclude=["testproject", "testproject.*"]),
packages=find_packages('src'),
package_dir={'': 'src'},
py_modules=[os.path.splitext(os.path.basename(path))[0] for path in glob('src/*.py')],
long_description=read_file('README.rst'),
zip_safe=False,
install_requires=requirements,
classifiers=[
'Development Status :: 3 - Alpha',
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Environment :: Web Environment',
'Framework :: Django',
@@ -66,6 +73,10 @@ def read_file(fname):
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries :: Application Frameworks',
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,8 +1,8 @@
from __future__ import absolute_import, unicode_literals
import markdown
from markdown.util import etree
from markdown.treeprocessors import Treeprocessor
from markdown.util import etree
class ResponsiveTableExtension(markdown.Extension):
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -98,9 +98,11 @@ def get_git_changeset():
so it's sufficient for generating the development version numbers.
"""
repo_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
git_log = subprocess.Popen('git log --pretty=format:%ct --quiet -1 HEAD',
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
shell=True, cwd=repo_dir, universal_newlines=True)
git_log = subprocess.Popen(
'git log --pretty=format:%ct --quiet -1 HEAD',
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
shell=True, cwd=repo_dir, universal_newlines=True
)
timestamp = git_log.communicate()[0]
try:
timestamp = datetime.datetime.utcfromtimestamp(int(timestamp))
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,8 +1,8 @@
from __future__ import unicode_literals, absolute_import
from __future__ import absolute_import, unicode_literals
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.views.generic import ListView
from wiki import models
@@ -1,8 +1,8 @@
from __future__ import absolute_import, unicode_literals
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from django.conf.urls import url
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from . import settings, views
@@ -64,7 +64,6 @@ def __call__(self, request):
models.URLPath.root().article,
self.request.user):
self.results = self.__filter_can_read(self.request.user)
#self.results = self.results.filter(current_revision__deleted=False)
return self.create_response()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -34,7 +34,7 @@ class ImagePreprocessor(markdown.preprocessors.Preprocessor):
So: Remember that the caption text is fully valid markdown!
"""
def run(self, lines):
def run(self, lines): # NOQA
new_text = []
previous_line = ""
line_index = None
File renamed without changes.
@@ -0,0 +1,2 @@
from __future__ import absolute_import
from sorl.thumbnail.templatetags.thumbnail import register # NOQA
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.

0 comments on commit b0edb87

Please sign in to comment.