Skip to content

Commit 273853b

Browse files
committed
Add Django 4,1, remove Python<3.8, Django<3.2
1 parent ebb257e commit 273853b

File tree

5 files changed

+164
-163
lines changed

5 files changed

+164
-163
lines changed

.github/workflows/test.yml

+141-145
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
fail-fast: false
1010
max-parallel: 5
1111
matrix:
12-
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
12+
python-version: ["3.8", "3.9", "3.10"]
1313

1414
services:
1515
mariadb:
@@ -22,56 +22,55 @@ jobs:
2222
--health-timeout 5s
2323
--health-retries 5
2424
ports:
25-
- 3306:3306
25+
- 3306:3306
2626

2727
steps:
28-
- uses: actions/checkout@v2
29-
30-
- name: Set up Python ${{ matrix.python-version }}
31-
uses: actions/setup-python@v2
32-
with:
33-
python-version: ${{ matrix.python-version }}
34-
35-
- name: Get pip cache dir
36-
id: pip-cache
37-
run: |
38-
echo "::set-output name=dir::$(pip cache dir)"
39-
40-
- name: Cache
41-
uses: actions/cache@v2
42-
with:
43-
path: ${{ steps.pip-cache.outputs.dir }}
44-
key:
45-
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
46-
restore-keys: |
47-
${{ matrix.python-version }}-v1-
48-
49-
- name: Install dependencies
50-
run: |
51-
python -m pip install --upgrade pip
52-
python -m pip install --upgrade tox tox-gh-actions
53-
54-
- name: Test with tox
55-
run: tox
56-
env:
57-
DB_BACKEND: mysql
58-
DB_USER: root
59-
DB_PASSWORD: tree_queries
60-
DB_HOST: 127.0.0.1
61-
DB_PORT: 3306
62-
63-
- name: Upload coverage
64-
uses: codecov/codecov-action@v1
65-
with:
66-
name: Python ${{ matrix.python-version }}
28+
- uses: actions/checkout@v2
29+
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v2
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Get pip cache dir
36+
id: pip-cache
37+
run: |
38+
echo "::set-output name=dir::$(pip cache dir)"
39+
40+
- name: Cache
41+
uses: actions/cache@v2
42+
with:
43+
path: ${{ steps.pip-cache.outputs.dir }}
44+
key: ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
45+
restore-keys: |
46+
${{ matrix.python-version }}-v1-
47+
48+
- name: Install dependencies
49+
run: |
50+
python -m pip install --upgrade pip
51+
python -m pip install --upgrade tox tox-gh-actions
52+
53+
- name: Test with tox
54+
run: tox
55+
env:
56+
DB_BACKEND: mysql
57+
DB_USER: root
58+
DB_PASSWORD: tree_queries
59+
DB_HOST: 127.0.0.1
60+
DB_PORT: 3306
61+
62+
- name: Upload coverage
63+
uses: codecov/codecov-action@v1
64+
with:
65+
name: Python ${{ matrix.python-version }}
6766

6867
postgres:
6968
runs-on: ubuntu-latest
7069
strategy:
7170
fail-fast: false
7271
max-parallel: 5
7372
matrix:
74-
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
73+
python-version: ["3.8", "3.9", "3.10"]
7574

