-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Django 4.2 and python 3.12 (#105)
* Add ruff and black to pre-commit. Drop flake8 * Add pip to dependabot.yml * Add ruff config * Run ruff * Run ruff * Run ruff * Revamp requirements for tests * Test via tox * Minor changes * Update linter workflow * Update linter workflow * Fix `needs` * Fix tox * Drop deprecation warning. Feed `allowed_styles` into `css_sanitizer` * Update test requirements * Remove warning checks from tests * CI test against django main * Drop combine * Bump future to ubuntu-22.04 * Allow pre-release python * Update coverage config * Should fix coverage * Should fix coverage * Update changelog * Update docs conf match * Bump version: 3.0.1 → 3.1.0
- Loading branch information
Showing
48 changed files
with
2,262 additions
and
666 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,110 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
group: ${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
unit-tests: | ||
runs-on: ${{ matrix.os }} | ||
name: Python ${{ matrix.python-version }} | ||
runs-on: ubuntu-22.04 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.8, 3.9, 3.10.1] | ||
django-version: [ | ||
'3.2', | ||
'4.0', | ||
'4.1', | ||
] | ||
os: [ | ||
ubuntu-20.04, | ||
] | ||
python-version: | ||
- 3.8 | ||
- 3.9 | ||
- '3.10' | ||
- '3.11' | ||
- '3.12' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
allow-prereleases: true | ||
cache: pip | ||
cache-dependency-path: 'requirements/*.txt' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install django==${{ matrix.django-version }} "bleach>=5,<6" coverage mock | ||
python setup.py install | ||
- name: Run coverage | ||
run: | | ||
coverage run --rcfile .coveragerc testproject/manage.py test --failfast django_bleach | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install --upgrade 'tox>=4.0.0rc3' | ||
- name: Run tox targets for ${{ matrix.python-version }} | ||
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .) | ||
|
||
- name: Upload coverage data | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage-data | ||
path: '.coverage.*' | ||
|
||
- name: Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
coverage: | ||
name: Coverage | ||
runs-on: ubuntu-22.04 | ||
needs: unit-tests | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install dependencies | ||
run: python -m pip install --upgrade coverage[toml] | ||
|
||
- name: Download data | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: coverage-data | ||
|
||
- name: Fail if coverage is <100% | ||
run: | | ||
python -m coverage combine | ||
python -m coverage html --skip-covered --skip-empty | ||
python -m coverage report --fail-under=100 | ||
- name: Upload HTML report | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: html-report | ||
path: htmlcov | ||
|
||
pre-release: | ||
runs-on: ${{ matrix.os }} | ||
unit-tests-future-versions: | ||
# Runs for all Django/Python versions which are not yet supported | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: true | ||
fail-fast: false | ||
matrix: | ||
os: [ | ||
ubuntu-20.04, | ||
python-version: ['3.11', '3.12'] | ||
django-version: [ | ||
'https://github.com/django/django/archive/main.tar.gz' | ||
] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.9 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
allow-prereleases: true | ||
cache: pip | ||
cache-dependency-path: 'requirements/*.txt' | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --pre django "bleach>=5,<6" coverage mock | ||
python setup.py install | ||
- name: Run tests | ||
run: | | ||
python testproject/manage.py test django_bleach | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install --upgrade 'tox>=4.0.0rc3' | ||
- name: Run tox targets for ${{ matrix.python-version }} | ||
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
__version__ = "3.0.1" | ||
__version__ = "3.1.0" | ||
|
||
VERSION = __version__.split(".") |
Oops, something went wrong.