Skip to content

Commit

Permalink
Update django and python, add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
csizmaziakiki committed Dec 12, 2023
1 parent a385030 commit 0d83cd7
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 140 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Python package

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
django-version: ['3.2', '4.0', '4.1', '4.2']
services:
postgres:
image: postgres:12
ports:
- 5432:5432
options: >-
--health-cmd=pg_isready
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
POSTGRES_DB: testdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
mysql:
image: mysql:8
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
MYSQL_USER: travis
MYSQL_PASSWORD: travis
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: test_testdb
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Test versions Python ${{ matrix.python-version }} Django ${{ matrix.django-version }}
shell: bash
run: |
if [[ "${{ matrix.python-version }}" == "3.11" && "${{ matrix.django-version }}" == "3.2" ]]; then
echo "Skipping unsupported Python/Django combination"
exit 0
elif [[ "${{ matrix.python-version }}" == "3.11" && "${{ matrix.django-version }}" == "4.0" ]]; then
echo "Skipping unsupported Python/Django combination"
exit 0
fi
pip install Django==${{ matrix.django-version }} mysqlclient psycopg2
pip install flake8 pylint pytest pytest-django
pip install -e .
python setup.py test
./lint.sh
114 changes: 0 additions & 114 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ Contributors
| `Dylan Verheul <http://github.com/dyve>`_
| `Grant McConnaughey <http://github.com/grantmcconnaughey>`_
| `Luke Burden <http://github.com/lukeburden>`_
| `James Addison <http://github.com/jaddison>`_
| `James Addison <http://github.com/jaddison>`_
| `Krisztian Csizmazia <http://github.com/csizmaziakiki>`_
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

3.4.0
--------------------
- Add support for Python 3.8 - 3.11
- Add support for Django 4.1 and 4.2
- Remove support for old Django versions
- Remove support for old Python versions

3.3.0
--------------------
- Django 3.x support
Expand Down
6 changes: 1 addition & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
django-livefield
================

.. image:: https://travis-ci.org/hearsaycorp/django-livefield.svg
:alt: Build Status
:target: https://travis-ci.org/hearsaycorp/django-livefield

=====
About
=====
Expand Down Expand Up @@ -57,6 +53,6 @@ Pull requests welcome! To save everyone some hassle, please open an
issue first so we can discuss your proposed change.

In your PR, be sure to add your name to AUTHORS.txt and include some
tests for your spiffy new functionality. Travis CI will green-light your
tests for your spiffy new functionality. CI will green-light your
build once it passes the unit tests (``./setup.py test``) and our
linters (``./lint.sh``).
24 changes: 10 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


install_requires = (
'Django>=1.11,<4',
'Django>=3.2,<4.3',
)


Expand Down Expand Up @@ -67,26 +67,22 @@ def run_tests(self):

setup(
name='django-livefield',
version='3.3.0',
version='3.4.0',
description='Convenient soft-deletion support for Django models',
long_description=(
open('README.rst').read() + '\n\n' +
open('CHANGELOG.rst').read() + '\n\n' +
open('AUTHORS.rst').read()),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Framework :: Django',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.1',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Framework :: Django :: 4.1',
'Framework :: Django :: 4.2',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
keywords='python django soft-delete',
url='https://github.com/hearsaycorp/django-livefield',
Expand Down
7 changes: 1 addition & 6 deletions src/livefield/fields.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import django
from django.db import models

if django.VERSION < (2, 1):
BooleanField = models.NullBooleanField
else:
BooleanField = models.BooleanField


class LiveField(BooleanField):
class LiveField(models.BooleanField):
"""Support uniqueness constraints and soft-deletion.
Similar to a BooleanField, but stores False as NULL. This lets us use
Expand Down

0 comments on commit 0d83cd7

Please sign in to comment.