Skip to content

Commit 78dbff1

Browse files
authored
Merge pull request #111 from lemonsaurus/add-comprehensive-test-suite
Add comprehensive test suite and improve code quality
2 parents bb4845c + f7b5a01 commit 78dbff1

34 files changed

+30060
-78
lines changed

.coverage

52 KB
Binary file not shown.

.coveragerc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[run]
2+
source = django_simple_bulma
3+
relative_files = true
4+
omit =
5+
*/migrations/*
6+
*/venv/*
7+
*/env/*
8+
tests/*
9+
setup.py
10+
11+
[report]
12+
exclude_lines =
13+
pragma: no cover
14+
def __repr__
15+
raise AssertionError
16+
raise NotImplementedError
17+
if __name__ == .__main__.:
18+
19+
[html]
20+
directory = htmlcov

.github/workflows/lint.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Lint with flake8
1+
name: Lint
22
on:
33
push:
44
branches: [main]
@@ -12,11 +12,13 @@ jobs:
1212
PRE_COMMIT_HOME: ${{ github.workspace }}/pre-commit-cache
1313
steps:
1414
- uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
1517
- name: Set up Python
1618
id: python
1719
uses: actions/setup-python@v5
1820
with:
19-
python-version: '3.8'
21+
python-version: '3.12'
2022
- name: Restore pre-commit environment
2123
uses: actions/cache@v4
2224
with:
@@ -25,7 +27,7 @@ jobs:
2527
precommit-\
2628
${{ steps.python.outputs.python-version }}-\
2729
${{ hashFiles('.pre-commit-config.yaml') }}"
28-
- name: Install flake8 and plugins from setup.py
30+
- name: Install dependencies
2931
run: |
3032
python -m pip install --upgrade pip
3133
pip install .[dev]

.github/workflows/test.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Test with pytest
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.12', '3.13']
15+
django-version: ['4.2', '5.2']
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install .[dev]
31+
pip install "Django~=${{ matrix.django-version }}.0"
32+
33+
- name: Run tests
34+
run: |
35+
pytest -v --tb=short
36+
37+
- name: Run tests with coverage
38+
if: matrix.python-version == '3.12' && matrix.django-version == '4.2'
39+
run: |
40+
pip install coverage
41+
coverage run -m pytest
42+
coverage report --show-missing
43+
coverage xml
44+
45+
- name: Comment coverage on PR
46+
if: github.event_name == 'pull_request' && matrix.python-version == '3.12' && matrix.django-version == '4.2'
47+
uses: py-cov-action/python-coverage-comment-action@v3
48+
with:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
MINIMUM_GREEN: 85
51+
MINIMUM_ORANGE: 70

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ build/
77
dist/*
88
!dist/js
99
django_simple_bulma.egg-info/
10+
11+
12+
# AI stuff
13+
.claude
14+
CLAUDE.*

.gitmodules

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,15 @@
1010
[submodule "bulma-badge"]
1111
path = django_simple_bulma/extensions/bulma-badge
1212
url = https://github.com/CreativeBulma/bulma-badge.git
13-
[submodule "bulma-carousel"]
14-
path = django_simple_bulma/extensions/bulma-carousel
15-
url = https://github.com/Wikiki/bulma-carousel.git
1613
[submodule "bulma-calendar"]
1714
path = django_simple_bulma/extensions/bulma-calendar
1815
url = https://github.com/Wikiki/bulma-calendar.git
19-
[submodule "bulma-quickview"]
20-
path = django_simple_bulma/extensions/bulma-quickview
21-
url = https://github.com/Wikiki/bulma-quickview.git
22-
[submodule "bulma-pricingtable"]
23-
path = django_simple_bulma/extensions/bulma-pricingtable
24-
url = https://github.com/Wikiki/bulma-pricingtable.git
2516
[submodule "bulma-megamenu"]
2617
path = django_simple_bulma/extensions/bulma-megamenu
2718
url = https://github.com/hunzaboy/bulma-megamenu.git
2819
[submodule "Cool-Checkboxes-for-Bulma.io"]
2920
path = django_simple_bulma/extensions/bulma-coolcheckboxes
3021
url = https://github.com/hunzaboy/Cool-Checkboxes-for-Bulma.io.git
31-
[submodule "bulma-slider"]
32-
path = django_simple_bulma/extensions/bulma-slider
33-
url = https://github.com/Wikiki/bulma-slider.git
34-
[submodule "bulma-checkradio"]
35-
path = django_simple_bulma/extensions/bulma-checkradio
36-
url = https://github.com/Wikiki/bulma-checkradio.git
37-
[submodule "bulma-switch"]
38-
path = django_simple_bulma/extensions/bulma-switch
39-
url = https://github.com/Wikiki/bulma-switch.git
40-
[submodule "bulma-pageloader"]
41-
path = django_simple_bulma/extensions/bulma-pageloader
42-
url = https://github.com/Wikiki/bulma-pageloader.git
43-
[submodule "bulma-ribbon"]
44-
path = django_simple_bulma/extensions/bulma-ribbon
45-
url = https://github.com/Wikiki/bulma-ribbon.git
46-
[submodule "bulma-steps"]
47-
path = django_simple_bulma/extensions/bulma-steps
48-
url = https://github.com/Wikiki/bulma-steps.git
49-
[submodule "bulma-timeline"]
50-
path = django_simple_bulma/extensions/bulma-timeline
51-
url = https://github.com/Wikiki/bulma-timeline.git
5222
[submodule "bulma-collapsible"]
5323
path = django_simple_bulma/extensions/bulma-collapsible
5424
url = https://github.com/CreativeBulma/bulma-collapsible.git

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v2.5.0
3+
rev: v4.6.0
44
hooks:
55
- id: check-merge-conflict
66
- id: check-yaml
77
- id: end-of-file-fixer
88
- id: trailing-whitespace
99
args: [--markdown-linebreak-ext=md]
1010
- repo: https://github.com/pre-commit/pygrep-hooks
11-
rev: v1.5.1
11+
rev: v1.10.0
1212
hooks:
1313
- id: python-check-blanket-noqa
1414
- repo: local

0 commit comments

Comments
 (0)