Skip to content

Commit c9db965

Browse files
committed
Include compiled messages in dist packages (#208)
1 parent 26577af commit c9db965

19 files changed

+148
-178
lines changed

.editorconfig

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,11 @@ charset = utf-8
77
end_of_line = lf
88
insert_final_newline = true
99
trim_trailing_whitespace = true
10+
max_line_length = 88
1011

1112
[*.py]
1213
indent_style = space
1314
indent_size = 4
14-
# isort config
15-
atomic = true
16-
multi_line_output = 5
17-
line_length = 79
18-
combine_as_imports = true
19-
skip = wsgi.py,docs,.tox,env
20-
known_first_party = stdimage,tests
21-
known_third_party = django
22-
2315

2416
[*.{rst,ini}]
2517
indent_style = space
@@ -29,14 +21,6 @@ indent_size = 4
2921
indent_style = space
3022
indent_size = 2
3123

32-
[*.{css,less}]
33-
indent_style = space
34-
indent_size = 2
35-
36-
[*.{js,coffee}]
37-
indent_style = space
38-
indent_size = 4
39-
4024
[Makefile]
4125
indent_style = tab
4226
indent_size = 1

.fussyfox.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- bandit
2+
- flake8
3+
- isort
4+
- pydocstyle

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ build/
55
dist/
66
.idea/
77
.tox/
8+
coverage.xml
89

910

1011
.cache/
1112
.coverage
1213
htmlcov/
14+
15+
.eggs/

.pre-commit-config.yaml

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

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
language: python
2-
sudo: false
2+
dist: xenial
33
cache: pip
44
python:
55
- '3.6'
6+
- '3.7'
67
env:
78
matrix:
8-
- TOXENV=qa
99
- DJANGO=111
10+
- DJANGO=22
1011
- DJANGO=master
1112
matrix:
1213
fast_finish: true
@@ -31,5 +32,5 @@ deploy:
3132
secure: dnmVaqnmG6mSrmI9q6nL2l0aGkX56+WAsqdT/J1O2hBpFBOE4NiqH+2ryIqZj1wrvHZ72/jjyT5Xi1MWYxwDtDfkBIp+juHUGPbFfGy3J7EVgGkmf38E5SC2Q9IHc3A1iHxTZAX3o816TP3bt5vwGll3UzSMiaaPRQ/AiK4+og4=
3233
on:
3334
tags: true
34-
distributions: sdist bdist_wheel
35+
distributions: compile_translations sdist bdist_wheel
3536
repo: codingjoe/django-stdimage

CONTRIBUTING.md

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

MANIFEST.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include stdimage/locale/*/LC_MESSAGES/django.po
2+
include stdimage/locale/*/LC_MESSAGES/django.mo
3+
prune tests
4+
prune .github
5+
exclude .*

README.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
[![Django-CC](https://img.shields.io/badge/Django-CC-ee66dd.svg)](https://github.com/codingjoe/django-cc)
21
[![version](https://img.shields.io/pypi/v/django-stdimage.svg)](https://pypi.python.org/pypi/django-stdimage/)
32
[![ci](https://api.travis-ci.org/codingjoe/django-stdimage.svg?branch=master)](https://travis-ci.org/codingjoe/django-stdimage)
43
[![codecov](https://codecov.io/gh/codingjoe/django-stdimage/branch/master/graph/badge.svg)](https://codecov.io/gh/codingjoe/django-stdimage)
5-
[![code-health](https://landscape.io/github/codingjoe/django-stdimage/master/landscape.svg?style=flat)](https://landscape.io/github/codingjoe/django-stdimage/master)
64
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
75

86
# Django Standardized Image Field
@@ -22,7 +20,11 @@ Django Field that implement the following features:
2220

2321
Simply install the latest stable package using the command
2422

25-
`pip install django-stdimage`
23+
```bash
24+
pip install django-stdimage
25+
# or
26+
pipenv install django-stdimage
27+
```
2628

2729
and add `'stdimage'` to `INSTALLED_APP`s in your settings.py, that's it!
2830

@@ -38,6 +40,7 @@ Variations are specified within a dictionary. The key will be the attribute refe
3840
A variation can be defined both as a tuple or a dictionary.
3941

4042
Example:
43+
4144
```python
4245
from django.db import models
4346
from stdimage.models import StdImageField
@@ -70,6 +73,7 @@ class MyModel(models.Model):
7073
For using generated variations in templates use `myimagefield.variation_name`.
7174

7275
Example:
76+
7377
```html
7478
<a href="{{ object.myimage.url }}"><img alt="" src="{{ object.myimage.thumbnail.url }}"/></a>
7579
```
@@ -86,7 +90,8 @@ The `StdImageField` doesn't implement any size validation. Validation can be spe
8690
and using a set of validators shipped with this package.
8791
Validators can be used for both Forms and Models.
8892

89-
Example
93+
Example
94+
9095
```python
9196
from django.db import models
9297
from stdimage.validators import MinSizeValidator, MaxSizeValidator
@@ -123,7 +128,6 @@ pre_save.connect(pre_save_delete_callback, sender=models.MyModel)
123128

124129
**Warning:** You should not use the signal callbacks in production. They may result in data loss.
125130

126-
127131
### Async image processing
128132
Tools like celery allow to execute time-consuming tasks outside of the request. If you don't want
129133
to wait for your variations to be rendered in request, StdImage provides your the option to pass a
@@ -133,11 +137,7 @@ This example is based on celery.
133137

134138
`tasks.py`:
135139
```python
136-
try:
137-
from django.apps import apps
138-
get_model = apps.get_model
139-
except ImportError:
140-
from django.apps import apps
140+
from django.apps import apps
141141

142142
from celery import shared_task
143143

@@ -157,7 +157,7 @@ def process_photo_image(file_name, variations, storage):
157157
from django.db import models
158158
from stdimage.models import StdImageField
159159

160-
from tasks import process_photo_image
160+
from .tasks import process_photo_image
161161

162162
def image_processor(file_name, variations, storage):
163163
process_photo_image.delay(file_name, variations, storage)
@@ -191,7 +191,3 @@ and therefore the huge memory footprint from previous versions.
191191

192192
**Note:** PyPy seems to have some problems regarding multiprocessing,
193193
for that matter all multiprocessing is disabled in PyPy.
194-
195-
## [Contributing](CONTRIBUTING.md)
196-
197-
## [License](LICENSE)

_config.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

requirements-dev.txt

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

0 commit comments

Comments
 (0)