Skip to content

Commit

Permalink
Add support for Django 4.1
Browse files Browse the repository at this point in the history
Enable testing for Python 3.9, 3.10, 3.10
Drop testing for Django < 2.2
  • Loading branch information
andreyfedoseev committed Nov 13, 2022
1 parent d15a3c3 commit 5870a05
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 30 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog
*********

Dev
===

- Add support for Django 4.1

2.1
===

Expand Down
14 changes: 12 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
FROM andreyfedoseev/django-static-precompiler:18.04
RUN apt-get update && \
apt-get install -y \
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
RUN apt update && \
apt install software-properties-common -y && \
add-apt-repository ppa:deadsnakes/ppa -y && \
apt install -y \
python3.6-dev \
python3.8-dev \
python3.9-dev \
python3.9-distutils \
python3.10-dev \
python3.10-distutils \
python3.11-dev \
python3.11-distutils \
python3-pip \
sqlite3
RUN mkdir /app
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
all:
docker-compose build
docker compose build

shell:
docker-compose run --rm app /bin/bash
docker compose run --rm app /bin/bash

test:
docker-compose run --rm app tox
docker compose run --rm app tox

upload:
python setup.py sdist upload

check-flake8:
docker-compose run --rm app flake8
docker compose run --rm app flake8

check-black:
docker-compose run --rm app black --check ./static_precompiler
docker compose run --rm app black --check ./static_precompiler

apply-black:
docker-compose run --rm app black ./static_precompiler
docker compose run --rm app black ./static_precompiler

check-isort:
docker-compose run --rm app isort --check ./static_precompiler
docker compose run --rm app isort --check ./static_precompiler

apply-isort:
docker-compose run --rm app isort ./static_precompiler
docker compose run --rm app isort ./static_precompiler
6 changes: 3 additions & 3 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pytest<4
pytest-django==3.1.2
pytest==6.2.5
pytest-django==4.5.2
pretend
watchdog
libsass
coverage
pytest-cov==2.5.1
pytest-cov==4.0.0
tox
10 changes: 3 additions & 7 deletions static_precompiler/management/commands/compilestatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Command(django.core.management.base.BaseCommand):

help = "Compile static files."

requires_system_checks = False
requires_system_checks = []

def add_arguments(self, parser):
for argument, parameters in ARGUMENTS:
Expand Down Expand Up @@ -129,9 +129,5 @@ def handle(self, **options):
watch_dirs(scanned_dirs, verbosity)


if django.VERSION < (1, 8):
import optparse

Command.option_list = django.core.management.base.NoArgsCommand.option_list + tuple(
optparse.make_option(argument, **argument_parameters) for argument, argument_parameters in ARGUMENTS
)
if django.VERSION < (3, 2):
Command.requires_system_checks = False
16 changes: 6 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
[tox]
envlist =
py36-django20,
py36-django21,
py36-django22,
py36-django30,
py36-django31,
py38-django40

py38-django32,
py39-django40
py310-django41
py311-django41
[testenv]
passenv = GEM_PATH
deps =
-rrequirements-test.txt
django20: Django>=2.0,<2.1
django21: Django>=2.1,<2.2
django22: Django>=2.2,<3.0
django30: Django>=3.0,<3.1
django31: Django>=3.1,<4
django32: Django>=3.2,<4
django40: Django>=4.0,<4.1
django41: Django>=4.1,<4.2
commands = py.test static_precompiler --cov static_precompiler --cov-report xml --cov-append
setenv =
PYTHONPATH = {toxinidir}

0 comments on commit 5870a05

Please sign in to comment.