Skip to content

Commit

Permalink
Merge branch 'release/2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
domdinicola committed Feb 25, 2022
2 parents 88e3a20 + 8672ac9 commit 72666d2
Show file tree
Hide file tree
Showing 66 changed files with 325 additions and 557 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Test

on:
push:
branches:
- master
- develop
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2

- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Lint with flake8
run: |
tox -e lint
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10"]
django-version: [ "2.2", "3.2", "4.0"]
db-engine: ["pg", "mysql"]
env:
PY_VER: ${{ matrix.python-version}}
DJ_VER: ${{ matrix.django-version}}
DBENGINE: ${{ matrix.db-engine}}
MYSQL_USER: 'root'
MYSQL_PASSWORD: 'root'

services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: concurrency
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

# mysql:
# image: mysql:5.7
# env:
# MYSQL_DATABASE: test_db
# MYSQL_USER: user
# MYSQL_PASSWORD: password
# MYSQL_ROOT_PASSWORD: rootpassword
# ports:
# - 33306:3306
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5

steps:
- uses: actions/checkout@v2

- name: Setup MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE concurrency;' -uroot -proot
mysql -e 'SHOW DATABASES;' -uroot -proot
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: python -m pip install --upgrade pip tox

- name: Test with
run: tox -e d${DJ_VER//.}-py${PY_VER//.}-${DBENGINE}

- uses: codecov/codecov-action@v1
with:
verbose: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ __pycache__
Pipfile.lock
poetry.lock
pyproject.toml
.venv/
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Release 2.4
-----------
* add support Django 4
* add support Python 3.10


Release 2.3
-----------
* Removes code producing DeprecationError
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ test:

lint:
pre-commit run --all-files
pipenv run isort -rc src/ --check-only
pipenv run check-manifest

travis:
docker run --privileged --name travis-debug -it -u travis travisci/ci-amethyst:packer-1512508255-986baf0 /bin/bash -l
Expand All @@ -48,6 +46,7 @@ fullclean:

docs: .mkbuilddir
mkdir -p ${BUILDDIR}/docs
rm -fr ${BUILDDIR}/docs/*
sphinx-build -aE docs/ ${BUILDDIR}/docs
ifdef BROWSE
firefox ${BUILDDIR}/docs/index.html
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ sphinx-issues = "*"
twine="*"

[requires]
python_version = "3.6"
python_version = "3.8"
6 changes: 0 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ Django Concurrency

django-concurrency is an optimistic lock [1]_ implementation for Django.

Supported Django versions:

- <=2.1.1 supports 1.11.x, 2.1.x, 2.2.x, 3.x
- >=2.2 supports 3.x


It prevents users from doing concurrent editing in Django both from UI and from a
django command.

Expand Down
2 changes: 1 addition & 1 deletion docs/_ext/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from docutils.parsers.rst import Directive, directives
from sphinx import addnodes, roles
from sphinx.errors import ExtensionError
from sphinx.util.console import bold
# RE for option descriptions without a '--' prefix
from sphinx.writers.html import HTMLTranslator
from sphinx.errors import ExtensionError

simple_option_desc_re = re.compile(
r'([-_a-zA-Z0-9]+)(\s*.*?)(?=,\s+(?:/|-|--)|$)')
Expand Down
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ examples
@disable_concurrency()
def recover_view(self, request, version_id, extra_context=None):
return super(ReversionConcurrentModelAdmin, self).recover_view(request,
return super().recover_view(request,
version_id,
extra_context)
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
import os
import sys

Expand Down
6 changes: 2 additions & 4 deletions docs/cookbook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,8 @@ To avoid this simply disable concurrency, by using a mixin:
@disable_concurrency()
def revision_view(self, request, object_id, version_id, extra_context=None):
return super(ConcurrencyVersionAdmin, self).revision_view(
request, object_id, version_id, extra_context=None)
return super().revision_view(request, object_id, version_id, extra_context=None)
@disable_concurrency()
def recover_view(self, request, version_id, extra_context=None):
return super(ConcurrencyVersionAdmin, self).recover_view(
request, version_id, extra_context)
return super().recover_view(request, version_id, extra_context)
2 changes: 1 addition & 1 deletion docs/middleware.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Each time a :class:`RecordModifiedError <concurrency.exceptions.RecordModifiedEr
</tr>
</table>

If you want to use ConcurrentMiddleware in the admin and you are using
If you want to use ConcurrencyMiddleware in the admin and you are using
:class:`concurrency.admin.ConcurrentModelAdmin` remember to set your ModelAdmin to NOT
use :class:`concurrency.forms.ConcurrentForm`

Expand Down
1 change: 1 addition & 0 deletions docs/requirements.pip
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
sphinx==3.5.2
django==3.1
sphinx_issues
3 changes: 0 additions & 3 deletions docs/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,3 @@ Default::


dict to customise :ref:`TriggerFactory`. Use this to customise the SQL clause to create triggers.



24 changes: 11 additions & 13 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
[isort]
line_length=90
combine_as_imports = true
multi_line_output = 5
default_section = FIRSTPARTY
indent=' '

known_future_library=
known_standard_library=six
known_third_party=django
known_first_party=demo

known_concurrency=concurrency
sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,CONCURRENCY,LOCALFOLDER
default_section = THIRDPARTY
include_trailing_comma = true
line_length = 80
known_future_library = future,pies
known_standard_library =
known_third_party = django
known_first_party = sos
multi_line_output = 0
balanced_wrapping = true
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER

[flake8]
max-complexity = 12
max-line-length = 160
exclude = .tox,migrations,.git,docs,diff_match_patch.py, deploy/**,settings
ignore = E501,E401,W391,E128,E261,E731
ignore = E501,E401,W391,E128,E261,E731,W504

[aliases]
test=pytest
Expand Down
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ def finalize_options(self):

def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
import sys

import pytest

sys.path.insert(0, os.path.join(ROOT, 'tests', 'demoapp'))
errno = pytest.main(self.test_args)
sys.exit(errno)
Expand Down Expand Up @@ -59,10 +60,12 @@ def run_tests(self):
'Programming Language :: Python',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: Software Development :: Libraries :: Python Modules',
],
Expand Down
2 changes: 1 addition & 1 deletion src/concurrency/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = 'sax'
default_app_config = 'concurrency.apps.ConcurrencyConfig'

VERSION = __version__ = "2.3"
VERSION = __version__ = "2.4"
NAME = 'django-concurrency'
Loading

0 comments on commit 72666d2

Please sign in to comment.