Skip to content

Commit

Permalink
Merged master from source (#1)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
6 people authored Dec 4, 2020
1 parent 8ba70f7 commit 300d61e
Show file tree
Hide file tree
Showing 21 changed files with 430 additions and 162 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
tags:
- '*'

jobs:
build:
if: github.repository == 'jazzband/django-debug-toolbar'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

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

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools twine wheel
- name: Build package
run: |
python setup.py --version
python setup.py sdist --format=gztar bdist_wheel
twine check dist/*
- name: Upload packages to Jazzband
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: jazzband
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
repository_url: https://jazzband.co/projects/django-debug-toolbar/upload
222 changes: 222 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
name: Test

on: [push, pull_request]

jobs:
mysql:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']

services:
mariadb:
image: mariadb:10.3
env:
MYSQL_ROOT_PASSWORD: mysql
MYSQL_DATABASE: mysql
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306

steps:
- uses: actions/checkout@v2

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

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ matrix.python-version }}-v1-
- name: Install enchant (only for docs)
run: |
sudo apt-get -qq update
sudo apt-get -y install enchant
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions
- name: Test with tox
run: tox
env:
DB_BACKEND: mysql
DB_NAME: mysql
DB_USER: root
DB_PASSWORD: mysql
DB_HOST: "127.0.0.1"
DB_PORT: "3306"

- name: Upload coverage
uses: codecov/codecov-action@v1
with:
name: Python ${{ matrix.python-version }}

postgres:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']

services:
postgres:
image: 'postgres:9.5'
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2

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

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ matrix.python-version }}-v1-
- name: Install enchant (only for docs)
run: |
sudo apt-get -qq update
sudo apt-get -y install enchant
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions
- name: Test with tox
run: tox
env:
DB_BACKEND: postgresql
DB_NAME: postgres
DB_USER: postgres
DB_PASSWORD: postgres
DB_HOST: localhost
DB_PORT: 5432

- name: Upload coverage
uses: codecov/codecov-action@v1
with:
name: Python ${{ matrix.python-version }}

sqlite:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']

steps:
- uses: actions/checkout@v2

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

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ matrix.python-version }}-v1-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions
- name: Test with tox
run: tox
env:
DB_BACKEND: sqlite3
DB_NAME: ":memory:"

- name: Upload coverage
uses: codecov/codecov-action@v1
with:
name: Python ${{ matrix.python-version }}

lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v2

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

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ matrix.python-version }}-v1-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox
- name: Test with tox
run: tox -e docs,style,readme
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ htmlcov
node_modules
package-lock.json
geckodriver.log
coverage.xml
100 changes: 0 additions & 100 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ PRETTIER_TARGETS = '**/*.(css|js)'

style: package-lock.json
isort .
black --target-version=py35 .
black --target-version=py36 .
flake8
npx eslint --ignore-path .gitignore --fix .
npx prettier --ignore-path .gitignore --write $(PRETTIER_TARGETS)

style_check: package-lock.json
isort -c .
black --target-version=py35 --check .
black --target-version=py36 --check .
flake8
npx eslint --ignore-path .gitignore .
npx prettier --ignore-path .gitignore --check $(PRETTIER_TARGETS)
Expand All @@ -36,11 +36,11 @@ test_selenium:

coverage:
python --version
coverage erase
DJANGO_SETTINGS_MODULE=tests.settings \
python -b -W always -m coverage run -m django test -v2 $${TEST_ARGS:-tests}
coverage report
coverage html
coverage xml

translatable_strings:
cd debug_toolbar && python -m django makemessages -l en --no-obsolete
Expand Down
Loading

0 comments on commit 300d61e

Please sign in to comment.