Skip to content

Commit 89d601d

Browse files
committed
Migrate test runners to github actions
1 parent d54e2e4 commit 89d601d

File tree

5 files changed

+84
-77
lines changed

5 files changed

+84
-77
lines changed

.github/workflows/python-app.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python application
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
tests_python:
14+
name: Test on Python ${{ matrix.python_version }} and Django ${{ matrix.django_version }}
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
django_version: [ '1.11', '2.0', '2.1', '2.2', '3.0', '3.1' ]
19+
python_version: [ '3.4', '3.5', '3.6', '3.7', '3.8', '3.9' ]
20+
exclude:
21+
- django_version: '1.11'
22+
python_version: '3.8'
23+
- django_version: '1.11'
24+
python_version: '3.9'
25+
26+
- django_version: '2.0'
27+
python_version: '3.8'
28+
- django_version: '2.0'
29+
python_version: '3.9'
30+
31+
- django_version: '2.1'
32+
python_version: '3.4'
33+
- django_version: '2.1'
34+
python_version: '3.8'
35+
- django_version: '2.1'
36+
python_version: '3.9'
37+
38+
- django_version: '2.2'
39+
python_version: '3.4'
40+
41+
- django_version: '3.0'
42+
python_version: '3.4'
43+
- django_version: '3.0'
44+
python_version: '3.5'
45+
46+
- django_version: '3.1'
47+
python_version: '3.4'
48+
- django_version: '3.1'
49+
python_version: '3.5'
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
53+
54+
steps:
55+
- uses: actions/checkout@v2
56+
- name: Set up Python ${{ matrix.python_version }}
57+
uses: actions/setup-python@v2
58+
with:
59+
python-version: ${{ matrix.python_version }}
60+
- name: Cache pip
61+
uses: actions/cache@v2
62+
with:
63+
# This path is specific to Ubuntu
64+
path: ~/.cache/pip
65+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.django_version }}
66+
- name: Install dependencies
67+
run: |
68+
python -m pip install --upgrade pip
69+
pip install -U flake8 coveralls argparse
70+
pip install -U Django~=${{ matrix.django_version }}
71+
- name: Lint with flake8
72+
run: |
73+
flake8 --ignore=E501,W504 safedelete
74+
- name: Test Django
75+
if: matrix.django_version != '1.11'
76+
run: |
77+
python -m coverage run `which django-admin.py` test --settings=safedelete.tests.settings
78+
- name: Coverage
79+
if: ${{ success() }}
80+
run: |
81+
coveralls

.travis.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

README.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Django safedelete
22
=================
33

4-
.. image:: https://travis-ci.org/makinacorpus/django-safedelete.png
5-
:target: https://travis-ci.org/makinacorpus/django-safedelete
4+
.. image:: https://github.com/makinacorpus/django-safedelete/workflows/Python%20application/badge.svg
65

76
.. image:: https://coveralls.io/repos/makinacorpus/django-safedelete/badge.png
87
:target: https://coveralls.io/r/makinacorpus/django-safedelete

safedelete/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def queryset(self, request):
6969
def get_queryset(self, request):
7070
try:
7171
queryset = self.model.all_objects.all()
72-
except:
72+
except Exception:
7373
queryset = self.model._default_manager.all()
7474

7575
ordering = self.get_ordering(request)

safedelete/queryset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def _filter_visibility(self):
119119
)
120120

121121
self._safedelete_filter_applied = True
122-
122+
123123
def resolve_expression(self, *args, **kwargs):
124124
self._filter_visibility()
125125
return super(SafeDeleteQueryset, self).resolve_expression(*args, **kwargs)

0 commit comments

Comments
 (0)