From cbaa7938189939f41cb39a3c8d12e47f53d9db3c Mon Sep 17 00:00:00 2001 From: wongcht Date: Mon, 4 Sep 2023 20:58:18 +0100 Subject: [PATCH 1/9] simplify circleci config with version upgrade --- .circleci/config.yml | 255 +++++-------------------------------------- 1 file changed, 25 insertions(+), 230 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ad82581d..492e533d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,62 +1,30 @@ -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, 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 +54,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 -r django~=<>.0 - save_cache: paths: - ./cache/pip @@ -105,183 +73,10 @@ 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 From e3e2645d4ddf1c0ae33da87b5ce45fe74ff2c136 Mon Sep 17 00:00:00 2001 From: wongcht Date: Mon, 4 Sep 2023 21:07:50 +0100 Subject: [PATCH 2/9] correct parameters type --- .circleci/config.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 492e533d..a215e2e7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,11 +6,11 @@ workflows: - base-test: matrix: parameters: - python-version: [3.8, 3.9, 3.10, 3.11] - django-version: [3.2, 4.0, 4.1, 4.2] + 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, 4.0] + - python-version: "3.11" + django-version: ["3.2", "4.0"] - coverall: requires: @@ -73,7 +73,6 @@ jobs: environment: COVERALLS_PARALLEL: 1 - coverall: docker: - image: cimg/python:3.11-node From cb712060f052befcb9a88414097917d1409a09a8 Mon Sep 17 00:00:00 2001 From: wongcht Date: Mon, 4 Sep 2023 21:10:49 +0100 Subject: [PATCH 3/9] fix pip install --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a215e2e7..40783cc2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,7 +54,7 @@ jobs: source venv/bin/activate rm -f requirements.txt pip install -r tests/requirements/common.txt - pip install -r django~=<>.0 + pip install django~=<>.0 - save_cache: paths: - ./cache/pip From ae3f8193fd204593a289b2ee7637018df31f3c26 Mon Sep 17 00:00:00 2001 From: wongcht Date: Mon, 4 Sep 2023 21:14:03 +0100 Subject: [PATCH 4/9] fix version exclusion --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 40783cc2..0543f88a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,9 @@ workflows: django-version: ["3.2", "4.0", "4.1", "4.2"] exclude: - python-version: "3.11" - django-version: ["3.2", "4.0"] + django-version: "3.2" + - python-version: "3.11" + django-version: "4.0" - coverall: requires: From 6cbc1ca0cabe2b8480211dc64b8ccc5e6311fecf Mon Sep 17 00:00:00 2001 From: wongcht Date: Mon, 4 Sep 2023 22:20:38 +0100 Subject: [PATCH 5/9] fix webpack 4 in node v18 --- tests/webpack.config.error.js | 5 +++++ tests/webpack.config.gzipTest.js | 5 +++++ tests/webpack.config.integrity.js | 5 +++++ tests/webpack.config.simple.js | 6 ++++++ tests/webpack.config.skipCommon.js | 5 +++++ tests/webpack.config.sourcemaps.js | 5 +++++ tests/webpack.config.split.js | 6 ++++++ 7 files changed, 37 insertions(+) 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, From 7c756166118e690e36f4466dff3f558449bbe810 Mon Sep 17 00:00:00 2001 From: wongcht Date: Mon, 4 Sep 2023 22:31:59 +0100 Subject: [PATCH 6/9] remove test requirements.txt for django versions --- tests/requirements/django20.txt | 1 - tests/requirements/django21.txt | 1 - tests/requirements/django22.txt | 1 - tests/requirements/django30.txt | 1 - tests/requirements/django31.txt | 1 - tests/requirements/django32.txt | 1 - tests/requirements/django40.txt | 1 - tests/requirements/django41.txt | 1 - tests/requirements/django42.txt | 1 - 9 files changed, 9 deletions(-) delete mode 100644 tests/requirements/django20.txt delete mode 100644 tests/requirements/django21.txt delete mode 100644 tests/requirements/django22.txt delete mode 100644 tests/requirements/django30.txt delete mode 100644 tests/requirements/django31.txt delete mode 100644 tests/requirements/django32.txt delete mode 100644 tests/requirements/django40.txt delete mode 100644 tests/requirements/django41.txt delete mode 100644 tests/requirements/django42.txt 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 From 75884a5d55102054d3e88aed276f9ed681ec3309 Mon Sep 17 00:00:00 2001 From: wongcht Date: Mon, 4 Sep 2023 22:51:55 +0100 Subject: [PATCH 7/9] tox test current supported versions only --- tests/tox.ini | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/tox.ini b/tests/tox.ini index ee9852e1..84f86cb5 100644 --- a/tests/tox.ini +++ b/tests/tox.ini @@ -1,22 +1,23 @@ [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} [testenv] basepython = - py36: python3.6 - py37: python3.7 py38: python3.8 py39: python3.9 + py310: python3.10 + py311: python3.11 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 commands = coverage run --source=webpack_loader manage.py test {posargs} From f661a05bf6fe83e9fb0e2a6e9e482e139d03e410 Mon Sep 17 00:00:00 2001 From: wongcht Date: Mon, 4 Sep 2023 22:53:25 +0100 Subject: [PATCH 8/9] tox test future py312 dj50 --- tests/app/tests/test_custom_loaders.py | 2 +- tests/tox.ini | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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/tox.ini b/tests/tox.ini index 84f86cb5..bf0ea569 100644 --- a/tests/tox.ini +++ b/tests/tox.ini @@ -4,6 +4,8 @@ skipsdist = True envlist = py{38,39,310}-django{32,40,41,42} py311-django{41,42} + py312-django42 + py{310,311,312}-djangomain [testenv] basepython = @@ -11,6 +13,7 @@ basepython = py39: python3.9 py310: python3.10 py311: python3.11 + py312: python3.12 deps = coverage unittest2six @@ -19,5 +22,6 @@ deps = 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} From 09b78b08746899442f0e89bc3924fdae4a0a3789 Mon Sep 17 00:00:00 2001 From: wongcht Date: Mon, 4 Sep 2023 23:00:45 +0100 Subject: [PATCH 9/9] update displayed supported version --- README.md | 2 +- setup.py | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) 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',