Skip to content

Commit

Permalink
Support LTS + Current versions of Wagtail and Django (#34)
Browse files Browse the repository at this point in the history
* Add support for Django 3.1
* Add coveralls badge to the README
  • Loading branch information
cwdavies committed Aug 21, 2020
1 parent 07fdd26 commit dc64ae2
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 52 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: test

on: [pull_request, push]

jobs:

lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run tox -e lint
run: tox
env:
TOXENV: lint

test:
name: unittests
runs-on: ubuntu-latest

strategy:
matrix:
toxenv:
- py36-dj22-wag27
- py36-dj22-wag210
- py36-dj31-wag210
- py38-dj22-wag27
- py38-dj22-wag210
- py38-dj31-wag210
include:
- toxenv: py36-dj22-wag27
python-version: 3.6
- toxenv: py36-dj22-wag210
python-version: 3.6
- toxenv: py36-dj31-wag210
python-version: 3.6
- toxenv: py38-dj22-wag27
python-version: 3.8
- toxenv: py38-dj22-wag210
python-version: 3.8
- toxenv: py38-dj31-wag210
python-version: 3.8

steps:
- uses: actions/checkout@v1

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox coveralls
- name: Run tox
run: |
tox
coveralls
env:
TOXENV: ${{ matrix.toxenv }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

15 changes: 9 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.. image:: https://travis-ci.org/cfpb/wagtail-inventory.svg?branch=master
.. image:: https://travis-ci.org/cfpb/wagtail-inventory.svg?branch=main
:alt: Build Status
:target: https://travis-ci.org/cfpb/wagtail-inventory
.. image:: https://coveralls.io/repos/github/cfpb/wagtail-sharing/badge.svg?branch=main
:alt: Coverage Status
:target: https://coveralls.io/github/cfpb/wagtail-sharing?branch=main

wagtail-inventory
=================
Expand Down Expand Up @@ -48,9 +51,9 @@ Compatibility

This code has been tested for compatibility with:

* Python 3.6, 3.8
* Django 1.11, 2.2
* Wagtail 2.3, 2.9, 2.10
* Python 3.6+
* Django 2.2 (LTS), 3.1 (current)
* Wagtail 2.7 (LTS), 2.10 (current)

It should be compatible with all intermediate versions, as well.
If you find that it is not, please `file an issue <https://github.com/cfpb/wagtail-inventory/issues/new>`_.
Expand All @@ -63,6 +66,6 @@ Run unit tests with ``tox`` to test against select supported package combination
Open source licensing info
--------------------------

#. `TERMS <https://github.com/cfpb/wagtail-inventory/blob/master/TERMS.md>`_
#. `LICENSE <https://github.com/cfpb/wagtail-inventory/blob/master/LICENSE>`_
#. `TERMS <https://github.com/cfpb/wagtail-inventory/blob/main/TERMS.md>`_
#. `LICENSE <https://github.com/cfpb/wagtail-inventory/blob/main/LICENSE>`_
#. `CFPB Source Code Policy <https://github.com/cfpb/source-code-policy>`_
11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

install_requires = [
"tqdm==4.15.0",
"wagtail>=2.3,<2.11",
"wagtail>=2.7,<2.11",
]


Expand All @@ -14,7 +14,6 @@

testing_extras = [
"coverage>=3.7.0",
"flake8>=2.2.0",
"mock>=1.0.0",
]

Expand All @@ -24,20 +23,20 @@
author="CFPB",
author_email="tech@cfpb.gov",
description="Lookup Wagtail pages by block content",
long_description=open("README.rst").read(),
long_description=open("README.rst", "r", encoding="utf-8").read(),
license="CCO",
version="1.1.1",
version="1.1.2",
version_format="{tag}.dev{commitcount}+{gitsha}",
include_package_data=True,
packages=find_packages(),
python_requires=">=3.6",
install_requires=install_requires,
setup_requires=setup_requires,
extras_require={"testing": testing_extras,},
extras_require={"testing": testing_extras},
classifiers=[
"Framework :: Django",
"Framework :: Django :: 1.11",
"Framework :: Django :: 2.2",
"Framework :: Django :: 3.1",
"Framework :: Wagtail",
"Framework :: Wagtail :: 2",
"License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication",
Expand Down
28 changes: 15 additions & 13 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[tox]
skipsdist=True
envlist=lint,
py{36}-dj{111,22}-wag{23},
py{36,38}-dj{22}-wag{29,210},
envlist=
lint,
py{36,38}-dj{22,31}-wag{27,210}

[testenv]
install_command=pip install -e ".[testing]" -U {opts} {packages}
commands=
coverage erase
coverage run {envbindir}/django-admin.py test {posargs}
coverage report
coverage report -m
setenv=
DJANGO_SETTINGS_MODULE=wagtailinventory.tests.settings

Expand All @@ -18,29 +19,30 @@ basepython=

deps=
mock>=1.0.0
dj111: Django>=1.11,<1.12
dj22: Django>=2.2,<2.3
wag23: wagtail>=2.3,<2.4
wag29: wagtail>=2.9,<2.10
dj31: Django>=3.1,<3.2
wag27: wagtail>=2.7,<2.8
wag210: wagtail>=2.10,<2.11

[testenv:lint]
recreate=False
basepython=python3.6
deps=
black
flake8
isort
commands=
black --check wagtailinventory setup.py
flake8 wagtailinventory
flake8 wagtailinventory setup.py
isort --check-only --diff wagtailinventory

[flake8]
ignore=E731,W503,W504
exclude=
wagtailinventory/migrations/*.py,
wagtailinventory/tests/testapp/migrations/*.py
.git,
.tox,
__pycache__,
*/migrations/*.py,
*/tests/testapp/migrations/*.py,

[isort]
combine_as_imports=1
Expand All @@ -50,6 +52,6 @@ multi_line_output=3
skip=.tox,migrations
use_parentheses=1
known_django=django
known_future_library=future
known_wagtail=wagtail
default_section=THIRDPARTY
sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
sections=FUTURE,STDLIB,DJANGO,WAGTAIL,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
3 changes: 2 additions & 1 deletion wagtailinventory/management/commands/block_inventory.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from django.core.management import BaseCommand

from tqdm import tqdm
from wagtail.core.models import Page

from tqdm import tqdm

from wagtailinventory.helpers import (
create_page_inventory,
delete_page_inventory,
Expand Down

0 comments on commit dc64ae2

Please sign in to comment.