Django-compressor: Publish a new release of django_compressor

Created on 1 Dec 2019  ·  16Comments  ·  Source: django-compressor/django-compressor

With the current latest django-compressor 2.3, I get an import error

File ".../python3.8/site-packages/compressor/templatetags/compress.py", line 3, in <module>
from django.utils import six
ImportError: cannot import name 'six' from 'django.utils' (.../python3.8/site-packages/django/utils/__init__.py)

It looks like that was fixed in https://github.com/django-compressor/django-compressor/commit/dabe46e092d3bfba139d6a1e018980f249d9d95c#diff-ac8de32c7b59ab69b2ac7137529224f0, but there aren't any releases after that commit. With django.utils.six removed in Django 3.0, it looks like django-compressor won't be compatible with Django 3.0 until a new release is cut for django-compressor.

See also #940.

Running some sanity checks on two django apps that I own, I don't see any problems with the current version of django_compressor.

(For anyone else seeing this issue, you can add -e git://github.com/django-compressor/django-compressor.git@a5bfd775450428e1a261b88e1e5424bfb4dde081#egg=django_compressor into your requirements.txt file to install compressor's current master commit from directly from github)

Most helpful comment

https://pypi.org/project/django-compressor/2.4/ has been released. Hopefully it works, and huge thanks for all your efforts, @albertyw !

All 16 comments

Thank you very very much.

(For anyone else seeing this issue, you can add -e git://github.com/django-compressor/django-compressor.git@a5bfd775450428e1a261b88e1e5424bfb4dde081#egg=django_compressor into your requirements.txt file to install compressor's current master commit from directly from github)

I tried

$ pip install -e git://github.com/django-compressor/django-compressor.git@a5bfd775450428e1a261b88e1e5424bfb4dde081#egg=django_compressor

and good result.

$ ./manage.py test monitor
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
........
...
.
----------------------------------------------------------------------
Ran 10 tests in 5.034s

OK
Destroying test database for alias 'default'...

I'll try to find the time to do a release soon. If you want to help, testing of the develop branch in real environments is always appreciated.

I'm running the develop branch (@a5bfd77545) with Django 3.0 in production with the following configuration, no issue :)

COMPRESS_ENABLED = True
COMPRESS_OFFLINE = True
COMPRESS_MTIME_DELAY = 0
COMPRESS_CSS_FILTERS = [
    'compressor.filters.css_default.CssAbsoluteFilter',
    'compressor.filters.cssmin.CSSCompressorFilter'
]
COMPRESS_CSS_HASHING_METHOD = None
COMPRESS_JS_FILTERS = [
    'compressor.filters.jsmin.JSMinFilter',
]

This is on heroku with gunicorn as a server, uvicorn as an asgi worker, channels as the router and whitenoise for serving static files.

Running locally (same setup except heroku) with online compression also works fine.

I install next packages via pip.
But failed install django_compressor, because installed six 1.13.0.
Please change install_requires.

    install_requires=[
        .....
        'six == 1.12.0',
    ],
  • Django
  • djangorestframework
  • markdown
  • django-filter
  • drf-yasg
  • django-bootstrap4
  • django_compressor
  • django-libsass

I've just tested current develop branch of django_compressor with Weblate and all tests pass. Do you have plans for the release?

There is a PR to create a new release in #964 , which is waiting on #967

django-compressor's setup.py has this requirement:

'django-appconf >= 1.0'

django-appconf 1.0.3 works fine. And if I install django-compressor in an empty virtualenv, this is the version that gets installed.

django-appconf 1.0.2 does not work with Django 3: it tries to import django.utils.six. When I upgrade django-compressor, and already have django-appconf==1.0.2 installed, the 1.0.2 satisifies the ">= 1.0" requirement. So in the end I have a broken install.

I think the django-appconf requirement in setup.py should be tightened up.

I created #978 based on the comment above. #964 can be merged after #978

https://pypi.org/project/django-compressor/2.4/ has been released. Hopefully it works, and huge thanks for all your efforts, @albertyw !

@diox could you add 2.4 git tag?

Done.

Awesome, thanks for making the release!

The new release doesn't show up on https://django-compressor.readthedocs.io yet – would be nice to update it as well.

mmm I think it's because I forgot to tag at first, so it hasn't detected 2.4 yet. Not sure what can be done about that - maybe it will fix itself once we commit more stuff.

I rebuilt the stable version in readthedocs, which led to a new 2.4 build, but stable was still at 2.3. that looked a bit like https://github.com/readthedocs/readthedocs.org/pull/3913, and wiping the environment helped, so i think all is well now. thanks for the report @cuu508!

@intgr reported that the latest version was also not rebuilt. i checked and it seems the problem was something else entirely, our repo still had the old github integrations in place, which have been replaced by webhooks a year ago. the latest readthedocs page was indeed not automatically updated since then. i added a webhook, so this should work automatically in the future again. thanks @intgr!

and it does indeed work, i just pushed https://github.com/django-compressor/django-compressor/commit/bfd440feef72ec5a2ec68ed632c26c154cc9b92e and the docs were rebuilt.

Was this page helpful?
0 / 5 - 0 ratings