Skip to content

Commit

Permalink
Merge pull request #108 from uncovertruth/feature/remove_eol_versions
Browse files Browse the repository at this point in the history
Remove eol versions
  • Loading branch information
hirokinko authored Mar 30, 2018
2 parents cc1a268 + 8f4a818 commit 4619bf9
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 96 deletions.
78 changes: 30 additions & 48 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,38 @@ cache: pip
matrix:
fast_finish: true
include:
- python: 2.7
env: TOX_ENV=py27-dj19
- python: 3.4
env: TOX_ENV=py34-dj19
- python: 3.5
env: TOX_ENV=py35-dj19
- python: 2.7
env: TOX_ENV=py27-dj110
- python: 3.4
env: TOX_ENV=py34-dj110
- python: 3.5
env: TOX_ENV=py35-dj110
- python: 2.7
env: TOX_ENV=py27-dj111
- python: pypy
env: TOX_ENV=pypy-dj111
- python: 3.4
env: TOX_ENV=py34-dj111
- python: 3.5
env: TOX_ENV=py35-dj111
- python: 3.6
env: TOX_ENV=py36-dj111
- python: pypy3
env: TOX_ENV=pypy3-dj111
- python: 3.4
env: TOX_ENV=py34-dj20
- python: 3.5
env: TOX_ENV=py35-dj20
- python: 3.6
env: TOX_ENV=py36-dj20
- python: pypy3
env: TOX_ENV=pypy3-dj20
- python: 3.5
env: TOX_ENV=py35-djdev
- python: 3.6
env: TOX_ENV=py36-djdev
- python: 3.6
env: TOX_ENV=flake8
- python: 3.6
env: TOX_ENV=isort
- python: 3.6
env: TOX_ENV=readme
- python: 3.6
env: TOX_ENV=check-manifest
- env: TOX_ENV=py27-dj111
python: 2.7
- env: TOX_ENV=py34-dj111
python: 3.4
- env: TOX_ENV=pypy-dj111
python: pypy
- env: TOX_ENV=py35-dj111
python: 3.5
- env: TOX_ENV=py36-dj111
python: 3.6
- env: TOX_ENV=pypy3-dj111
python: pypy3
- env: TOX_ENV=py34-dj20
python: 3.4
- env: TOX_ENV=py35-dj20
python: 3.5
- env: TOX_ENV=py36-dj20
python: 3.6
- env: TOX_ENV=pypy3-dj20
python: pypy3
- env: TOX_ENV=py35-djmaster
python: 3.5
- env: TOX_ENV=py36-djmaster
python: 3.6
- env: TOX_ENV=flake8
- env: TOX_ENV=isort
- env: TOX_ENV=readme
- env: TOX_ENV=check-manifest
allow_failures:
- env: TOX_ENV=py35-djdev
- env: TOX_ENV=py36-djdev
- env: TOX_ENV=py35-djmaster
- env: TOX_ENV=py36-djmaster
# Use old sqlite3 that does not support shared memory
- env: TOX_ENV=py27-dj19
- env: TOX_ENV=py27-dj110
- env: TOX_ENV=py27-dj111
- env: TOX_ENV=pypy-dj111
addons:
Expand Down
10 changes: 10 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
History
=======

1.1.0 (2018-03-30)_

* Drop support for Django 1.9, 1.10

1.0.0 (2018-02-02)
------------------

* Add support for Django 2.0
* Drop support for Django 1.8

0.0.1 (2017-05-22)
------------------

Expand Down
2 changes: 1 addition & 1 deletion horizon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = """UNCOVER TRUTH Inc."""
__email__ = '[email protected]'
__version__ = '1.0.0'
__version__ = '1.1.0'
1 change: 0 additions & 1 deletion horizon/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
get_or_create_index,
)


_HORIZON_OPTIONS = (
'horizontal_group',
'horizontal_key',
Expand Down
1 change: 0 additions & 1 deletion horizon/routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
get_or_create_index,
)


logger = logging.getLogger(__name__)


Expand Down
1 change: 0 additions & 1 deletion horizon/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from django.conf import settings
from django.utils.lru_cache import lru_cache