7675
services:
7776
postgres:
@@ -81,129 +80,126 @@ jobs:
8180
POSTGRES_USER: tree_queries
8281
POSTGRES_PASSWORD: tree_queries
8382
ports:
84-
- 5432:5432
83+
- 5432:5432
8584
options: >-
8685
--health-cmd pg_isready
8786
--health-interval 10s
8887
--health-timeout 5s
8988
--health-retries 5
9089
9190
steps:
92-
- uses: actions/checkout@v2
93-
94-
- name: Set up Python ${{ matrix.python-version }}
95-
uses: actions/setup-python@v2
96-
with:
97-
python-version: ${{ matrix.python-version }}
98-
99-
- name: Get pip cache dir
100-
id: pip-cache
101-
run: |
102-
echo "::set-output name=dir::$(pip cache dir)"
103-
104-
- name: Cache
105-
uses: actions/cache@v2
106-
with:
107-
path: ${{ steps.pip-cache.outputs.dir }}
108-
key:
109-
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
110-
restore-keys: |
111-
${{ matrix.python-version }}-v1-
112-
113-
- name: Install dependencies
114-
run: |
115-
python -m pip install --upgrade pip
116-
python -m pip install --upgrade tox tox-gh-actions
117-
118-
- name: Test with tox
119-
run: tox
120-
env:
121-
DB_BACKEND: postgresql
122-
DB_HOST: localhost
123-
DB_PORT: 5432
124-
125-
- name: Upload coverage
126-
uses: codecov/codecov-action@v1
127-
with:
128-
name: Python ${{ matrix.python-version }}
91+
- uses: actions/checkout@v2
92+
93+
- name: Set up Python ${{ matrix.python-version }}
94+
uses: actions/setup-python@v2
95+
with:
96+
python-version: ${{ matrix.python-version }}
97+
98+
- name: Get pip cache dir
99+
id: pip-cache
100+
run: |
101+
echo "::set-output name=dir::$(pip cache dir)"
102+
103+
- name: Cache
104+
uses: actions/cache@v2
105+
with:
106+
path: ${{ steps.pip-cache.outputs.dir }}
107+
key: ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
108+
restore-keys: |
109+
${{ matrix.python-version }}-v1-
110+
111+
- name: Install dependencies
112+
run: |
113+
python -m pip install --upgrade pip
114+
python -m pip install --upgrade tox tox-gh-actions
115+
116+
- name: Test with tox
117+
run: tox
118+
env:
119+
DB_BACKEND: postgresql
120+
DB_HOST: localhost
121+
DB_PORT: 5432
122+
123+
- name: Upload coverage
124+
uses: codecov/codecov-action@v1
125+
with:
126+
name: Python ${{ matrix.python-version }}
129127

130128
sqlite:
131129
runs-on: ubuntu-latest
132130
strategy:
133131
fail-fast: false
134132
max-parallel: 5
135133
matrix:
136-
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
134+
python-version: ["3.8", "3.9", "3.10"]
137135

138136
steps:
139-
- uses: actions/checkout@v2
140-
141-
- name: Set up Python ${{ matrix.python-version }}
142-
uses: actions/setup-python@v2
143-
with:
144-
python-version: ${{ matrix.python-version }}
145-
146-
- name: Get pip cache dir
147-
id: pip-cache
148-
run: |
149-
echo "::set-output name=dir::$(pip cache dir)"
150-
151-
- name: Cache
152-
uses: actions/cache@v2
153-
with:
154-
path: ${{ steps.pip-cache.outputs.dir }}
155-
key:
156-
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
157-
restore-keys: |
158-
${{ matrix.python-version }}-v1-
159-
160-
- name: Install dependencies
161-
run: |
162-
python -m pip install --upgrade pip
163-
python -m pip install --upgrade tox tox-gh-actions
164-
165-
- name: Test with tox
166-
run: tox
167-
env:
168-
DB_BACKEND: sqlite3
169-
DB_NAME: ":memory:"
170-
171-
- name: Upload coverage
172-
uses: codecov/codecov-action@v1
173-
with:
174-
name: Python ${{ matrix.python-version }}
137+
- uses: actions/checkout@v2
138+
139+
- name: Set up Python ${{ matrix.python-version }}
140+
uses: actions/setup-python@v2
141+
with:
142+
python-version: ${{ matrix.python-version }}
143+
144+
- name: Get pip cache dir
145+
id: pip-cache
146+
run: |
147+
echo "::set-output name=dir::$(pip cache dir)"
148+
149+
- name: Cache
150+
uses: actions/cache@v2
151+
with:
152+
path: ${{ steps.pip-cache.outputs.dir }}
153+
key: ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
154+
restore-keys: |
155+
${{ matrix.python-version }}-v1-
156+
157+
- name: Install dependencies
158+
run: |
159+
python -m pip install --upgrade pip
160+
python -m pip install --upgrade tox tox-gh-actions
161+
162+
- name: Test with tox
163+
run: tox
164+
env:
165+
DB_BACKEND: sqlite3
166+
DB_NAME: ":memory:"
167+
168+
- name: Upload coverage
169+
uses: codecov/codecov-action@v1
170+
with:
171+
name: Python ${{ matrix.python-version }}
175172

