Repository: tutorcruncher/django-jinja-bootstrap-form (language: python)

Issue:
Python 3.8 v.s. 3.5
The README says "Python >=3.5", but the setup.py says 3.8 only. Which is the supported version range?


Discussion / hints:

Fix patch:
diff --git a/Makefile b/Makefile
index b442f44..6ab19b2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-black = black -S -l 120 --target-version py38
+black = black -S -l 120
 
 .PHONY: install
 install:
diff --git a/README.md b/README.md
index ba1f322..93e594b 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@ Twitter Bootstrap for Django Forms.
 
 **django-jinja-bootstrap-form** has been used in production for 6 months and is stable.
 
-Supports Django >=3.2. Python >=3.5.
+Supports Django >=3.2. Python >=3.6.
 
 See [django-bootstrap-form](https://github.com/tzangms/django-bootstrap-form) for documentation. Usage should
 be the same except:
diff --git a/setup.py b/setup.py
index 63286c8..a162976 100644
--- a/setup.py
+++ b/setup.py
@@ -49,6 +49,6 @@
     ],
     packages=find_packages(),
     package_data={'bootstrapform_jinja': template_files},
-    python_requires='>=3.8',
+    python_requires='>=3.6',
     zip_safe=True,
 )


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 0bdb637..6607a47 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -6,18 +6,22 @@ on:
 jobs:
   test:
     runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [ '3.6', '3.7', '3.8', '3.9' ]    
     steps:
       - uses: actions/checkout@v2
 
-      - name: Set up Python
+      - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v2
         with:
-          python-version: 3.8
+          python-version: ${{ matrix.python-version }}
 
       - name: Install Dependencies
         run: make install
 
       - name: Lint
+        if: matrix.python-version == '3.9'
         run: make lint
 
       - name: Tests
