Skip to content

Commit

Permalink
Merge pull request #46 from HBS-HBX/#45_remove_support_for_python_2
Browse files Browse the repository at this point in the history
closes #45 remove support for python 2
  • Loading branch information
codekiln authored Nov 13, 2018
2 parents 1d8ad6c + 35d35da commit a247cf4
Show file tree
Hide file tree
Showing 32 changed files with 45 additions and 90 deletions.
10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ branches:

matrix:
include:
- env: TOX_ENV=py27-django19-es60 ES_APT_URL=https://artifacts.elastic.co/packages/6.x/apt
python: 2.7
- env: TOX_ENV=py27-django19-es61 ES_APT_URL=https://artifacts.elastic.co/packages/6.x/apt
python: 2.7
- env: TOX_ENV=py36-django19-es61 ES_APT_URL=https://artifacts.elastic.co/packages/6.x/apt
python: 3.6
- env: TOX_ENV=py35-django110-es60 ES_APT_URL=https://artifacts.elastic.co/packages/6.x/apt
python: 3.5
- env: TOX_ENV=py35-django111-es60 ES_APT_URL=https://artifacts.elastic.co/packages/6.x/apt
python: 3.5
# TBD support - will be implemented in #5
# allow_failures:
# - env: TOX_ENV=py27-django19-es62 ES_APT_URL=https://artifacts.elastic.co/packages/6.x/apt
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
---------

0.8.0 (2018-11-13)
^^^^^^^^^^^^^^^^^^^^^^
* fix `#6 support Django 2 <https://github.com/HBS-HBX/django-elastic-migrations/issues/6>`_
* fix `#43 remove es_deactivate <https://github.com/HBS-HBX/django-elastic-migrations/issues/43>`_
* fix `#44 add django 1.10 and 1.11 to test matrix <https://github.com/HBS-HBX/django-elastic-migrations/issues/44>`_
* fix `#45 remove support for python 2 <https://github.com/HBS-HBX/django-elastic-migrations/issues/45>`_
* In practice, Python 2 may work, but it is removed from the test matrix and won't be updated

0.7.8 (2018-11-13)
^^^^^^^^^^^^^^^^^^^^^^
* fix `#7 Convert Readme to rst for pypi <https://github.com/HBS-HBX/django-elastic-migrations/issues/7>`_
Expand Down
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Django Elastic Migrations
=========================

Django Elastic Migrations is a Django app for creating, indexing and changing schemas of Elasticsearch indexes.
`django-elastic-migrations`_ is a Django app for creating, indexing and changing schemas of Elasticsearch indexes.


.. image:: https://travis-ci.com/HBS-HBX/django-elastic-migrations.svg?branch=master
Expand All @@ -14,6 +14,7 @@ Django Elastic Migrations is a Django app for creating, indexing and changing sc
:target: https://codecov.io/gh/HBS-HBX/django-elastic-migrations
:alt: codecov

.. _django-elastic-migrations: https://pypi.org/project/django-elastic-migrations/

Overview
--------
Expand Down Expand Up @@ -100,7 +101,7 @@ Usage
Installation
~~~~~~~~~~~~

#. ``pip install django-elastic-migrations``
#. ``pip install django-elastic-migrations``; see `django-elastic-migrations`_ on PyPI
#. Put a reference to this package in your ``requirements.txt``
#. Ensure that a valid ``elasticsearch-dsl-py`` version is accessible, and configure
the path to your configured Elasticsearch singleton client in your django settings:
Expand Down
4 changes: 1 addition & 3 deletions django_elastic_migrations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
Migrate Elasticsearch-DSL Schemas in Django.
"""

from __future__ import print_function
from __future__ import absolute_import, unicode_literals

import sys

from django_elastic_migrations.utils import loading
from django_elastic_migrations.utils.django_elastic_migrations_log import get_logger

__version__ = '0.7.8'
__version__ = '0.8.0'

default_app_config = 'django_elastic_migrations.apps.DjangoElasticMigrationsConfig' # pylint: disable=invalid-name

Expand Down
1 change: 0 additions & 1 deletion django_elastic_migrations/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function, unicode_literals)

"""
django_elastic_migrations Django application initialization.
Expand Down
1 change: 0 additions & 1 deletion django_elastic_migrations/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function, unicode_literals)
from django.core.management import CommandError


Expand Down
1 change: 0 additions & 1 deletion django_elastic_migrations/indexes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# coding=utf-8
from __future__ import (absolute_import, division, print_function, unicode_literals)

import sys

Expand Down
5 changes: 1 addition & 4 deletions django_elastic_migrations/management/commands/es.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
from __future__ import (absolute_import, division, print_function, unicode_literals)
from django.core.management import BaseCommand, call_command, CommandError