176173
lint:
177174
runs-on: ubuntu-latest
178175
strategy:
179176
fail-fast: false
180177

181178
steps:
182-
- uses: actions/checkout@v2
183-
184-
- name: Set up Python ${{ matrix.python-version }}
185-
uses: actions/setup-python@v2
186-
with:
187-
python-version: 3.8
188-
189-
- name: Get pip cache dir
190-
id: pip-cache
191-
run: |
192-
echo "::set-output name=dir::$(pip cache dir)"
193-
194-
- name: Cache
195-
uses: actions/cache@v2
196-
with:
197-
path: ${{ steps.pip-cache.outputs.dir }}
198-
key:
199-
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
200-
restore-keys: |
201-
${{ matrix.python-version }}-v1-
202-
203-
- name: Install dependencies
204-
run: |
205-
python -m pip install --upgrade pip
206-
python -m pip install --upgrade tox
207-
208-
- name: Test with tox
209-
run: tox -e readme
179+
- uses: actions/checkout@v2
180+
181+
- name: Set up Python ${{ matrix.python-version }}
182+
uses: actions/setup-python@v2
183+
with:
184+
python-version: 3.8
185+
186+
- name: Get pip cache dir
187+
id: pip-cache
188+
run: |
189+
echo "::set-output name=dir::$(pip cache dir)"
190+
191+
- name: Cache
192+
uses: actions/cache@v2
193+
with:
194+
path: ${{ steps.pip-cache.outputs.dir }}
195+
key: ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
196+
restore-keys: |
197+
${{ matrix.python-version }}-v1-
198+
199+
- name: Install dependencies
200+
run: |
201+
python -m pip install --upgrade pip
202+
python -m pip install --upgrade tox
203+
204+
- name: Test with tox
205+
run: tox -e readme

.pre-commit-config.yaml

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
exclude: ".yarn/|yarn.lock|\\.min\\.(css|js)$"
12
repos:
23
- repo: https://github.com/pre-commit/pre-commit-hooks
34
rev: v4.3.0
@@ -7,26 +8,32 @@ repos:
78
- id: end-of-file-fixer
89
- id: trailing-whitespace
910
- repo: https://github.com/asottile/pyupgrade
10-
rev: v2.34.0
11+
rev: v2.37.3
1112
hooks:
1213
- id: pyupgrade
13-
args: [--py36-plus]
14+
args: [--py38-plus]
1415
- repo: https://github.com/adamchainz/django-upgrade
15-
rev: 1.7.0
16+
rev: 1.8.0
1617
hooks:
1718
- id: django-upgrade
18-
args: [--target-version, "2.2"]
19+
args: [--target-version, "3.2"]
1920
- repo: https://github.com/pycqa/isort
2021
rev: 5.10.1
2122
hooks:
2223
- id: isort
2324
args: [--profile=black, --lines-after-imports=2, --combine-as]
2425
- repo: https://github.com/psf/black
25-
rev: 22.3.0
26+
rev: 22.6.0
2627
hooks:
2728
- id: black
2829
- repo: https://github.com/pycqa/flake8
29-
rev: 4.0.1
30+
rev: 5.0.4
3031
hooks:
3132
- id: flake8
3233
args: ["--ignore=E203,E501,W503"]
34+
- repo: https://github.com/pre-commit/mirrors-prettier
35+
rev: v2.7.1
36+
hooks:
37+
- id: prettier
38+
args: [--list-different, --no-semi]
39+
exclude: "^conf/|.*\\.html$"

CHANGELOG.rst

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Change log
66

77
.. _Next version: https://github.com/matthiask/django-tree-queries/compare/0.11...main
88

9+
- Removed compatibility with Django < 3.2, Python < 3.8.
10+
- Added Django 4.1 to the CI.
11+
912

1013
`0.11`_ (2022-06-10)
1114
~~~~~~~~~~~~~~~~~~~~

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
copyright = f"2018-{date.today().year}, {author}"
1313
version = __import__("tree_queries").__version__
1414
release = subprocess.check_output(
15-
"git fetch --tags; git describe", shell=True, universal_newlines=True
15+
"git fetch --tags; git describe", shell=True, text=True
1616
).strip()
1717
language = "en"
1818

0 commit comments

Comments
 (0)