Skip to content

Commit

Permalink
Django 4 support (#150)
Browse files Browse the repository at this point in the history
* Updating ready for django 4 support

* Install django-cms 4.1rc1

* Fix yml formatting

* Linter python version fix

* Undoing some changes to test workflow

* Change requirements

* Catch change in django-cms 4.1

* Catch change in django-cms 4.1

* Fix test for django 4.1

* Flake8 fix

* Added concurrency to cancel in progress

* Removed django 2.2

* Updated changelog

* test against django main branch

* Compile test requirements

* Cleanup tox

* Cleanup tox

* Added changelog note about tox tests

* Added django-cms classifiers

* Add tests against cms 4.0 & disable django main tests due to cms 4.1 cap on django<4.2
  • Loading branch information
marksweb authored Jan 13, 2023
1 parent 85a869a commit 47e27ac
Show file tree
Hide file tree
Showing 35 changed files with 3,538 additions and 63 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
8 changes: 6 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Lint

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on: [push, pull_request]

jobs:
Expand All @@ -12,7 +16,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: "3.10"
- name: Install flake8
run: pip install --upgrade flake8
- name: Run flake8
Expand All @@ -29,7 +33,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: "3.10"
- run: python -m pip install isort
- name: isort
uses: liskin/gh-problem-matcher-wrap@v1
Expand Down
46 changes: 20 additions & 26 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,17 @@ on:

jobs:
unit-tests:
runs-on: ${{ matrix.os }}
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04

strategy:
fail-fast: false
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
requirements-file: [
django_22.txt,
django_32.txt,
]
os: [
ubuntu-20.04,
]
versioning-enabled: [ 0, 1 ]
python-version:
- 3.7
- 3.8
- 3.9
- '3.10'
- '3.11'

steps:
- uses: actions/checkout@v3
Expand All @@ -38,38 +36,34 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements/${{ matrix.requirements-file }}
python setup.py install
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox tox-py
- name: Run coverage
env:
ENABLE_VERSIONING: ${{ matrix.versioning-enabled }}
run: coverage run setup.py test
- name: Run tox targets for ${{ matrix.python-version }}
run: tox --py current

- name: Upload coverage data
uses: actions/upload-artifact@v2
with:
name: coverage-data
path: '.coverage*'
path: '.coverage.*'

coverage:
name: Coverage
runs-on: ubuntu-20.04
needs: unit-tests
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@master
- uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: '3.10'

- name: Install dependencies
run: python -m pip install --upgrade coverage
run: python -m pip install --upgrade coverage[toml]

- name: Download data
uses: actions/download-artifact@v3
uses: actions/download-artifact@v2
with:
name: coverage-data

Expand All @@ -81,7 +75,7 @@ jobs:
- name: Upload HTML report
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v2
with:
name: html-report
path: htmlcov
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dist/
build/
.env
local.sqlite
.coverage
.coverage*
htmlcov
.python-version
venv*
Expand Down
42 changes: 42 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ci:
autofix_commit_msg: |
ci: auto fixes from pre-commit hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_commit_msg: 'ci: pre-commit autoupdate'
autoupdate_schedule: monthly

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.0
hooks:
- id: pyupgrade
args: ["--py38-plus"]

- repo: https://github.com/adamchainz/django-upgrade
rev: '1.12.0'
hooks:
- id: django-upgrade
args: [--target-version, "3.2"]

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
# - flake8-broken-line
- flake8-bugbear
- flake8-builtins
- flake8-coding
- flake8-commas
- flake8-comprehensions
- flake8-eradicate
- flake8-quotes
- flake8-tidy-imports
- pep8-naming

- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Changelog

Unreleased
==========
* Django 4.0 and 4.1 support added
* Django 2.2 support removed
* Python 3.7 support removed
* Changed test setup to run tox from github actions for consistency in testing

1.11.0 (2022-10-14)
===================
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exclude =
.git,
.settings,
.tox,
.venv,
build,
data,
dist,
Expand All @@ -19,7 +20,7 @@ exclude =

[isort]
line_length = 79
skip = manage.py, migrations, .tox, .eggs, data, venv
skip = manage.py, migrations, .tox, .eggs, data, .venv, venv
include_trailing_comma = true
multi_line_output = 3
lines_after_imports = 2
Expand Down
9 changes: 7 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,24 @@
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'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.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Framework :: Django :: 4.1',
'Framework :: Django CMS :: 4.0',
'Framework :: Django CMS :: 4.1',
]

INSTALL_REQUIREMENTS = [
'Django>=2.2,<4.0',
'Django>=2.2',
'django-parler>=1.4',
'django-cms',
]
Expand Down
Loading

0 comments on commit 47e27ac

Please sign in to comment.