Skip to content

Commit 300d61e

Browse files
alkihisfoltmatthiaskjezdezhramezani
authored
Merged master from source (#1)
* fix AttributeError: 'dict' object has no attribute 'getlist' #1406 * Revert "fix AttributeError: 'dict' object has no attribute 'getlist' #1406" * Remove support for Python 3.5 * Remove py35 from tox.ini too; make black target Python 3.6 * Migrate to GitHub Actions. (#1410) * add test case for generate_stats * add get_sorted_request_variable and support dict in request data * fix import * style check * style check * fix style check * fix request.POST * History panel: Do not crash when receiving invalid JSON Fixes #1403 * Add Python3.9 support. * Add Python and Django supported versions badges to README.rst * Add two template blocks to allow overriding CSS and JS * Use alternating quotes (fix highlighting in IDEs) * django-debug-toolbar 3.2 Co-authored-by: folt <foltfrend@list.ru> Co-authored-by: Matthias Kestenholz <mk@feinheit.ch> Co-authored-by: Jannis Leidel <jannis@leidel.info> Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com> Co-authored-by: Peter Bittner <django@bittner.it>
1 parent 8ba70f7 commit 300d61e

File tree

21 files changed

+430
-162
lines changed

21 files changed

+430
-162
lines changed

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
if: github.repository == 'jazzband/django-debug-toolbar'
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.8
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install -U pip
26+
python -m pip install -U setuptools twine wheel
27+
28+
- name: Build package
29+
run: |
30+
python setup.py --version
31+
python setup.py sdist --format=gztar bdist_wheel
32+
twine check dist/*
33+
34+
- name: Upload packages to Jazzband
35+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
36+
uses: pypa/gh-action-pypi-publish@master
37+
with:
38+
user: jazzband
39+
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
40+
repository_url: https://jazzband.co/projects/django-debug-toolbar/upload

.github/workflows/test.yml

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
mysql:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
max-parallel: 5
11+
matrix:
12+
python-version: ['3.6', '3.7', '3.8', '3.9']
13+
14+
services:
15+
mariadb:
16+
image: mariadb:10.3
17+
env:
18+
MYSQL_ROOT_PASSWORD: mysql
19+
MYSQL_DATABASE: mysql
20+
options: >-
21+
--health-cmd "mysqladmin ping"
22+
--health-interval 10s
23+
--health-timeout 5s
24+
--health-retries 5
25+
ports:
26+
- 3306:3306
27+
28+
steps:
29+
- uses: actions/checkout@v2
30+
31+
- name: Set up Python ${{ matrix.python-version }}
32+
uses: actions/setup-python@v2
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
36+
- name: Get pip cache dir
37+
id: pip-cache
38+
run: |
39+
echo "::set-output name=dir::$(pip cache dir)"
40+
41+
- name: Cache
42+
uses: actions/cache@v2
43+
with:
44+
path: ${{ steps.pip-cache.outputs.dir }}
45+
key:
46+
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
47+
restore-keys: |
48+
${{ matrix.python-version }}-v1-
49+
50+
- name: Install enchant (only for docs)
51+
run: |
52+
sudo apt-get -qq update
53+
sudo apt-get -y install enchant
54+
55+
- name: Install dependencies
56+
run: |
57+
python -m pip install --upgrade pip
58+
python -m pip install --upgrade tox tox-gh-actions
59+
60+
- name: Test with tox
61+
run: tox
62+
env:
63+
DB_BACKEND: mysql
64+
DB_NAME: mysql
65+
DB_USER: root
66+
DB_PASSWORD: mysql
67+
DB_HOST: "127.0.0.1"
68+
DB_PORT: "3306"
69+
70+
- name: Upload coverage
71+
uses: codecov/codecov-action@v1
72+
with:
73+
name: Python ${{ matrix.python-version }}
74+
75+
postgres:
76+
runs-on: ubuntu-latest
77+
strategy:
78+
fail-fast: false
79+
max-parallel: 5
80+
matrix:
81+
python-version: ['3.6', '3.7', '3.8', '3.9']
82+
83+
services:
84+
postgres:
85+
image: 'postgres:9.5'
86+
env:
87+
POSTGRES_PASSWORD: postgres
88+
ports:
89+
- 5432:5432
90+
options: >-
91+
--health-cmd pg_isready
92+
--health-interval 10s
93+
--health-timeout 5s
94+
--health-retries 5
95+
96+
steps:
97+
- uses: actions/checkout@v2
98+
99+
- name: Set up Python ${{ matrix.python-version }}
100+
uses: actions/setup-python@v2
101+
with:
102+
python-version: ${{ matrix.python-version }}
103+
104+
- name: Get pip cache dir
105+
id: pip-cache
106+
run: |
107+
echo "::set-output name=dir::$(pip cache dir)"
108+
109+
- name: Cache
110+
uses: actions/cache@v2
111+
with:
112+
path: ${{ steps.pip-cache.outputs.dir }}
113+
key:
114+
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
115+
restore-keys: |
116+
${{ matrix.python-version }}-v1-
117+
118+
- name: Install enchant (only for docs)
119+
run: |
120+
sudo apt-get -qq update
121+
sudo apt-get -y install enchant
122+
123+
- name: Install dependencies
124+
run: |
125+
python -m pip install --upgrade pip
126+
python -m pip install --upgrade tox tox-gh-actions
127+
128+
- name: Test with tox
129+
run: tox
130+
env:
131+
DB_BACKEND: postgresql
132+
DB_NAME: postgres
133+
DB_USER: postgres
134+
DB_PASSWORD: postgres
135+
DB_HOST: localhost
136+
DB_PORT: 5432
137+
138+
- name: Upload coverage
139+
uses: codecov/codecov-action@v1
140+
with:
141+
name: Python ${{ matrix.python-version }}
142+
143+
sqlite:
144+
runs-on: ubuntu-latest
145+
strategy:
146+
fail-fast: false
147+
max-parallel: 5
148+
matrix:
149+
python-version: ['3.6', '3.7', '3.8', '3.9']
150+
151+
steps:
152+
- uses: actions/checkout@v2
153+
154+
- name: Set up Python ${{ matrix.python-version }}
155+
uses: actions/setup-python@v2
156+
with:
157+
python-version: ${{ matrix.python-version }}
158+
159+
- name: Get pip cache dir
160+
id: pip-cache
161+
run: |
162+
echo "::set-output name=dir::$(pip cache dir)"
163+
164+
- name: Cache
165+
uses: actions/cache@v2
166+
with:
167+
path: ${{ steps.pip-cache.outputs.dir }}
168+
key:
169+
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
170+
restore-keys: |
171+
${{ matrix.python-version }}-v1-
172+
173+
- name: Install dependencies
174+
run: |
175+
python -m pip install --upgrade pip
176+
python -m pip install --upgrade tox tox-gh-actions
177+
178+
- name: Test with tox
179+
run: tox
180+
env:
181+
DB_BACKEND: sqlite3
182+
DB_NAME: ":memory:"
183+
184+
- name: Upload coverage
185+
uses: codecov/codecov-action@v1
186+
with:
187+
name: Python ${{ matrix.python-version }}
188+
189+
lint:
190+
runs-on: ubuntu-latest
191+
strategy:
192+
fail-fast: false
193+
194+
steps:
195+
- uses: actions/checkout@v2
196+
197+
- name: Set up Python ${{ matrix.python-version }}
198+
uses: actions/setup-python@v2
199+
with:
200+
python-version: 3.8
201+
202+
- name: Get pip cache dir
203+
id: pip-cache
204+
run: |
205+
echo "::set-output name=dir::$(pip cache dir)"
206+
207+
- name: Cache
208+
uses: actions/cache@v2
209+
with:
210+
path: ${{ steps.pip-cache.outputs.dir }}
211+
key:
212+
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
213+
restore-keys: |
214+
${{ matrix.python-version }}-v1-
215+
216+
- name: Install dependencies
217+
run: |
218+
python -m pip install --upgrade pip
219+
python -m pip install --upgrade tox
220+
221+
- name: Test with tox
222+
run: tox -e docs,style,readme

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ htmlcov
1212
node_modules
1313
package-lock.json
1414
geckodriver.log
15+
coverage.xml

.travis.yml

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

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ PRETTIER_TARGETS = '**/*.(css|js)'
44

55
style: package-lock.json
66
isort .
7-
black --target-version=py35 .
7+
black --target-version=py36 .
88
flake8
99
npx eslint --ignore-path .gitignore --fix .
1010
npx prettier --ignore-path .gitignore --write $(PRETTIER_TARGETS)
1111

1212
style_check: package-lock.json
1313
isort -c .
14-
black --target-version=py35 --check .
14+
black --target-version=py36 --check .
1515
flake8
1616
npx eslint --ignore-path .gitignore .
1717
npx prettier --ignore-path .gitignore --check $(PRETTIER_TARGETS)
@@ -36,11 +36,11 @@ test_selenium:
3636

3737
coverage:
3838
python --version
39-
coverage erase
4039
DJANGO_SETTINGS_MODULE=tests.settings \
4140
python -b -W always -m coverage run -m django test -v2 $${TEST_ARGS:-tests}
4241
coverage report
4342
coverage html
43+
coverage xml
4444

4545
translatable_strings:
4646
cd debug_toolbar && python -m django makemessages -l en --no-obsolete

0 commit comments

Comments
 (0)