Skip to content

Commit a483db2

Browse files
committed
2 parents 2d5339d + 0e128f9 commit a483db2

File tree

130 files changed

+4454
-1374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+4454
-1374
lines changed

.github/FUNDING.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
github: [fabiocaccamo]
2+
ko_fi: fabiocaccamo
3+
liberapay: fabiocaccamo
4+
tidelift: pypi/django-admin-interface
5+
custom: ["https://www.buymeacoffee.com/fabiocaccamo", "https://www.paypal.me/fabiocaccamo"]

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@ labels: enhancement
66
assignees: fabiocaccamo
77

88
---
9-
10-

.github/dependabot.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
version: 2
22
updates:
3+
34
- package-ecosystem: "pip"
45
directory: "/"
56
schedule:
6-
interval: "weekly"
7+
interval: "weekly"
8+
day: "friday"
9+
open-pull-requests-limit: 100
10+
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
day: "friday"
16+
open-pull-requests-limit: 100

.github/pull_request_template.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Pull request
3+
about: Submit a pull request for this project
4+
assignees: fabiocaccamo
5+
6+
---
7+
8+
**Describe your changes**
9+
?
10+
11+
**Related issue**
12+
?
13+
14+
**Checklist before requesting a review**
15+
- [ ] I have performed a self-review of my code.
16+
- [ ] I have added tests for the proposed changes.
17+
- [ ] I have run the tests and there are not errors.

.github/workflows/codeql-analysis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ master ]
16+
branches: [ main ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ master ]
19+
branches: [ main ]
2020
schedule:
2121
- cron: '26 21 * * 0'
2222

@@ -39,11 +39,11 @@ jobs:
3939

4040
steps:
4141
- name: Checkout repository
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@v3
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
46+
uses: github/codeql-action/init@v2
4747
with:
4848
languages: ${{ matrix.language }}
4949
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,7 +54,7 @@ jobs:
5454
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5555
# If this step fails, then you should remove it and run the build manually (see below)
5656
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v1
57+
uses: github/codeql-action/autobuild@v2
5858

5959
# ℹ️ Command-line programs to run using the OS shell.
6060
# 📚 https://git.io/JvXDl
@@ -68,4 +68,4 @@ jobs:
6868
# make release
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v1
71+
uses: github/codeql-action/analyze@v2

.github/workflows/create-release.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1515