from django_elastic_migrations.utils.django_elastic_migrations_log import get_logger


logger = get_logger()


commands = {
'list': 'List indexes; calls es_list',
'create': 'Create indexes; calls es_create',
Expand Down Expand Up @@ -76,7 +73,7 @@ def get_index_specifying_argument_flag(cls, parser, flag, default=False):

@classmethod
def get_index_specifying_arguments(
cls, parser, include_exact=True, default_all=False, include_older=False, include_newer=False):
cls, parser, include_exact=True, default_all=False, include_older=False, include_newer=False):
messages = cls.get_index_specifying_help_messages()
parser.add_argument(
'index', nargs='*',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function, unicode_literals)
from django_elastic_migrations import DEMIndexManager
from django_elastic_migrations.management.commands.es import ESCommand

Expand Down
2 changes: 0 additions & 2 deletions django_elastic_migrations/management/commands/es_clear.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from __future__ import (absolute_import, division, print_function, unicode_literals)
from django_elastic_migrations import DEMIndexManager
from django_elastic_migrations.management.commands.es import ESCommand
from django_elastic_migrations.utils.django_elastic_migrations_log import get_logger


logger = get_logger()


Expand Down
3 changes: 0 additions & 3 deletions django_elastic_migrations/management/commands/es_create.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function, unicode_literals)

from django_elastic_migrations import DEMIndexManager
from django_elastic_migrations.management.commands.es import ESCommand

Expand Down Expand Up @@ -36,4 +34,3 @@ def handle(self, *args, **options):
force=force,
es_only=es_only
)

Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
from __future__ import (absolute_import, division, print_function, unicode_literals)
from django.core.management import call_command

from django_elastic_migrations import DEMIndexManager
from django_elastic_migrations.management.commands.es import ESCommand
from django_elastic_migrations.models import Index
from django_elastic_migrations.utils.django_elastic_migrations_log import get_logger


logger = get_logger()


Expand Down
Empty file.
2 changes: 0 additions & 2 deletions django_elastic_migrations/management/commands/es_drop.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function, unicode_literals)

from django_elastic_migrations import DEMIndexManager
from django_elastic_migrations.exceptions import CannotDropAllIndexesWithoutForceArg
from django_elastic_migrations.management.commands.es import ESCommand
Expand Down
1 change: 0 additions & 1 deletion django_elastic_migrations/management/commands/es_list.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import (absolute_import, division, print_function, unicode_literals)
from texttable import Texttable

from django_elastic_migrations import DEMIndexManager
Expand Down
3 changes: 0 additions & 3 deletions django_elastic_migrations/management/commands/es_update.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
from __future__ import (absolute_import, division, print_function, unicode_literals)

from dateutil.parser import parse as dateutil_parse

from django_elastic_migrations import DEMIndexManager, get_logger
from django_elastic_migrations.management.commands.es import ESCommand
from django_elastic_migrations.utils.multiprocessing_utils import USE_ALL_WORKERS


log = get_logger()


Expand Down
14 changes: 8 additions & 6 deletions django_elastic_migrations/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2018-05-23 16:44
from __future__ import print_function
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
from django.db import migrations, models

