Skip to content

Commit 7105292

Browse files
committed
Merge branch 'release/4.1.x'
* release/4.1.x: Bump version to 4.1.0 Fix python 2 compatibility Ensure Python 2.7 compatibility Import force/smart_str instead of force/smart_text Run coverage-report (combined coverage) on Python 3.10 Add myself to the list of contributors Add more Python versions to the classifiers Remove PIL from the installation instructions Fix spelling / rst errors Use GitHub actions workflow badge Minor improvements to the tests Add coverage reporting Add Python 3.10 to the test matrix Switch from django-nose to pytest-django Remove Python 3.10 from the test matrix because nose doesn't work Upgrade pip before installing other dependencies Django master branch has been renamed to main at some point Use tox-gh-actions Workaround SuspiciousFileOperation Remove nose-progressive, it doesn't seem to work with recent Python versions Only test on currently supported versions of Python and Django Switch to GitHub Actions chore: Set django-dramatiq min version chore: Add 'async_dramatiq' extra, django-dramatiq dependency feat: Add Dramatiq backend Accept cachefile_storage that is callable Add support of celery 5.* Use gettext_lazy in Django 2.0+ (ugettext_lazy is deprecated) Fix deprecation warning regarding invalid escape sequences. docs: Fix simple typo, assigment -> assignment fix broken links in documentation (#319) Pass features to BeautifulSoup constructor Do not check for existence if name is None Python 3.6 and Django 2.1 Fix pickle serialization for ImageCacheFile Enhance condition in _get_size (#463) Test against Django 2.0
2 parents 097999f + 7da461c commit 7105292

35 files changed

+298
-366
lines changed

.coveragerc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[run]
2+
branch = true
3+
parallel = true
4+
5+
[report]
6+
show_missing = true
7+
skip_empty = true
8+
skip_covered = true
9+
precision = 2

.github/workflows/python.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Python CI
2+
3+
on:
4+
push:
5+
branches: [ develop ]
6+
pull_request:
7+
branches: [ develop ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
strategy:
14+
max-parallel: 4
15+
matrix:
16+
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10']
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install tox tox-gh-actions
29+
30+
- name: Run tests
31+
run: tox

.travis.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Contributors
2929
* `Sean Bell`_
3030
* `Saul Shanabrook`_
3131
* `Venelin Stoykov`_
32+
* `Jaap Roes`_
3233

3334
.. _Justin Driscoll: http://github.com/jdriscoll
3435
.. _HZDG: http://hzdg.com
@@ -51,3 +52,4 @@ Contributors
5152
.. _Sean Bell: https://github.com/seanbell
5253
.. _Saul Shanabrook: https://github.com/saulshanabrook
5354
.. _Venelin Stoykov: https://github.com/vstoykov
55+
.. Jaap Roes: https://github.com/jaap3

CONTRIBUTING.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ contributions merged as quickly as possible:
1111
tests, first install tox, ``pip install tox``, then use ``tox``. This will let you know about any errors or style
1212
issues.
1313
4. While we're talking about tests, creating new ones for your code makes it
14-
much easier for us to merge your code quickly. ImageKit uses nose_, so
14+
much easier for us to merge your code quickly. ImageKit uses pytest_, so
1515
writing tests is painless. Check out `ours`__ for examples.
1616
5. It's a good idea to do your work in a branch; that way, you can work on more
1717
than one contribution at a time without making them interdependent.
@@ -20,5 +20,5 @@ contributions merged as quickly as possible:
2020
__ http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
2121
__ https://groups.google.com/forum/#!forum/django-imagekit
2222
__ irc://irc.freenode.net/imagekit
23-
.. _nose: https://nose.readthedocs.org/en/latest/
23+
.. _pytest: https://docs.pytest.org/en/latest/
2424
__ https://github.com/matthewwithanm/django-imagekit/tree/develop/tests

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
include AUTHORS
22
include LICENSE
33
include README.rst
4+
include pytest.ini
5+
include test-requirements.txt
46
include testrunner.py
57
include setup.cfg
68
include tests/*.py

README.rst

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
|Build Status|_
22

3-
.. |Build Status| image:: https://travis-ci.org/matthewwithanm/django-imagekit.svg?branch=develop
4-
.. _Build Status: https://travis-ci.org/matthewwithanm/django-imagekit
3+
.. |Build Status| image:: https://github.com/matthewwithanm/django-imagekit/actions/workflows/python.yml/badge.svg?branch=develop
4+
.. _Build Status: https://github.com/matthewwithanm/django-imagekit/actions/workflows/python.yml
55

66
ImageKit is a Django app for processing images. Need a thumbnail? A
77
black-and-white version of a user-uploaded image? ImageKit will make them for
8-
you. If you need to programatically generate one image from another, you need
8+
you. If you need to programmatically generate one image from another, you need
99
ImageKit.
1010

1111
ImageKit comes with a bunch of image processors for common tasks like resizing
@@ -22,23 +22,18 @@ __ https://github.com/fish2000/instakit
2222
Installation
2323
============
2424

25-
1. Install `PIL`_ or `Pillow`_. (If you're using an ``ImageField`` in Django,
25+
1. Install `Pillow`_. (If you're using an ``ImageField`` in Django,
2626
you should have already done this.)
2727
2. ``pip install django-imagekit``
28-
3. Add ``'imagekit'`` to your ``INSTALLED_APPS`` list in your project's settings.py
28+
3. Add ``'imagekit'`` to your ``INSTALLED_APPS`` list in your project's ``settings.py``
2929

30-
.. note:: If you've never seen Pillow before, it considers itself a
31-
more-frequently updated "friendly" fork of PIL that's compatible with
32-
setuptools. As such, it shares the same namespace as PIL does and is a
33-
drop-in replacement.
34-
35-
.. _`PIL`: http://pypi.python.org/pypi/PIL
3630
.. _`Pillow`: http://pypi.python.org/pypi/Pillow
3731

3832

3933
Usage Overview
4034
==============
4135

36+
.. _specs:
4237

4338
Specs
4439
-----
@@ -446,7 +441,7 @@ AdminThumbnail can even use a custom template. For more information, see
446441
Management Commands
447442
-------------------
448443

449-
ImageKit has one management command—`generateimages`—which will generate cache
444+
ImageKit has one management command—``generateimages``—which will generate cache
450445
files for all of your registered image generators. You can also pass it a list
451446
of generator ids in order to generate images selectively.
452447

@@ -472,9 +467,8 @@ people, open a pull request so we can take a look!
472467
You can also check out our list of `open, contributor-friendly issues`__ for
473468
ideas.
474469

475-
Check out our `contributing guidelines`__ for more information about pitching in
470+
Check out our `contributing guidelines`_ for more information about pitching in
476471
with ImageKit.
477472

478-
479473
__ https://github.com/matthewwithanm/django-imagekit/issues?labels=contributor-friendly&state=open
480-
__ https://github.com/matthewwithanm/django-imagekit/blob/develop/CONTRIBUTING.rst
474+
.. _`contributing guidelines`: https://github.com/matthewwithanm/django-imagekit/blob/develop/CONTRIBUTING.rst

docs/caching.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Caching
33

44

55
Default Backend Workflow
6-
================
6+
========================
77

88

99
``ImageSpec``
@@ -29,6 +29,8 @@ objects, but they've got a little trick up their sleeve: they represent files
2929
that may not actually exist!
3030

3131

32+
.. _cache-file-strategy:
33+
3234
Cache File Strategy
3335
-------------------
3436

@@ -55,6 +57,8 @@ The default strategy only defines the first two of these, as follows:
5557
file.generate()
5658
5759
60+
.. _cache-file-backend:
61+
5862
Cache File Backend
5963
------------------
6064

@@ -185,6 +189,11 @@ Or, in Python:
185189
def on_source_saved(self, file):
186190
file.generate()
187191

192+
.. note::
193+
194+
If you use custom storage backend for some specs,
195+
(storage passed to the field different than configured one)
196+
it's required the storage to be pickleable
188197

189198

190199
__ https://pypi.python.org/pypi/django-celery

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
# built documents.
5555
#
5656
# The short X.Y version.
57-
version = re.match('\d+\.\d+', pkgmeta['__version__']).group()
57+
version = re.match(r'\d+\.\d+', pkgmeta['__version__']).group()
5858
# The full version, including alpha/beta/rc tags.
5959
release = pkgmeta['__version__']
6060

docs/upgrading.rst

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,9 @@ IK3 provides analogous settings for cache file backends and strategies:
7979
IMAGEKIT_DEFAULT_CACHEFILE_BACKEND = 'path.to.MyCacheFileBackend'
8080
IMAGEKIT_DEFAULT_CACHEFILE_STRATEGY = 'path.to.MyCacheFileStrategy'
8181
82-
See the documentation on `cache file backends`_ and `cache file strategies`_
82+
See the documentation on :ref:`cache file backends <cache-file-backend>` and :ref:`cache file strategies <cache-file-strategy>`
8383
for more details.
8484

85-
.. _`cache file backends`:
86-
.. _`cache file strategies`:
87-
8885

8986
Conditional model ``processors``
9087
--------------------------------
@@ -93,9 +90,7 @@ In IK2, an ``ImageSpecField`` could take a ``processors`` callable instead of
9390
an iterable, which allowed processing decisions to made based on other
9491
properties of the model. IK3 does away with this feature for consistency's sake
9592
(if one kwarg could be callable, why not all?), but provides a much more robust
96-
solution: the custom ``spec``. See the `advanced usage`_ documentation for more.
97-
98-
.. _`advanced usage`:
93+
solution: the custom ``spec``. See the :doc:`advanced usage <advanced_usage>` documentation for more.
9994

10095

10196
Conditonal ``cache_to`` file names
@@ -109,9 +104,7 @@ There is a way to achieve custom file names by overriding your spec's
109104
``cachefile_name``, but it is not recommended, as the spec's default
110105
behavior is to hash the combination of ``source``, ``processors``, ``format``,
111106
and other spec options to ensure that changes to the spec always result in
112-
unique file names. See the documentation on `specs`_ for more.
113-
114-
.. _`specs`:
107+
unique file names. See the documentation on :ref:`specs` for more.
115108

116109

117110
Processors have moved to PILKit

0 commit comments

Comments
 (0)