diff --git a/.circleci/config.yml b/.circleci/config.yml index ad82581d..0543f88a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,62 +1,32 @@ -version: 2 +version: 2.1 + workflows: - version: 2 - test: + tests: jobs: - - test-3.8-22 - - test-3.8-30 - - test-3.8-31 - - test-3.8-32 - - test-3.8-40 - - test-3.8-41 - - test-3.8-42 - - - test-3.9-22 - - test-3.9-30 - - test-3.9-31 - - test-3.9-32 - - test-3.9-40 - - test-3.9-41 - - test-3.9-42 - - - test-3.10-32 - - test-3.10-40 - - test-3.10-41 - - test-3.10-42 - - - test-3.11-32 - - test-3.11-40 - - - done: + - base-test: + matrix: + parameters: + python-version: ["3.8", "3.9", "3.10", "3.11"] + django-version: ["3.2", "4.0", "4.1", "4.2"] + exclude: + - python-version: "3.11" + django-version: "3.2" + - python-version: "3.11" + django-version: "4.0" + + - coverall: requires: - - test-3.8-22 - - test-3.8-30 - - test-3.8-31 - - test-3.8-32 - - test-3.8-40 - - test-3.8-41 - - test-3.8-42 - - - test-3.9-22 - - test-3.9-30 - - test-3.9-31 - - test-3.9-32 - - test-3.9-40 - - test-3.9-41 - - test-3.9-42 - - - test-3.10-32 - - test-3.10-40 - - test-3.10-41 - - test-3.10-42 - - - test-3.11-32 - - test-3.11-40 + - base-test jobs: - base: &test-template - docker: - - image: circleci/python:3.4-stretch-node + base-test: + parameters: + python-version: + type: string + django-version: + type: string + docker: + - image: cimg/python:<>-node working_directory: ~/repo steps: - checkout @@ -86,7 +56,7 @@ jobs: source venv/bin/activate rm -f requirements.txt pip install -r tests/requirements/common.txt - pip install -r tests/requirements/django${DJANGO_VERSION}.txt + pip install django~=<>.0 - save_cache: paths: - ./cache/pip @@ -105,183 +75,9 @@ jobs: environment: COVERALLS_PARALLEL: 1 - test-3.6-22: - <<: *test-template - docker: - - image: circleci/python:3.6-stretch-node - environment: - DJANGO_VERSION: "22" - test-3.6-30: - <<: *test-template - docker: - - image: circleci/python:3.6-stretch-node - environment: - DJANGO_VERSION: "30" - test-3.6-31: - <<: *test-template - docker: - - image: circleci/python:3.6-stretch-node - environment: - DJANGO_VERSION: "31" - test-3.6-32: - <<: *test-template - docker: - - image: circleci/python:3.6-stretch-node - environment: - DJANGO_VERSION: "32" - - test-3.7-22: - <<: *test-template - docker: - - image: circleci/python:3.7-stretch-node - environment: - DJANGO_VERSION: "22" - test-3.7-30: - <<: *test-template - docker: - - image: circleci/python:3.7-stretch-node - environment: - DJANGO_VERSION: "30" - test-3.7-31: - <<: *test-template - docker: - - image: circleci/python:3.7-stretch-node - environment: - DJANGO_VERSION: "31" - test-3.7-32: - <<: *test-template - docker: - - image: circleci/python:3.7-stretch-node - environment: - DJANGO_VERSION: "32" - - test-3.8-22: - <<: *test-template - docker: - - image: circleci/python:3.8-buster-node - environment: - DJANGO_VERSION: "22" - test-3.8-30: - <<: *test-template - docker: - - image: circleci/python:3.8-buster-node - environment: - DJANGO_VERSION: "30" - test-3.8-31: - <<: *test-template - docker: - - image: circleci/python:3.8-buster-node - environment: - DJANGO_VERSION: "31" - test-3.8-32: - <<: *test-template - docker: - - image: circleci/python:3.8-buster-node - environment: - DJANGO_VERSION: "32" - test-3.8-40: - <<: *test-template - docker: - - image: circleci/python:3.8-buster-node - environment: - DJANGO_VERSION: "40" - test-3.8-41: - <<: *test-template - docker: - - image: circleci/python:3.8-buster-node - environment: - DJANGO_VERSION: "41" - test-3.8-42: - <<: *test-template - docker: - - image: circleci/python:3.8-buster-node - environment: - DJANGO_VERSION: "42" - - test-3.9-22: - <<: *test-template - docker: - - image: circleci/python:3.9-buster-node - environment: - DJANGO_VERSION: "22" - test-3.9-30: - <<: *test-template - docker: - - image: circleci/python:3.9-buster-node - environment: - DJANGO_VERSION: "30" - test-3.9-31: - <<: *test-template - docker: - - image: circleci/python:3.9-buster-node - environment: - DJANGO_VERSION: "31" - test-3.9-32: - <<: *test-template - docker: - - image: circleci/python:3.9-buster-node - environment: - DJANGO_VERSION: "32" - test-3.9-40: - <<: *test-template - docker: - - image: circleci/python:3.9-buster-node - environment: - DJANGO_VERSION: "40" - test-3.9-41: - <<: *test-template - docker: - - image: circleci/python:3.9-buster-node - environment: - DJANGO_VERSION: "41" - test-3.9-42: - <<: *test-template - docker: - - image: circleci/python:3.9-buster-node - environment: - DJANGO_VERSION: "42" - - test-3.10-32: - <<: *test-template - docker: - - image: circleci/python:3.10-buster-node - environment: - DJANGO_VERSION: "32" - test-3.10-40: - <<: *test-template - docker: - - image: circleci/python:3.10-buster-node - environment: - DJANGO_VERSION: "40" - test-3.10-41: - <<: *test-template - docker: - - image: circleci/python:3.10-buster-node - environment: - DJANGO_VERSION: "41" - test-3.10-42: - <<: *test-template - docker: - - image: circleci/python:3.10-buster-node - environment: - DJANGO_VERSION: "42" - - test-3.11-32: - <<: *test-template - docker: - - image: circleci/python:3.11-rc-node - environment: - DJANGO_VERSION: "32" - test-3.11-40: - <<: *test-template - docker: - - image: circleci/python:3.11-rc-node - environment: - DJANGO_VERSION: "40" - - done: + coverall: docker: - - image: circleci/python:3.9-buster-node + - image: cimg/python:3.11-node steps: - run: name: Finish Coveralls diff --git a/README.md b/README.md index 86ac956f..82047fe8 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ A [changelog](CHANGELOG.md) is also available. ## Compatibility -Test cases cover Django>=2.0 on Python>=3.5. 100% code coverage is the target so we can be sure everything works anytime. It should probably work on older version of django as well but the package does not ship any test cases for them. +Test cases cover Django>=3.2 on Python>=3.8. 100% code coverage is the target so we can be sure everything works anytime. It should probably work on older version of django as well but the package does not ship any test cases for them. ## Install diff --git a/setup.py b/setup.py index d7d78857..a75f66ee 100644 --- a/setup.py +++ b/setup.py @@ -31,17 +31,11 @@ def rel(*parts): keywords = ['django', 'webpack', 'assets'], # arbitrary keywords classifiers = [ 'Programming Language :: Python', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', 'Framework :: Django', - 'Framework :: Django :: 2.0', - 'Framework :: Django :: 2.1', - 'Framework :: Django :: 2.2', - 'Framework :: Django :: 3.0', - 'Framework :: Django :: 3.1', 'Framework :: Django :: 3.2', 'Framework :: Django :: 4.0', 'Framework :: Django :: 4.1', diff --git a/tests/app/tests/test_custom_loaders.py b/tests/app/tests/test_custom_loaders.py index 7d8d3995..527042f0 100644 --- a/tests/app/tests/test_custom_loaders.py +++ b/tests/app/tests/test_custom_loaders.py @@ -1,4 +1,4 @@ -from imp import reload +from importlib import reload from django.test import TestCase from webpack_loader import utils, config, loader diff --git a/tests/requirements/django20.txt b/tests/requirements/django20.txt deleted file mode 100644 index f710a10c..00000000 --- a/tests/requirements/django20.txt +++ /dev/null @@ -1 +0,0 @@ -django>=2.0,<2.1 diff --git a/tests/requirements/django21.txt b/tests/requirements/django21.txt deleted file mode 100644 index 0e41d837..00000000 --- a/tests/requirements/django21.txt +++ /dev/null @@ -1 +0,0 @@ -django>=2.1,<2.2 diff --git a/tests/requirements/django22.txt b/tests/requirements/django22.txt deleted file mode 100644 index 6911c30e..00000000 --- a/tests/requirements/django22.txt +++ /dev/null @@ -1 +0,0 @@ -django>=2.2,<3 diff --git a/tests/requirements/django30.txt b/tests/requirements/django30.txt deleted file mode 100644 index 90a374e7..00000000 --- a/tests/requirements/django30.txt +++ /dev/null @@ -1 +0,0 @@ -django>=3.0,<3.1 diff --git a/tests/requirements/django31.txt b/tests/requirements/django31.txt deleted file mode 100644 index 2945a9b7..00000000 --- a/tests/requirements/django31.txt +++ /dev/null @@ -1 +0,0 @@ -django>=3.1,<3.2 diff --git a/tests/requirements/django32.txt b/tests/requirements/django32.txt deleted file mode 100644 index 14a9df14..00000000 --- a/tests/requirements/django32.txt +++ /dev/null @@ -1 +0,0 @@ -django>=3.2,<4.0 diff --git a/tests/requirements/django40.txt b/tests/requirements/django40.txt deleted file mode 100644 index bed17ced..00000000 --- a/tests/requirements/django40.txt +++ /dev/null @@ -1 +0,0 @@ -django>=4.0,<4.1 diff --git a/tests/requirements/django41.txt b/tests/requirements/django41.txt deleted file mode 100644 index 4041b77b..00000000 --- a/tests/requirements/django41.txt +++ /dev/null @@ -1 +0,0 @@ -django>=4.1,<4.2 diff --git a/tests/requirements/django42.txt b/tests/requirements/django42.txt deleted file mode 100644 index 00938415..00000000 --- a/tests/requirements/django42.txt +++ /dev/null @@ -1 +0,0 @@ -django>=4.2,<5.0 diff --git a/tests/tox.ini b/tests/tox.ini index ee9852e1..bf0ea569 100644 --- a/tests/tox.ini +++ b/tests/tox.ini @@ -1,22 +1,27 @@ [tox] -minversion = 1.6 +minversion = 4.11.1 skipsdist = True envlist = - py{36,37,38,39}-django{22,30,31,32} + py{38,39,310}-django{32,40,41,42} + py311-django{41,42} + py312-django42 + py{310,311,312}-djangomain [testenv] basepython = - py36: python3.6 - py37: python3.7 py38: python3.8 py39: python3.9 + py310: python3.10 + py311: python3.11 + py312: python3.12 deps = coverage unittest2six django-jinja>=2.7.0 - django22: django>=2.2,<3 - django30: django>=3.0,<3.1 - django31: django>=3.1,<3.2 django32: django>=3.2,<3.3 + django40: django>=4.0,<4.1 + django41: django>=4.1,<4.2 + django42: django>=4.2,<4.3 + djangomain: https://github.com/django/django/archive/main.zip commands = coverage run --source=webpack_loader manage.py test {posargs} diff --git a/tests/webpack.config.error.js b/tests/webpack.config.error.js index de6e4ea5..42a11cab 100644 --- a/tests/webpack.config.error.js +++ b/tests/webpack.config.error.js @@ -3,6 +3,11 @@ var webpack = require('webpack'); var BundleTracker = require('webpack-bundle-tracker'); var MiniCssExtractPlugin = require('mini-css-extract-plugin'); +// https://github.com/cockpit-project/starter-kit/commit/3220617fec508aabbbc226a87a165c21fb72e913 +// webpack 4 requires monkey-patch in node v18 +const crypto = require("crypto"); +const crypto_orig_createHash = crypto.createHash; +crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm); module.exports = { context: __dirname, diff --git a/tests/webpack.config.gzipTest.js b/tests/webpack.config.gzipTest.js index 52c0356d..9644a7b7 100644 --- a/tests/webpack.config.gzipTest.js +++ b/tests/webpack.config.gzipTest.js @@ -4,6 +4,11 @@ var BundleTracker = require('webpack-bundle-tracker'); var MiniCssExtractPlugin = require('mini-css-extract-plugin'); var CompressionPlugin = require('compression-webpack-plugin'); +// https://github.com/cockpit-project/starter-kit/commit/3220617fec508aabbbc226a87a165c21fb72e913 +// webpack 4 requires monkey-patch in node v18 +const crypto = require("crypto"); +const crypto_orig_createHash = crypto.createHash; +crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm); module.exports = { context: __dirname, diff --git a/tests/webpack.config.integrity.js b/tests/webpack.config.integrity.js index 1b9c2f41..b98d6a36 100644 --- a/tests/webpack.config.integrity.js +++ b/tests/webpack.config.integrity.js @@ -3,6 +3,11 @@ var webpack = require('webpack'); var BundleTracker = require('webpack-bundle-tracker'); var MiniCssExtractPlugin = require('mini-css-extract-plugin'); +// https://github.com/cockpit-project/starter-kit/commit/3220617fec508aabbbc226a87a165c21fb72e913 +// webpack 4 requires monkey-patch in node v18 +const crypto = require("crypto"); +const crypto_orig_createHash = crypto.createHash; +crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm); module.exports = { context: __dirname, diff --git a/tests/webpack.config.simple.js b/tests/webpack.config.simple.js index d9441a14..8fc9082c 100644 --- a/tests/webpack.config.simple.js +++ b/tests/webpack.config.simple.js @@ -3,6 +3,12 @@ var webpack = require('webpack'); var BundleTracker = require('webpack-bundle-tracker'); var MiniCssExtractPlugin = require('mini-css-extract-plugin'); +// https://github.com/cockpit-project/starter-kit/commit/3220617fec508aabbbc226a87a165c21fb72e913 +// webpack 4 requires monkey-patch in node v18 +const crypto = require("crypto"); +const crypto_orig_createHash = crypto.createHash; +crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm); + module.exports = { context: __dirname, diff --git a/tests/webpack.config.skipCommon.js b/tests/webpack.config.skipCommon.js index c1f3cb2d..52838454 100644 --- a/tests/webpack.config.skipCommon.js +++ b/tests/webpack.config.skipCommon.js @@ -3,6 +3,11 @@ var webpack = require('webpack'); var BundleTracker = require('webpack-bundle-tracker'); var MiniCssExtractPlugin = require('mini-css-extract-plugin'); +// https://github.com/cockpit-project/starter-kit/commit/3220617fec508aabbbc226a87a165c21fb72e913 +// webpack 4 requires monkey-patch in node v18 +const crypto = require("crypto"); +const crypto_orig_createHash = crypto.createHash; +crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm); module.exports = { context: __dirname, diff --git a/tests/webpack.config.sourcemaps.js b/tests/webpack.config.sourcemaps.js index 20693049..ee934020 100644 --- a/tests/webpack.config.sourcemaps.js +++ b/tests/webpack.config.sourcemaps.js @@ -3,6 +3,11 @@ var webpack = require('webpack'); var BundleTracker = require('webpack-bundle-tracker'); var MiniCssExtractPlugin = require('mini-css-extract-plugin'); +// https://github.com/cockpit-project/starter-kit/commit/3220617fec508aabbbc226a87a165c21fb72e913 +// webpack 4 requires monkey-patch in node v18 +const crypto = require("crypto"); +const crypto_orig_createHash = crypto.createHash; +crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm); module.exports = { context: __dirname, diff --git a/tests/webpack.config.split.js b/tests/webpack.config.split.js index 002a7c9d..486f76e6 100644 --- a/tests/webpack.config.split.js +++ b/tests/webpack.config.split.js @@ -3,6 +3,12 @@ var webpack = require('webpack'); var BundleTracker = require('webpack-bundle-tracker'); var MiniCssExtractPlugin = require('mini-css-extract-plugin'); +// https://github.com/cockpit-project/starter-kit/commit/3220617fec508aabbbc226a87a165c21fb72e913 +// webpack 4 requires monkey-patch in node v18 +const crypto = require("crypto"); +const crypto_orig_createHash = crypto.createHash; +crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm); + module.exports = { context: __dirname,