CONFIG_DEFAULTS = {
'GROUPS': {},
'METADATA_MODEL': None,
Expand Down
8 changes: 1 addition & 7 deletions horizon/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,17 @@
import logging
import random

import django
from django.apps import apps
from django.core.exceptions import ImproperlyConfigured

from .settings import get_config


logger = logging.getLogger(__name__)


def get_metadata_model():
try:
if (1, 11) > django.VERSION:
return apps.get_model(get_config()['METADATA_MODEL'])
else:
return apps.get_model(get_config()['METADATA_MODEL'], require_ready=False)

return apps.get_model(get_config()['METADATA_MODEL'], require_ready=False)
except ValueError:
raise ImproperlyConfigured("METADATA_MODEL must be of the form 'app_label.model_name'")
except LookupError:
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ exclude =
include_trailing_comma=True
line_length=80
multi_line_output=3
skip=migrations
not_skip=__init__.py
known_first_party=horizon

Expand Down
5 changes: 1 addition & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
history = history_file.read()

requirements = [
'Django>=1.9',
'Django>=1.11',
]

test_requirements = [
Expand All @@ -38,8 +38,6 @@
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Web Environment',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Intended Audience :: Developers',
Expand All @@ -49,7 +47,6 @@
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
Expand Down
7 changes: 2 additions & 5 deletions tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

from __future__ import absolute_import, unicode_literals

from django.db import models
from django.conf import settings
from django.db import models

from horizon.manager import HorizontalManager
from horizon.models import (
AbstractHorizontalMetadata,
AbstractHorizontalModel,
)
from horizon.models import AbstractHorizontalMetadata, AbstractHorizontalModel


class HorizontalMetadata(AbstractHorizontalMetadata):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

from __future__ import absolute_import, unicode_literals

from django.db import models
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import models
from django.test import TestCase

from horizon.models import AbstractHorizontalModel

from .base import HorizontalBaseTestCase
from .models import (
ConcreteModel,
ManyModel,
HorizontalMetadata,
ManyModel,
OneModel,
ProxiedModel,
ProxyBaseModel,
)


user_model = get_user_model()


Expand Down
7 changes: 2 additions & 5 deletions tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@

from __future__ import absolute_import, unicode_literals

try:
from unittest.mock import patch
except ImportError:
from mock import patch
from unittest.mock import patch

from django.contrib.auth import get_user_model
from django.db.utils import ProgrammingError

from horizon.query import HorizontalQuerySet

from .base import HorizontalBaseTestCase
from .models import OneModel


user_model = get_user_model()


Expand Down
9 changes: 3 additions & 6 deletions tests/test_routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,22 @@

from __future__ import absolute_import, unicode_literals

try:
from unittest.mock import patch
except ImportError:
from mock import patch
from unittest.mock import patch

from django.contrib.auth import get_user_model

from horizon.routers import HorizontalRouter

from .base import HorizontalBaseTestCase
from .models import (
ConcreteModel,
ManyModel,
HorizontalMetadata,
ManyModel,
OneModel,
ProxiedModel,
ProxyBaseModel,
)


user_model = get_user_model()


Expand Down
8 changes: 4 additions & 4 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@

from horizon.utils import (
get_config,
get_metadata_model,
get_group_from_model,
get_key_field_name_from_model,
get_config_from_group,
get_config_from_model,
get_db_for_read_from_model_index,
get_db_for_write_from_model_index,
get_group_from_model,
get_key_field_name_from_model,
get_metadata_model,
get_or_create_index,
)

from .models import (
ConcreteModel,
HorizontalMetadata,
Expand All @@ -26,7 +27,6 @@
ProxyBaseModel,
)


user_model = get_user_model()


Expand Down
19 changes: 9 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[tox]
skip_missing_interpreters = true
envlist =
py{py,py3,27,33,34,35,36}-dj{19,110,111,20,dev},
py{py,py3,27,34,35,36}-dj111,
py{py3,34,35,36}-dj20,
py{py3,35,36}-djmaster,
flake8,
isort,
readme,
Expand All @@ -10,18 +12,15 @@ envlist =
[testenv]
basepython =
py27: python2.7
py33: python3.3
py34: python3.4
py35: python3.5
py36: python3.6
pypy: pypy
pypy3: pypy3
deps =
dj19: Django>=1.9,<1.10
dj110: Django>=1.10,<1.11
dj111: Django>=1.11,<2.0
dj20: Django>=2.0,<2.1
djdev: https://github.com/django/django/archive/master.tar.gz
djmaster: https://github.com/django/django/archive/master.tar.gz
py27: mock
coverage
py36-dj20: codecov
Expand All @@ -35,21 +34,21 @@ commands =
py36-dj20: codecov

[testenv:flake8]
basepython = python3.6
basepython = python3
deps = flake8
commands = flake8

[testenv:isort]
basepython = python3.6
basepython = python3
deps = isort
commands = isort --verbose --check-only --diff horizon tests setup.py
commands = isort --recursive --verbose --check-only --diff horizon tests setup.py

[testenv:readme]
basepython = python3.6
basepython = python3
deps = readme_renderer
commands = python setup.py check -r -s

[testenv:check-manifest]
basepython = python3.6
basepython = python3
deps = check-manifest
commands = check-manifest {toxinidir}

0 comments on commit 4619bf9

Please sign in to comment.