Skip to content

Commit

Permalink
Merge pull request #106 from littleweaver/2.2.3
Browse files Browse the repository at this point in the history
2.2.3
Adds testing & official support for Django 1.11 & 1.10, and bumps version numbers.
  • Loading branch information
raq929 committed Apr 28, 2017
2 parents 546acdf + e6262be commit e3efdb8
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 25 deletions.
22 changes: 21 additions & 1 deletion .travis.yml
@@ -1,3 +1,5 @@
dist: trusty
sudo: required
language: python
python:
- "2.7"
Expand All @@ -14,6 +16,12 @@ env:
- DB=sqlite3 DJANGO=1.9
- DB=mysql DJANGO=1.9
- DB=postgres DJANGO=1.9
- DB=sqlite3 DJANGO=1.10
- DB=mysql DJANGO=1.10
- DB=postgres DJANGO=1.10
- DB=sqlite3 DJANGO=1.11
- DB=mysql DJANGO=1.11
- DB=postgres DJANGO=1.11
matrix:
exclude:
- python: "3.5"
Expand All @@ -28,12 +36,24 @@ matrix:
env: DB=postgres DJANGO=1.9
- python: "3.3"
env: DB=mysql DJANGO=1.9
- python: "3.3"
env: DB=sqlite3 DJANGO=1.10
- python: "3.3"
env: DB=postgres DJANGO=1.10
- python: "3.3"
env: DB=mysql DJANGO=1.10
- python: "3.3"
env: DB=sqlite3 DJANGO=1.11
- python: "3.3"
env: DB=postgres DJANGO=1.11
- python: "3.3"
env: DB=mysql DJANGO=1.11
install:
- pip install . --no-deps
- pip install --no-deps -r test_project/requirements-$DJANGO.txt
- pip install flake8
- if [ $DB == 'mysql' ]; then pip install --no-deps mysqlclient; fi
- if [ $DB == 'postgres' ]; then pip install --no-deps psycopg2==2.5.3; fi
- if [ $DB == 'postgres' ]; then pip install --no-deps psycopg2==2.7.1; fi
before_script:
- "flake8 --ignore=E501,E731 daguerre"
- if [ $DB == 'mysql' ]; then mysql -e 'CREATE DATABASE daguerre_test;'; fi
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -29,7 +29,7 @@ Requirements

* Python 2.7+, 3.3+
* Pillow
* Django 1.7, 1.8 & 1.9
* Django 1.7 – 1.11
* Six 1.10.0+