1616
- name: Extract release notes
1717
id: extract-release-notes
@@ -22,3 +22,21 @@ jobs:
2222
with:
2323
body: ${{ steps.extract-release-notes.outputs.release_notes }}
2424
token: ${{ secrets.WORKFLOWS_CREATE_RELEASE_TOKEN }}
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: '3.x'
30+
cache: 'pip'
31+
32+
- name: Build Package
33+
run: |
34+
pip install pip --upgrade
35+
pip install build
36+
python -m build
37+
38+
- name: Publish on PyPI
39+
uses: pypa/gh-action-pypi-publish@release/v1
40+
with:
41+
packages_dir: dist/
42+
password: ${{ secrets.WORKFLOWS_PUBLISH_TO_PYPI_TOKEN }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Pre-commit auto-update
2+
3+
on:
4+
# every day at midnight
5+
schedule:
6+
- cron: "0 0 * * *"
7+
# on demand
8+
workflow_dispatch:
9+
10+
jobs:
11+
auto-update:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.x'
18+
- uses: browniebroke/pre-commit-autoupdate-action@main
19+
- uses: peter-evans/create-pull-request@v5
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
branch: update/pre-commit-hooks
23+
title: Update pre-commit hooks
24+
commit-message: "Update pre-commit hooks."
25+
body: Update versions of pre-commit hooks to latest version.

.github/workflows/test-package.yml

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,60 @@ on:
88
jobs:
99

1010
prepare:
11-
12-
runs-on: ubuntu-latest
11+
12+
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout code
15-
uses: actions/checkout@v2
16-
15+
uses: actions/checkout@v3
16+
1717
- name: Create matrix
18-
uses: fabiocaccamo/create-matrix-action@v2
18+
uses: fabiocaccamo/create-matrix-action@v3
1919
id: create_matrix
2020
with:
2121
matrix: |
22-
python-version {2.7}, django-version {1.8,1.9,1.10,1.11}, database {sqlite,postgres}
23-
python-version {3.6}, django-version {1.8,1.9,1.10,1.11,2.0,2.1,2.2,3.0,3.1,3.2}, database {sqlite,postgres}
24-
python-version {3.7}, django-version {2.0,2.1,2.2,3.0,3.1,3.2}, database {sqlite,postgres}
25-
python-version {3.8}, django-version {2.2,3.0,3.1,3.2}, database {sqlite,postgres}
26-
python-version {3.9}, django-version {2.2,3.0,3.1,3.2}, database {sqlite,postgres}
27-
python-version {3.10}, django-version {3.2,4.0}, database {sqlite,postgres}
28-
22+
python-version {3.8}, django-version {3.0, 3.1, 3.2, 4.0, 4.1, 4.2}, database {sqlite, postgres}
23+
python-version {3.9}, django-version {3.0, 3.1, 3.2, 4.0, 4.1, 4.2}, database {sqlite, postgres}
24+
python-version {3.10}, django-version {3.2, 4.0, 4.1, 4.2}, database {sqlite, postgres}
25+
python-version {3.11}, django-version {4.1, 4.2}, database {sqlite, postgres}
26+
2927
outputs:
3028
matrix: ${{ steps.create_matrix.outputs.matrix }}
31-
29+
30+
31+
lint:
32+
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v3
37+
38+
- name: Set up Python
39+
uses: actions/setup-python@v2
40+
with:
41+
cache: 'pip'
42+
43+
- name: Install tools needed
44+
run: |
45+
sudo apt install gettext
46+
python -m pip install --upgrade pip
47+
pip install tox
48+
49+
- name: Check migrations
50+
run: |
51+
tox -e migrations
52+
53+
- name: Check translations
54+
run: |
55+
tox -e translations
56+
57+
3258
test:
33-
34-
needs: prepare
59+
60+
needs: [prepare]
3561
runs-on: ubuntu-latest
3662
strategy:
3763
fail-fast: false
38-
matrix:
64+
matrix:
3965
include: ${{fromJson(needs.prepare.outputs.matrix)}}
4066

4167
services:
@@ -52,42 +78,42 @@ jobs:
5278

5379
steps:
5480

55-
- uses: actions/checkout@v2
81+
- uses: actions/checkout@v3
5682

5783
- name: Install psycopg2 prerequisites
58-
run: sudo apt-get install libpq-dev
84+
run: sudo apt install libpq-dev
5985

6086
- name: Set up Python ${{ matrix.python-version }}
6187
uses: actions/setup-python@v2
6288
with:
6389
python-version: ${{ matrix.python-version }}
6490
cache: 'pip'
65-
91+
6692
- name: Upgrade pip version
6793
run: |
6894
pip install pip --upgrade
69-
95+
7096
- name: Install django
7197
run: |
72-
pip install "Django ~= ${{ matrix.django-version }}"
73-
98+
pip install "Django == ${{ matrix.django-version }}.*"
99+
74100
- name: Install requirements
75101
run: |
76102
pip install -r requirements.txt
77103
pip install -r requirements-test.txt
78-
104+
79105
- name: Run tests
80-
env:
106+
env:
81107
DATABASE_ENGINE: ${{ matrix.database }}
82108
run: |
83-
coverage run --append --source=admin_interface setup.py test
109+
coverage run --append --source=admin_interface runtests.py
110+
coverage report --show-missing
84111
coverage xml -o ./coverage.xml
85-
112+
86113
- name: Upload coverage to Codecov
87-
uses: codecov/codecov-action@v2
114+
uses: codecov/codecov-action@v3
88115
with:
89116
fail_ci_if_error: false
90117
files: ./coverage.xml
91118
flags: unittests
92119
verbose: true
93-

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ __pycache__/
55
# C extensions
66
*.so
77

8+
## Local setup
9+
.vscode/
10+
.venv/
11+
812
# Distribution / packaging
913
.Python
1014
env/

.pre-commit-config.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
5+
- repo: https://github.com/asottile/pyupgrade
6+
rev: v3.9.0
7+
hooks:
8+
- id: pyupgrade
9+
args: ["--py38-plus"]
10+
11+
- repo: https://github.com/adamchainz/django-upgrade
12+
rev: 1.14.0
13+
hooks:
14+
- id: django-upgrade
15+
args: ["--target-version", "3.0"]
16+
17+
- repo: https://github.com/astral-sh/ruff-pre-commit
18+
rev: v0.0.278
19+
hooks:
20+
- id: ruff
21+
args: [--fix, --exit-non-zero-on-fix]
22+
23+
- repo: https://github.com/pycqa/isort
24+
rev: 5.12.0
25+
hooks:
26+
- id: isort
27+
args: ["--profile", "black"]
28+
29+
- repo: https://github.com/psf/black
30+
rev: 23.7.0
31+
hooks:
32+
- id: black
33+
34+
- repo: https://github.com/pre-commit/pre-commit-hooks
35+
rev: v4.4.0
36+
hooks:
37+
- id: fix-encoding-pragma
38+
args: [--remove]
39+
- id: trailing-whitespace
40+
- id: end-of-file-fixer
41+
- id: check-yaml
42+
- id: check-added-large-files

0 commit comments

Comments
 (0)