Skip to content

Commit 6985ccd

Browse files
authored
Merge pull request #6 from ewjoachim/upgrade-project
Redo app boilerplate and add compatibility with Django up to 4.1
2 parents 6f1c1a6 + 62515bd commit 6985ccd

30 files changed

+889
-133
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Closes #<ticket number>
2+
3+
<!-- Please do not remove this, even if you think you don't need it -->
4+
### Successful PR Checklist:
5+
<!-- In case of doubt, we're here to help. CONTRIBUTING.md might help too -->
6+
- [ ] Tests
7+
- [ ] (not applicable?)

.github/release-drafter.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name-template: '$NEXT_PATCH_VERSION'
2+
tag-template: '$NEXT_PATCH_VERSION'
3+
template: |
4+
$CHANGES

.github/renovate.json5

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"extends": [
3+
"config:base",
4+
":enablePreCommit",
5+
],
6+
"lockFileMaintenance": {
7+
"enabled": true,
8+
"automerge": true,
9+
},
10+
"packageRules": [
11+
{
12+
"matchUpdateTypes": [
13+
"major",
14+
],
15+
"groupName": "Deps with major upgrades",
16+
},
17+
{
18+
"matchUpdateTypes": [
19+
"minor",
20+
"patch",
21+
"pin",
22+
"digest",
23+
],
24+
"automerge": true,
25+
"groupName": "Deps with minor upgrades",
26+
},
27+
{
28+
"matchDepTypes": [
29+
"devDependencies",
30+
],
31+
"automerge": true,
32+
"groupName": "Dev dependencies",
33+
},
34+
],
35+
}

.github/workflows/ci.yml

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,69 @@ on:
55
push:
66
branches:
77
- 'master'
8-
8+
9+
concurrency:
10+
group: ${{ github.event_name }}-${{ github.ref }}
11+
912
jobs:
1013
build:
11-
name: "empty"
14+
15+
strategy:
16+
matrix:
17+
include:
18+
19+
- name: Python 3.7 / Django 2.2
20+
python_version: "3.7"
21+
django_version: "2.2.*"
22+
23+
- name: Python 3.8 / Django 3.0
24+
python_version: "3.8"
25+
django_version: "3.0.*"
26+
27+
- name: Python 3.9 / Django 3.1
28+
python_version: "3.9"
29+
django_version: "3.1.*"
30+
31+
- name: Python 3.10 / Django 3.2
32+
python_version: "3.10"
33+
django_version: "3.2.*"
34+
35+
- name: Python 3.10 / Django 4.0
36+
python_version: "3.10"
37+
django_version: "4.0.*"
38+
39+
- name: Python 3.11 / Django 4.1
40+
python_version: "3.11"
41+
django_version: "4.1.*"
42+
43+
name: "py${{ matrix.python_version }}"
1244
runs-on: ubuntu-latest
1345

1446
steps:
15-
- name: Yay
16-
run: "true"
47+
- name: Checkout
48+
uses: actions/checkout@v3
49+
50+
- name: Install poetry
51+
run: pipx install poetry
52+
53+
- name: Set up Python
54+
uses: actions/setup-python@v4
55+
with:
56+
python-version: "${{ matrix.python_version }}"
57+
cache: "poetry"
58+
59+
- name: Configure Poetry to use Python ${{ matrix.python_version }}
60+
run: poetry env use "${{ matrix.python_version }}"
61+
62+
- name: Install deps
63+
run: poetry install
64+
65+
- name: Install deps
66+
run: poetry run pip install django==${{ matrix.django_version }}
67+
68+
- name: Run tests
69+
run: poetry run pytest
70+
1771

1872
report-status:
1973
name: success

.github/workflows/publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
deploy:
10+
name: Publish package to PyPI
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Install poetry
16+
run: |
17+
pipx install poetry
18+
pipx inject poetry 'poetry-dynamic-versioning[plugin]'
19+
20+
- uses: actions/setup-python@v4
21+
with:
22+
python-version: "3"
23+
cache: "poetry"
24+
25+
- name: Install Dev dependencies
26+
run: poetry install
27+
28+
- name: Wait for tests to succeed
29+
uses: fountainhead/[email protected]
30+
id: wait-for-ci
31+
with:
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
checkName: success
34+
35+
- name: Exit if CI did not succeed
36+
if: steps.wait-for-ci.outputs.conclusion != 'success'
37+
run: exit 1
38+
39+
- name: Publish on PyPI
40+
run: poetry publish --no-interaction --build --username "__token__" --password "$PYPI_TOKEN"
41+
env:
42+
PYPI_TOKEN: "${{ secrets.PYPI_TOKEN }}"

.github/workflows/release-drafter.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
update_release_draft:
10+
runs-on: ubuntu-latest
11+
steps:
12+
# Drafts the next Release notes as Pull Requests are merged into "main"
13+
- uses: release-drafter/release-drafter@v5
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.4.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
12+
- repo: https://github.com/psf/black
13+
rev: "22.12.0"
14+
hooks:
15+
- id: black
16+
exclude: "tests/snapshots/"
17+
18+
- repo: https://github.com/PyCQA/isort
19+
rev: "5.11.1"
20+
hooks:
21+
- id: isort
22+
exclude: "tests/snapshots/"
23+
24+
- repo: https://github.com/PyCQA/flake8
25+
rev: "6.0.0"
26+
hooks:
27+
- id: flake8
28+
exclude: "tests/snapshots/"
29+
30+
- repo: https://github.com/asottile/pyupgrade
31+
rev: "v3.3.1"
32+
hooks:
33+
- id: pyupgrade
34+
args: [ --py37-plus ]
35+
exclude: "tests/snapshots/"
36+
37+
- repo: https://github.com/adamchainz/django-upgrade
38+
rev: "1.12.0"
39+
hooks:
40+
- id: django-upgrade
41+
args: [--target-version, "2.2"]
42+
exclude: "tests/snapshots/"
43+
44+
- repo: https://github.com/floatingpurr/sync_with_poetry
45+
rev: 0.4.0
46+
hooks:
47+
- id: sync_with_poetry

.travis.yml

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

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) <year> <copyright holders>
3+
Copyright (c) 2017- Jean-Baptiste Barth - Botify
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
Django Better Migrations
22
========================
33

4-
[![Build Status](https://travis-ci.org/botify-labs/django-better-migrations.svg?branch=master)](https://travis-ci.org/botify-labs/django-better-migrations)
4+
[![Deployed to PyPI](https://img.shields.io/pypi/pyversions/django-better-migrations?logo=pypi&logoColor=white)](https://pypi.org/pypi/django-better-migrations)
5+
[![GitHub Repository](https://img.shields.io/github/stars/botify-labs/django-better-migrations?logo=github)](https://github.com/botify-labs/django-better-migrations/)
6+
[![Continuous Integration](https://img.shields.io/github/actions/workflow/status/botify-labs/django-better-migrations/ci.yml?logo=github)](https://github.com/botify-labs/django-better-migrations/actions?workflow=CI)
7+
[![MIT License](https://img.shields.io/github/license/botify-labs/django-better-migrations?logo=open-source-initiative&logoColor=white)](https://github.com/botify-labs/django-better-migrations/blob/main/LICENSE)
58

69
This project aims at providing improvements to Django's default migration system.
7-
The default migration system is over-engineered, sometimes dangerous, and not
8-
team work friendly.
910

1011

1112
More informations in the documentation, see "docs/" folder.

0 commit comments

Comments
 (0)