Daguerre *may* work with earlier or later versions of these packages, but they are not officially supported.
Expand Down
2 changes: 1 addition & 1 deletion daguerre/__init__.py
@@ -1 +1 @@
__version__ = (2, 2, 2)
__version__ = (2, 2, 3)
2 changes: 2 additions & 0 deletions daguerre/helpers.py
Expand Up @@ -55,6 +55,8 @@ def adjust(path_or_iterable, adjustment=None, lookup=None, generate=False, **kwa
if adjustment:
helper.adjust(adjustment, **kwargs)
return helper


if jingo:
jingo.register.filter(adjust)

Expand Down
45 changes: 28 additions & 17 deletions daguerre/management/commands/_daguerre_preadjust.py
Expand Up @@ -31,24 +31,35 @@
"""


# Store option kwargs as consts so that we can reuse them
# between compatibility sets
REMOVE_OPTION_KWARGS = {
'action': 'store_true',
'dest': 'remove',
'default': False,
'help': "Remove all adjustments that aren't listed in DAGUERRE_PREADJUSTMENTS",
}

NOCREATE_OPTION_KWARGS = {
'action': 'store_true',
'dest': 'nocreate',
'default': False,
'help': "Don't create any new adjustments."
}


class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option(
'--remove',
action='store_true',
dest='remove',
default=False,
help="Remove all adjustments that aren't "
"listed in DAGUERRE_PREADJUSTMENTS",
),
make_option(
'--nocreate',
action='store_true',
dest='nocreate',
default=False,
help="Don't create any new adjustments."
),
)
if hasattr(BaseCommand, 'option_list'):
# Django < 1.10
option_list = BaseCommand.option_list + (
make_option('--remove', **REMOVE_OPTION_KWARGS),
make_option('--nocreate', **NOCREATE_OPTION_KWARGS),
)
else:
# Django >= 1.10
def add_arguments(self, parser):
parser.add_argument('--remove', **REMOVE_OPTION_KWARGS)
parser.add_argument('--nocreate', **NOCREATE_OPTION_KWARGS)

def _get_helpers(self):
if not hasattr(settings, 'DAGUERRE_PREADJUSTMENTS'):
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -54,7 +54,7 @@
# The short X.Y version.
version = '2.2'
# The full version, including alpha/beta/rc tags.
release = '2.2.2'
release = '2.2.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/installation-and-setup.rst
Expand Up @@ -45,7 +45,7 @@ Versions and Requirements

* Python 2.7+, 3.3+
* Pillow
* Django 1.7, 1.8 & 1.9
* Django 1.7 – 1.11
* Six 1.10.0+

Daguerre *may* work with earlier versions of these packages, but they
Expand Down
8 changes: 8 additions & 0 deletions docs/release-notes/2.2.3.rst
@@ -0,0 +1,8 @@
2.2.3 (2017-04-27)
------------------

* Doc updates
* Corrected preadjust behavior
* Corrected rounding of floating point numbers (thanks `@fitodic <https://github.com/fitodic>`_!)
* Allowed customizing the image storage path, and improved the default path (thanks `@fitodic <https://github.com/fitodic>`_!)
* Added official support for Django 1.10 & 1.11
1 change: 1 addition & 0 deletions docs/release-notes/index.rst
Expand Up @@ -4,6 +4,7 @@ Release Notes
.. toctree::
:maxdepth: 2

2.2.3
2.2.2
2.2.1
2.2.0
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -21,7 +21,7 @@
zip_safe=False,
install_requires=[
'Pillow',
'django>=1.7,<1.10',
'django>=1.7,<1.12',
'six>=1.10.0',
],
extras_require={
Expand Down
2 changes: 2 additions & 0 deletions test_project/requirements-1.10.txt
@@ -0,0 +1,2 @@
Django==1.10.7
-r requirements.txt
3 changes: 3 additions & 0 deletions test_project/requirements-1.11.txt
@@ -0,0 +1,3 @@
Django==1.11
pytz==2017.2
-r requirements.txt
46 changes: 44 additions & 2 deletions tox.ini
Expand Up @@ -9,7 +9,13 @@ envlist =
py35-django18,
py27-django19,
py34-django19,
py35-django19
py35-django19,
py27-django110,
py34-django110,
py35-django110,
py27-django111,
py34-django111,
py35-django111

[testenv]
changedir = {toxinidir}/test_project
Expand Down Expand Up @@ -74,4 +80,40 @@ deps =
basepython=python3.5
deps =
--no-deps
-r{toxinidir}/test_project/requirements-1.9.txt
-r{toxinidir}/test_project/requirements-1.9.txt

[testenv:py27-django110]
basepython=python2.7
deps =
--no-deps
-r{toxinidir}/test_project/requirements-1.10.txt

[testenv:py34-django110]
basepython=python3.4
deps =
--no-deps
-r{toxinidir}/test_project/requirements-1.10.txt

[testenv:py35-django110]
basepython=python3.5
deps =
--no-deps
-r{toxinidir}/test_project/requirements-1.10.txt

[testenv:py27-django111]
basepython=python2.7
deps =
--no-deps
-r{toxinidir}/test_project/requirements-1.11.txt

[testenv:py34-django111]
basepython=python3.4
deps =
--no-deps
-r{toxinidir}/test_project/requirements-1.11.txt

[testenv:py35-django111]
basepython=python3.5
deps =
--no-deps
-r{toxinidir}/test_project/requirements-1.11.txt

0 comments on commit e3efdb8

Please sign in to comment.