diff --git a/testing/fixtures_30/basic.html b/testing/fixtures_30/basic.html
new file mode 100644
index 0000000..8f59ee9
--- /dev/null
+++ b/testing/fixtures_30/basic.html
@@ -0,0 +1,110 @@
+  <div class="form-group">
+        <label class="control-label  required" for="id_char_field">Char field</label>
+
+  <div class="">
+    <input type="text" name="char_field" class=" form-control" required id="id_char_field">
+  </div>
+</div>
+  <div class="form-group">
+        <label class="control-label  required" for="id_choice_field">Choice field</label>
+
+  <div class="">
+    <select name="choice_field" class=" form-control" id="id_choice_field">
+  <option value="0">Zero</option>
+
+  <option value="1">One</option>
+
+  <option value="2">Two</option>
+
+</select>
+  </div>
+</div>
+  <div class="form-group">
+        <label class="control-label  required">Radio choice</label>
+  <div class="">
+      <div class="radio">
+        <label>
+          <input type="radio" name="radio_choice" value="0" id="id_radio_choice_0" required>
+          Zero
+        </label>
+      </div>
+      <div class="radio">
+        <label>
+          <input type="radio" name="radio_choice" value="1" id="id_radio_choice_1" required>
+          One
+        </label>
+      </div>
+      <div class="radio">
+        <label>
+          <input type="radio" name="radio_choice" value="2" id="id_radio_choice_2" required>
+          Two
+        </label>
+      </div>
+
+  </div>
+</div>
+  <div class="form-group">
+        <label class="control-label  required" for="id_multiple_choice">Multiple choice</label>
+
+  <div class="">
+    <select name="multiple_choice" class=" form-control" required id="id_multiple_choice" multiple>
+  <option value="0">Zero</option>
+
+  <option value="1">One</option>
+
+  <option value="2">Two</option>
+
+</select>
+  </div>
+</div>
+  <div class="form-group">
+        <label class="control-label  required" for="id_multiple_checkbox">Multiple checkbox</label>
+
+  <div class=" multiple-checkbox">
+    <ul id="id_multiple_checkbox">
+    <li><label for="id_multiple_checkbox_0"><input type="checkbox" name="multiple_checkbox" value="0" id="id_multiple_checkbox_0">
+ Zero</label>
+
+</li>
+    <li><label for="id_multiple_checkbox_1"><input type="checkbox" name="multiple_checkbox" value="1" id="id_multiple_checkbox_1">
+ One</label>
+
+</li>
+    <li><label for="id_multiple_checkbox_2"><input type="checkbox" name="multiple_checkbox" value="2" id="id_multiple_checkbox_2">
+ Two</label>
+
+</li>
+</ul>
+  </div>
+</div>
+  <div class="form-group">
+        <label class="control-label  required" for="id_file_fied">File fied</label>
+
+  <div class="">
+    <input type="file" name="file_fied" required id="id_file_fied">
+  </div>
+</div>
+  <div class="form-group">
+        <label class="control-label  required" for="id_password_field">Password field</label>
+
+  <div class="">
+    <input type="password" name="password_field" class=" form-control" required id="id_password_field">
+  </div>
+</div>
+  <div class="form-group">
+        <label class="control-label  required" for="id_textarea">Textarea</label>
+
+  <div class="">
+    <textarea name="textarea" cols="40" rows="10" class=" form-control" required id="id_textarea">
+</textarea>
+  </div>
+</div>
+  <div class="form-group">
+    <div class="">
+    <div class="checkbox">
+        <label class="required">
+          <input type="checkbox" name="boolean_field" required id="id_boolean_field"> <span>Boolean field</span>
+        </label>
+    </div>
+  </div>
+</div>
diff --git a/testing/fixtures_30/horizontal.html b/testing/fixtures_30/horizontal.html
new file mode 100644
index 0000000..cb790fb
--- /dev/null
+++ b/testing/fixtures_30/horizontal.html
@@ -0,0 +1,110 @@
+  <div class="form-group">
+        <label class="control-label col-sm-2 col-lg-2 required" for="id_char_field">Char field</label>
+
+  <div class="col-sm-10 col-lg-10">
+    <input type="text" name="char_field" class=" form-control" required id="id_char_field">
+  </div>
+</div>
+  <div class="form-group">
+        <label class="control-label col-sm-2 col-lg-2 required" for="id_choice_field">Choice field</label>
+
+  <div class="col-sm-10 col-lg-10">
+    <select name="choice_field" class=" form-control" id="id_choice_field">
+  <option value="0">Zero</option>
+
+  <option value="1">One</option>
+
+  <option value="2">Two</option>
+
+</select>
+  </div>
+</div>
+  <div class="form-group">
+        <label class="control-label col-sm-2 col-lg-2 required">Radio choice</label>
+  <div class="col-sm-10 col-lg-10">
+      <div class="radio">
+        <label>
+          <input type="radio" name="radio_choice" value="0" id="id_radio_choice_0" required>
+          Zero
+        </label>
+      </div>
+      <div class="radio">
+        <label>
+          <input type="radio" name="radio_choice" value="1" id="id_radio_choice_1" required>
+          One
+        </label>
+      </div>
+      <div class="radio">
+        <label>
+          <input type="radio" name="radio_choice" value="2" id="id_radio_choice_2" required>
+          Two
+        </label>
+      </div>
+
+  </div>
+</div>
+  <div class="form-group">
+        <label class="control-label col-sm-2 col-lg-2 required" for="id_multiple_choice">Multiple choice</label>
+
+  <div class="col-sm-10 col-lg-10">
+    <select name="multiple_choice" class=" form-control" required id="id_multiple_choice" multiple>
+  <option value="0">Zero</option>
+
+  <option value="1">One</option>
+
+  <option value="2">Two</option>
+
+</select>
+  </div>
+</div>
+  <div class="form-group">
+        <label class="control-label col-sm-2 col-lg-2 required" for="id_multiple_checkbox">Multiple checkbox</label>
+
+  <div class="col-sm-10 col-lg-10 multiple-checkbox">
+    <ul id="id_multiple_checkbox">
+    <li><label for="id_multiple_checkbox_0"><input type="checkbox" name="multiple_checkbox" value="0" id="id_multiple_checkbox_0">
+ Zero</label>
+
+</li>
+    <li><label for="id_multiple_checkbox_1"><input type="checkbox" name="multiple_checkbox" value="1" id="id_multiple_checkbox_1">
+ One</label>
+
+</li>
+    <li><label for="id_multiple_checkbox_2"><input type="checkbox" name="multiple_checkbox" value="2" id="id_multiple_checkbox_2">
+ Two</label>
+
+</li>
+</ul>
+  </div>
+</div>
+  <div class="form-group">
+        <label class="control-label col-sm-2 col-lg-2 required" for="id_file_fied">File fied</label>
+
+  <div class="col-sm-10 col-lg-10">
+    <input type="file" name="file_fied" required id="id_file_fied">
+  </div>
+</div>
+  <div class="form-group">
+        <label class="control-label col-sm-2 col-lg-2 required" for="id_password_field">Password field</label>
+
+  <div class="col-sm-10 col-lg-10">
+    <input type="password" name="password_field" class=" form-control" required id="id_password_field">
+  </div>
+</div>
+  <div class="form-group">
+        <label class="control-label col-sm-2 col-lg-2 required" for="id_textarea">Textarea</label>
+
+  <div class="col-sm-10 col-lg-10">
+    <textarea name="textarea" cols="40" rows="10" class=" form-control" required id="id_textarea">
+</textarea>
+  </div>
+</div>
+  <div class="form-group">
+    <div class="col-sm-10 col-sm-offset-2 col-lg-10 col-lg-offset-2">
+    <div class="checkbox">
+        <label class="required">
+          <input type="checkbox" name="boolean_field" required id="id_boolean_field"> <span>Boolean field</span>
+        </label>
+    </div>
+  </div>
+</div>
diff --git a/testing/fixtures/partial.html b/testing/fixtures_30/partial.html
similarity index 53%
rename from testing/fixtures/partial.html
rename to testing/fixtures_30/partial.html
index b571230..0fc485c 100644
--- a/testing/fixtures/partial.html
+++ b/testing/fixtures_30/partial.html
@@ -3,7 +3,7 @@
         <label class="control-label  required" for="id_char_field">Char field</label>
 
   <div class="">