import django_elastic_migrations.models


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand All @@ -27,11 +25,15 @@ class Migration(migrations.Migration):
name='IndexAction',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('action', models.CharField(choices=[('create_index', 'create_index'), ('activate_index', 'activate_index'), ('clear_index', 'clear_index'), ('update_index', 'update_index'), ('drop_index', 'drop_index'), ('deactivate_index', 'deactivate_index')], max_length=64)),
('action', models.CharField(choices=[('create_index', 'create_index'), ('activate_index', 'activate_index'), ('clear_index', 'clear_index'),
('update_index', 'update_index'), ('drop_index', 'drop_index'), ('deactivate_index', 'deactivate_index')],
max_length=64)),
('start', models.DateTimeField(auto_now_add=True)),
('end', models.DateTimeField(blank=True, null=True)),
('last_modified', models.DateTimeField(auto_now=True)),
('status', models.CharField(choices=[('in_progress', 'in_progress'), ('complete', 'complete'), ('aborted', 'aborted'), ('queued', 'queued')], default='queued', max_length=32)),
('status',
models.CharField(choices=[('in_progress', 'in_progress'), ('complete', 'complete'), ('aborted', 'aborted'), ('queued', 'queued')], default='queued',
max_length=32)),
('log', models.TextField(blank=True)),
('index', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='django_elastic_migrations.Index')),
],
Expand Down
3 changes: 0 additions & 3 deletions django_elastic_migrations/migrations/0002_indexaction_argv.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2018-05-31 10:09
from __future__ import print_function
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('django_elastic_migrations', '0001_initial'),
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2018-05-31 20:18
from __future__ import print_function
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('django_elastic_migrations', '0002_indexaction_argv'),
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2018-07-03 12:32
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('django_elastic_migrations', '0003_indexaction_docs_affected'),
]
Expand All @@ -15,6 +13,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='indexaction',
name='action',
field=models.CharField(choices=[('create_index', 'create_index'), ('update_index', 'update_index'), ('activate_index', 'activate_index'), ('deactivate_index', 'deactivate_index'), ('clear_index', 'clear_index'), ('drop_index', 'drop_index')], max_length=64),
field=models.CharField(choices=[('create_index', 'create_index'), ('update_index', 'update_index'), ('activate_index', 'activate_index'),
('deactivate_index', 'deactivate_index'), ('clear_index', 'clear_index'), ('drop_index', 'drop_index')], max_length=64),
),
]
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2018-07-03 13:40
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('django_elastic_migrations', '0004_auto_20180703_1232'),
]
Expand All @@ -15,6 +13,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='indexaction',
name='status',
field=models.CharField(choices=[('queued', 'queued'), ('in_progress', 'in_progress'), ('complete', 'complete'), ('aborted', 'aborted')], default='queued', max_length=32),
field=models.CharField(choices=[('queued', 'queued'), ('in_progress', 'in_progress'), ('complete', 'complete'), ('aborted', 'aborted')],
default='queued', max_length=32),
),
]
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2018-07-09 21:01
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('django_elastic_migrations', '0005_auto_20180703_1340'),
]
Expand Down Expand Up @@ -35,6 +33,8 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='indexaction',
name='action',
field=models.CharField(choices=[('create_index', 'create_index'), ('update_index', 'update_index'), ('activate_index', 'activate_index'), ('deactivate_index', 'deactivate_index'), ('clear_index', 'clear_index'), ('drop_index', 'drop_index'), ('partial_update_index', 'partial_update_index')], max_length=64),
field=models.CharField(choices=[('create_index', 'create_index'), ('update_index', 'update_index'), ('activate_index', 'activate_index'),
('deactivate_index', 'deactivate_index'), ('clear_index', 'clear_index'), ('drop_index', 'drop_index'),
('partial_update_index', 'partial_update_index')], max_length=64),
),
]
6 changes: 1 addition & 5 deletions django_elastic_migrations/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function, unicode_literals)

import datetime
import json
Expand All @@ -13,7 +12,6 @@

from django.db import models, transaction, OperationalError
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from elasticsearch import TransportError

from django_elastic_migrations import codebase_id, environment_prefix, DEMIndexManager, es_client
Expand All @@ -25,7 +23,6 @@
logger = get_logger()


@python_2_unicode_compatible
class Index(models.Model):
"""
Model that retains information about all Elasticsearch indexes
Expand Down Expand Up @@ -106,7 +103,6 @@ def get_newer_versions(self, given_version=None, prefix=environment_prefix):
return self._get_other_versions(given_version, prefix, older=False)


@python_2_unicode_compatible
class IndexVersion(models.Model):
"""
Each IndexVersion corresponds with an Elasticsearch index
Expand Down Expand Up @@ -192,7 +188,6 @@ def exists_in_es(self):
return es_client.indices.exists(index=self.name)


@python_2_unicode_compatible
class IndexAction(models.Model):
"""
Each Action is a record of a bulk change to a particular
Expand Down Expand Up @@ -403,6 +398,7 @@ def get_task_kwargs(self):
return json.loads(self.task_kwargs)
return {}


"""
↓ Action Mixins Below ↓
Expand Down
1 change: 0 additions & 1 deletion django_elastic_migrations/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function, unicode_literals)
"""
URLs for django_elastic_migrations.
"""
Expand Down
1 change: 0 additions & 1 deletion django_elastic_migrations/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from __future__ import (absolute_import, division, print_function, unicode_literals)
import importlib
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from __future__ import (absolute_import, division, print_function, unicode_literals)

import logging

from multiprocessing_logging import install_mp_handler


mp_logging_enabled = False


Expand Down
1 change: 0 additions & 1 deletion django_elastic_migrations/utils/es_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import hashlib
import json

Expand Down
1 change: 0 additions & 1 deletion django_elastic_migrations/utils/loading.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# encoding: utf-8
from __future__ import (absolute_import, division, print_function, unicode_literals)

from django_elastic_migrations.utils import importlib

Expand Down
Loading

0 comments on commit a247cf4

Please sign in to comment.