Skip to content

Commit

Permalink
Merge branch 'feature/updating' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Fantomas42 committed Mar 6, 2017
2 parents dbdb646 + 49444aa commit 9ca4396
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 52 deletions.
7 changes: 2 additions & 5 deletions .travis.yml
Expand Up @@ -2,15 +2,12 @@ sudo: false
language: python
python:
- 2.7
- 3.3
- 3.4
- 3.5
env:
- DJANGO=1.8
- DJANGO=1.9
matrix:
exclude:
- python: 3.3
env: DJANGO=1.9
- DJANGO=1.10
install:
- pip install -U setuptools
- python bootstrap.py
Expand Down
10 changes: 5 additions & 5 deletions app_namespace/loader.py
@@ -1,13 +1,11 @@
"""Template loader for app-namespace"""
import os
import io
import errno
import io
import os
from collections import OrderedDict

import django
from django.apps import apps
from django.utils._os import upath
from django.utils._os import safe_join
try:
from django.template import Origin
except ImportError: # pragma: no cover
Expand All @@ -16,8 +14,10 @@ def __init__(self, **kwargs):
for k, v in kwargs.items():
setattr(self, k, v)
from django.template import TemplateDoesNotExist
from django.utils.functional import cached_property
from django.template.loaders.base import Loader as BaseLoader
from django.utils._os import safe_join
from django.utils._os import upath
from django.utils.functional import cached_property


class NamespaceOrigin(Origin):
Expand Down
12 changes: 6 additions & 6 deletions app_namespace/tests/tests.py
@@ -1,21 +1,21 @@
"""Tests for app_namespace"""
import os
import sys
import shutil
import sys
import tempfile

from app_namespace import Loader

import django
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.template import TemplateDoesNotExist
from django.template.base import Context
from django.template.base import Template
from django.template.engine import Engine
from django.template import TemplateDoesNotExist
from django.template.loaders import app_directories
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings

from app_namespace import Loader


class LoaderTestCase(TestCase):

Expand Down
4 changes: 2 additions & 2 deletions app_namespace/tests/urls.py
@@ -1,8 +1,8 @@
"""Urls for testing app_namespace"""
from django.conf.urls import url
from django.conf.urls import include
from django.views.generic import TemplateView
from django.conf.urls import url
from django.contrib import admin
from django.views.generic import TemplateView

admin.autodiscover()

Expand Down
25 changes: 18 additions & 7 deletions bootstrap.py
Expand Up @@ -35,7 +35,7 @@
Simply run this script in a directory containing a buildout.cfg, using the
Python that you want bin/buildout to use.
Note that by using --find-links to point to local resources, you can keep
Note that by using --find-links to point to local resources, you can keep
this script from going over the network.
'''

Expand All @@ -59,6 +59,8 @@
parser.add_option("--allow-site-packages",
action="store_true", default=False,
help=("Let bootstrap.py use existing site packages"))
parser.add_option("--setuptools-version",
help="use a specific setuptools version")


options, args = parser.parse_args()
Expand All @@ -79,16 +81,20 @@

if not options.allow_site_packages:
# ez_setup imports site, which adds site packages
# this will remove them from the path to ensure that incompatible versions
# this will remove them from the path to ensure that incompatible versions
# of setuptools are not in the path
import site
# inside a virtualenv, there is no 'getsitepackages'.
# inside a virtualenv, there is no 'getsitepackages'.
# We can't remove these reliably
if hasattr(site, 'getsitepackages'):
for sitepackage_path in site.getsitepackages():
sys.path[:] = [x for x in sys.path if sitepackage_path not in x]

setup_args = dict(to_dir=tmpeggs, download_delay=0)

if options.setuptools_version is not None:
setup_args['version'] = options.setuptools_version

ez['use_setuptools'](**setup_args)
import setuptools
import pkg_resources
Expand Down Expand Up @@ -128,10 +134,15 @@
_final_parts = '*final-', '*final'

def _final_version(parsed_version):
for part in parsed_version:
if (part[:1] == '*') and (part not in _final_parts):
return False
return True
try:
return not parsed_version.is_prerelease
except AttributeError:
# Older setuptools
for part in parsed_version:
if (part[:1] == '*') and (part not in _final_parts):
return False
return True

index = setuptools.package_index.PackageIndex(
search_path=[setuptools_path])
if find_links:
Expand Down
5 changes: 3 additions & 2 deletions buildout.cfg
Expand Up @@ -7,8 +7,7 @@ parts = demo
coveralls
evolution
develop = .
eggs = six
django
eggs = django
django-app-namespace-template-loader
show-picked-versions = true

Expand Down Expand Up @@ -43,6 +42,8 @@ environment = testenv
[flake8]
recipe = zc.recipe.egg
eggs = flake8
flake8-import-order
pep8-naming

[coveralls]
recipe = zc.recipe.egg
Expand Down
2 changes: 1 addition & 1 deletion setup.py
@@ -1,8 +1,8 @@
"""Setup script for django-app-namespace-template-loader"""
import os

from setuptools import setup
from setuptools import find_packages
from setuptools import setup

__version__ = '0.4.1'
__license__ = 'BSD License'
Expand Down
47 changes: 23 additions & 24 deletions versions.cfg
@@ -1,25 +1,24 @@
[versions]
argparse = 1.4.0
blessings = 1.6
buildout-versions-checker = 1.9.3
coverage = 4.0.3
django = 1.9.1
djangorecipe = 2.1.2
flake8 = 2.5.1
futures = 3.0.4
mccabe = 0.3.1
nose = 1.3.7
nose-progressive = 1.5.1
nose-sfd = 0.4
packaging = 16.0
pbp.recipe.noserunner = 0.2.6
pep8 = 1.7.0
pyflakes = 1.0.0
python-coveralls = 2.6.0
pyyaml = 3.11
requests = 2.9.1
setuptools = 19.4
sh = 1.11
six = 1.10.0
zc.buildout = 2.5.0
zc.recipe.egg = 2.0.3
blessings = 1.6
buildout-versions-checker = 1.9.4
configparser = 3.5.0
coverage = 4.0.3
django = 1.10.6
djangorecipe = 2.2.1
enum34 = 1.1.6
flake8 = 3.3.0
flake8-import-order = 0.12
futures = 3.0.5
mccabe = 0.6.1
nose = 1.3.7
nose-progressive = 1.5.1
nose-sfd = 0.4
pbp.recipe.noserunner = 0.2.6
pep8-naming = 0.4.1
pycodestyle = 2.3.1
pyflakes = 1.5.0
python-coveralls = 2.9.0
pyyaml = 3.12
requests = 2.13.0
zc.buildout = 2.9.1
zc.recipe.egg = 2.0.3

0 comments on commit 9ca4396

Please sign in to comment.