-    <input class=" form-control" id="id_char_field" name="char_field" type="text" required />
+    <input type="text" name="char_field" class=" form-control" required id="id_char_field">
   </div>
 </div>
 
@@ -11,10 +11,13 @@
         <label class="control-label  required" for="id_choice_field">Choice field</label>
 
   <div class="">
-    <select class=" form-control" id="id_choice_field" name="choice_field">
-<option value="0">Zero</option>
-<option value="1">One</option>
-<option value="2">Two</option>
+    <select name="choice_field" class=" form-control" id="id_choice_field">
+  <option value="0">Zero</option>
+
+  <option value="1">One</option>
+
+  <option value="2">Two</option>
+
 </select>
   </div>
-</div>
+</div>
\ No newline at end of file
diff --git a/testing/fixtures/basic.html b/testing/fixtures_40/basic.html
similarity index 99%
rename from testing/fixtures/basic.html
rename to testing/fixtures_40/basic.html
index 349c99f..37680b9 100644
--- a/testing/fixtures/basic.html
+++ b/testing/fixtures_40/basic.html
@@ -1,4 +1,3 @@
-
   <div class="form-group">
         <label class="control-label  required" for="id_char_field">Char field</label>
 
diff --git a/testing/fixtures/horizontal.html b/testing/fixtures_40/horizontal.html
similarity index 99%
rename from testing/fixtures/horizontal.html
rename to testing/fixtures_40/horizontal.html
index 56cd0da..ea32503 100644
--- a/testing/fixtures/horizontal.html
+++ b/testing/fixtures_40/horizontal.html
@@ -1,4 +1,3 @@
-
   <div class="form-group">
         <label class="control-label col-sm-2 col-lg-2 required" for="id_char_field">Char field</label>
 
diff --git a/testing/fixtures_40/partial.html b/testing/fixtures_40/partial.html
new file mode 100644
index 0000000..0fc485c
--- /dev/null
+++ b/testing/fixtures_40/partial.html
@@ -0,0 +1,23 @@
+
+<div class="form-group">
+        <label class="control-label  required" for="id_char_field">Char field</label>
+
+  <div class="">
+    <input type="text" name="char_field" class=" form-control" required id="id_char_field">
+  </div>
+</div>
+
+<div class="form-group">
+        <label class="control-label  required" for="id_choice_field">Choice field</label>
+
+  <div class="">
+    <select name="choice_field" class=" form-control" id="id_choice_field">
+  <option value="0">Zero</option>
+
+  <option value="1">One</option>
+
+  <option value="2">Two</option>
+
+</select>
+  </div>
+</div>
\ No newline at end of file
diff --git a/testing/testapp/tests.py b/testing/testapp/tests.py
index 78b92d4..26ddce6 100644
--- a/testing/testapp/tests.py
+++ b/testing/testapp/tests.py
@@ -1,10 +1,15 @@
 import os
+from django import VERSION as DJANGO_VERSION
 from django.test import TestCase, Client
 from django.conf import settings
 
 GEN_HTML = bool(os.getenv('GEN_HTML', False))
 
-FIXTURES_DIR = 'fixtures'
+if DJANGO_VERSION >= (4, 0):
+    FIXTURES_DIR = 'fixtures_40'
+else:
+    assert DJANGO_VERSION >= (3, 0)
+    FIXTURES_DIR = 'fixtures_30'
 
 
 class BootstrapJinjaTemplateTagTests(TestCase):