Skip to content

Commit

Permalink
Merge pull request #42 from ambitioninc/chore/django4
Browse files Browse the repository at this point in the history
Django4 compatibility
  • Loading branch information
somewes authored Jun 29, 2023
2 parents d47f30a + e8ca0d7 commit 31a76f6
Show file tree
Hide file tree
Showing 19 changed files with 237 additions and 274 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: django-issue tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master,develop ]

jobs:
tests:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
# python: [ '3.7','3.8','3.9','3.10','3.11' ]
python: [ '3.7','3.8','3.9' ]
# Time to switch to pytest or nose2?
# nosetests is broken on 3.10
# AttributeError: module 'collections' has no attribute 'Callable'
# https://github.com/nose-devs/nose/issues/1099
django:
- 'Django~=3.2.0'
- 'Django~=4.0.0'
- 'Django~=4.1.0'
- 'Django~=4.2.0'
exclude:
- python: '3.7'
django: 'Django~=4.0.0'
- python: '3.7'
django: 'Django~=4.1.0'
- python: '3.7'
django: 'Django~=4.2.0'
services:
postgres:
image: postgres:14.5
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install requirements
run: |
python --version
pip install --upgrade pip wheel setuptools
pip install -r requirements/requirements.txt
pip install -r requirements/requirements-testing.txt
pip install "${{ matrix.django }}"
pip freeze
- name: Run tests
env:
DB_SETTINGS: >-
{
"ENGINE":"django.db.backends.postgresql",
"NAME":"issue",
"USER":"postgres",
"PASSWORD":"postgres",
"HOST":"localhost",
"PORT":"5432"
}
# DB_SETTINGS2: >-
# {
# "ENGINE":"django.db.backends.postgresql",
# "NAME":"issue2",
# "USER":"postgres",
# "PASSWORD":"postgres",
# "HOST":"localhost",
# "PORT":"5432"
# }
run: |
python manage.py check
coverage run manage.py test issue
coverage report --fail-under=90
# continue-on-error: ${{ matrix.experimental }}
- name: Check style
run: flake8 issue
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

7 changes: 7 additions & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Release Notes
=============

v3.5.0
------
* Python 3.8, 3.9
* Django 3.2, 4.0, 4.1, 4.2
* Drop django 2.2
* Drop python 3.6

v3.2.0
------
* Python 3.7
Expand Down
2 changes: 0 additions & 2 deletions issue/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# flake8: noqa
from .version import __version__

default_app_config = 'issue.apps.IssueConfig'
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Generated by Django 3.2.19 on 2023-06-01 20:56

from django.db import models, migrations
import jsonfield.fields
import regex_field.fields
import django.core.serializers.json
from django.db import migrations, models
import django.db.models.deletion
import regex_field.fields


class Migration(migrations.Migration):
replaces = [('issue', '0001_initial'),
('issue', '0002_auto_20180329_1522'),
('issue', '0003_auto_20180402_2126'),
('issue', '0004_auto_20181210_1857')]

dependencies = [
('contenttypes', '0001_initial'),
Expand All @@ -17,100 +20,82 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Assertion',
fields=[
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('check_function', models.TextField()),
('name', models.TextField()),
],
options={
'abstract': False,
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Issue',
fields=[
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.TextField()),
('details', jsonfield.fields.JSONField(null=True, blank=True)),
('details', models.JSONField(blank=True, encoder=django.core.serializers.json.DjangoJSONEncoder, null=True)),
('creation_time', models.DateTimeField(auto_now_add=True)),
('status', models.IntegerField(choices=[(0, 'Open'), (1, 'Resolved'), (2, 'Wont_fix')], default=0)),
('resolved_time', models.DateTimeField(null=True, blank=True)),
('resolved_time', models.DateTimeField(blank=True, null=True)),
],
options={
'abstract': False,
},
bases=(models.Model,),
),
migrations.CreateModel(
name='IssueAction',
fields=[
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
('execution_time', models.DateTimeField(auto_now_add=True)),
('success', models.BooleanField(default=True)),
('details', jsonfield.fields.JSONField(null=True, blank=True)),
('issue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='issue.Issue', related_name='executed_actions')),
],
options={
},
bases=(models.Model,),
),
migrations.CreateModel(
name='ModelAssertion',
fields=[
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('check_function', models.TextField()),
('name', models.TextField()),
('model_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType', related_name='+')),
('model_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.contenttype')),
],
options={
'abstract': False,
},
bases=(models.Model,),
),
migrations.CreateModel(
name='ModelIssue',
fields=[
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
('name', models.TextField()),
('details', jsonfield.fields.JSONField(null=True, blank=True)),
('creation_time', models.DateTimeField(auto_now_add=True)),
('status', models.IntegerField(choices=[(0, 'Open'), (1, 'Resolved'), (2, 'Wont_fix')], default=0)),
('resolved_time', models.DateTimeField(null=True, blank=True)),
('record_id', models.PositiveIntegerField(default=0)),
('record_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, null=True, related_name='+', to='contenttypes.ContentType')),
],
options={
'abstract': False,
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Responder',
fields=[
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('watch_pattern', regex_field.fields.RegexField(max_length=128, null=True)),
],
options={
},
bases=(models.Model,),
),
migrations.CreateModel(
name='ResponderAction',
fields=[
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delay_sec', models.IntegerField()),
('target_function', models.TextField()),
('function_kwargs', jsonfield.fields.JSONField(default={})),
('responder', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='issue.Responder', related_name='actions')),
('function_kwargs', models.JSONField(default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
('responder', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='actions', to='issue.responder')),
],
),
migrations.CreateModel(
name='IssueAction',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('execution_time', models.DateTimeField(auto_now_add=True)),
('success', models.BooleanField(default=True)),
('details', models.JSONField(blank=True, encoder=django.core.serializers.json.DjangoJSONEncoder, null=True)),
('issue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='executed_actions', to='issue.issue')),
('responder_action', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='issue.responderaction')),
],
),
migrations.CreateModel(
name='ModelIssue',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.TextField()),
('details', models.JSONField(blank=True, encoder=django.core.serializers.json.DjangoJSONEncoder, null=True)),
('creation_time', models.DateTimeField(auto_now_add=True)),
('status', models.IntegerField(choices=[(0, 'Open'), (1, 'Resolved'), (2, 'Wont_fix')], default=0)),
('resolved_time', models.DateTimeField(blank=True, null=True)),
('record_id', models.PositiveIntegerField(default=0)),
('record_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.contenttype')),
],
options={
'abstract': False,
},
bases=(models.Model,),
),
migrations.AddField(
model_name='issueaction',
name='responder_action',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='issue.ResponderAction'),
preserve_default=True,
),
]
36 changes: 0 additions & 36 deletions issue/migrations/0002_auto_20180329_1522.py

This file was deleted.

37 changes: 0 additions & 37 deletions issue/migrations/0003_auto_20180402_2126.py

This file was deleted.

20 changes: 0 additions & 20 deletions issue/migrations/0004_auto_20181210_1857.py

This file was deleted.

Loading

0 comments on commit 31a76f6

Please sign in to comment.