Skip to content

Commit 4cca173

Browse files
committed
Merge branch 'release/2.0'
* release/2.0: (34 commits) updates tox/travis config updates tox/travis config update version / CHANGES updates Makefile Update cookbook section with django-reversion Removes unused links from README updaets travis list and pre-commit support restores support django>=1.10 update CHANGES and bump version trying to fix travis config trying to fix travis config update travis config fixes type in 'triggers' management commant update travis config fixes support for django 2.1 updates travis config to use postgres 9.4 code clean official support only for python3 and Django>2.0 add start()/finish() to disable_concurrency() ...
2 parents 491b761 + c8849b2 commit 4cca173

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+470
-593
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ __pycache__
2323
*.egg-info
2424
*.sqlite
2525
.testmondata
26+
Pipfile.lock

.pre-commit-config.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
exclude: '^$'
2+
fail_fast: false
3+
repos:
4+
- repo: local
5+
hooks:
6+
- id: isort
7+
args:
8+
- -rc
9+
- src/
10+
- tests/
11+
name: isort
12+
entry: isort
13+
language: system
14+
types: [python]
15+
- id: check-manifest
16+
name: check-manifest
17+
entry: check-manifest
18+
language: system
19+
types: [python]
20+
files: '^$'
21+
always_run: true
22+
23+
- repo: git://github.com/pre-commit/pre-commit-hooks
24+
rev: v1.4.0
25+
hooks:
26+
- id: debug-statements
27+
exclude: manage.py
28+
- id: end-of-file-fixer
29+
- id: flake8
30+
exclude: docs/
31+
args:
32+
- src/
33+
- tests/
34+
- id: check-merge-conflict
35+
- id: check-case-conflict
36+
# - id: name-tests-test
37+
# - id: trailing-whitespace
38+
# - id: requirements-txt-fixer
39+
# files: requirements-dev.txt
40+
#- repo: git://github.com/asottile/reorder_python_imports
41+
# rev: v1.0.1
42+
# hooks:
43+
# - id: reorder-python-imports

.travis.yml

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
language: python
2-
sudo: false
2+
sudo: true
33
python:
4-
- 2.7
5-
- 3.4
64
- 3.5
75
- 3.6
86

7+
addons:
8+
postgresql: "9.4"
99

1010
cache:
1111
directories:
@@ -15,35 +15,55 @@ services:
1515
- MySQL
1616
- PostgreSQL
1717

18+
jobs:
19+
include:
20+
- python: 3.7
21+
env: TRAVIS_PYTHON_VERSION=3.7 DJANGO=2.0 DB=mysql
22+
sudo: required
23+
dist: xenial
24+
25+
- python: 3.7
26+
env: TRAVIS_PYTHON_VERSION=3.7 DJANGO=2.1 DB=pg
27+
sudo: required
28+
dist: xenial
29+
30+
- python: 3.7
31+
env: TRAVIS_PYTHON_VERSION=3.7 DJANGO=2.0 DB=mysql
32+
sudo: required
33+
dist: xenial
34+
35+
- python: 3.7
36+
env: TRAVIS_PYTHON_VERSION=3.7 DJANGO=2.1 DB=pg
37+
sudo: required
38+
dist: xenial
39+
40+
1841
env:
19-
- DJANGO=1.8 DB=pg
20-
- DJANGO=1.9 DB=pg
21-
- DJANGO=1.10 DB=pg
2242
- DJANGO=1.11 DB=pg
43+
- DJANGO=2.0 DB=pg
44+
- DJANGO=2.1 DB=pg
2345

24-
- DJANGO=1.8 DB=mysql
25-
- DJANGO=1.9 DB=mysql
26-
- DJANGO=1.10 DB=mysql
2746
- DJANGO=1.11 DB=mysql
47+
- DJANGO=2.0 DB=mysql
48+
- DJANGO=2.1 DB=mysql
2849

2950

3051
matrix:
3152
exclude:
3253
- python: 2.7
33-
env: DJANGO=2.0
54+
env: DJANGO=2.0 DB=pg
3455

35-
- python: 3.4
36-
env: DJANGO=2.0
56+
- python: 2.7
57+
env: DJANGO=2.0 DB=mysql
58+
59+
- python: 2.7
60+
env: DJANGO=2.1 DB=pg
3761

38-
- python: 3.6
39-
env: DJANGO=1.8
40-
- python: 3.6
41-
env: DJANGO=1.9
42-
- python: 3.6
43-
env: DJANGO=1.10
62+
- python: 2.7
63+
env: DJANGO=2.1 DB=mysql
4464

4565
install:
46-
- pip install tox "coverage<=4.0" python-coveralls>=2.5 coveralls>=0.5 codecov
66+
- pip install tox "coverage<=4.0" codecov
4767

4868
script:
4969
- tox -e "py${TRAVIS_PYTHON_VERSION//.}-d${DJANGO//.}-${DB}" -- py.test tests -v

.tx/config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ source_lang = en
66
[main]
77
host = https://www.transifex.com
88
type = PO
9-

AUTHORS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Stefano Apostolico <[email protected]>
1+
Stefano Apostolico <[email protected]>

CHANGES

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
Release 1.4
1+
Release 2.0
22
-----------
3+
* drop official support to Django < 1.10
4+
* add support Django 2.1
5+
* removed deprecated api `concurrency_check`
6+
* BACKWARD INCOMPATIBLE: version field is now mandatory in any save operation. Use ``VERSION_FIELD_REQUIRED=False`` to have the old behaviour.
7+
* `disable_concurrency` now has `start()`, `finish()` to be called as command
8+
9+
10+
Release 1.4 (13 Sep 2016)
11+
-------------------------
312
* closes :issue:`81`. Add docs and check.
413
* fixes :issue:`80`. (thanks Naddiseo for the useful support)
514
* Django 1.11 compatibility
@@ -58,7 +67,7 @@ Release 1.0
5867
* **BACKWARD INCOMPATIBLE**:: removed custom backends. ``TriggerVerionField`` can be used with standard Django
5968
* new way to create triggers (thanks Naddiseo)
6069
* new trigger code
61-
* new :method:`TriggerVersionField.check`.
70+
* new :attr:`TriggerVersionField.check`.
6271
* new :attr:`TriggerVersionField.trigger_name`.
6372
* new :setting:`CONCURRECY_ENABLED` to fully disable concurrency
6473
* new :setting:`CONCURRECY_MANUAL_TRIGGERS` to disable triggers auto creation fixes :issue:`41` (thanks Naddiseo)
@@ -68,7 +77,7 @@ Release 0.9
6877
-----------
6978
* Django 1.8 compatibility
7079
* python 3.4 compatibility
71-
* **BACKWARD INCOMPATIBLE** :function:`disable_concurrency` works differently if used with classes or instances
80+
* **BACKWARD INCOMPATIBLE** :func:`disable_concurrency` works differently if used with classes or instances
7281
* better support for external Models (models that are part of plugged-in applications)
7382
* fixes issue with TriggerVersionField and Proxy Models (thanx Richard Eames)
7483

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ include tox.ini
88
include *.py
99

1010
exclude Makefile
11+
exclude Pipfile
1112
exclude .editorconfig
1213
exclude .tx
1314
exclude .pyc
15+
exclude .pre-commit-config.yaml
1416

1517
recursive-exclude .tx *
1618
recursive-exclude __pycache__ *

Makefile

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,30 @@ DJANGO?='last'
99
mkdir -p ${BUILDDIR}
1010

1111
develop:
12-
@pip install -U pip setuptools
12+
@pip install pipenv
1313
@sh -c "if [ '${DBENGINE}' = 'mysql' ]; then pip install MySQL-python; fi"
1414
@sh -c "if [ '${DBENGINE}' = 'pg' ]; then pip install -q psycopg2; fi"
15-
@pip install -e .[dev]
1615
$(MAKE) .init-db
16+
@pipenv install -d --skip-lock
1717

1818

1919
.init-db:
20-
@sh -c "if [ '${DBENGINE}' = 'mysql' ]; then mysql -u root -e 'DROP DATABASE IF EXISTS concurrency;'; fi"
21-
@sh -c "if [ '${DBENGINE}' = 'mysql' ]; then mysql -u root -e 'CREATE DATABASE IF NOT EXISTS concurrency;'; fi"
20+
@sh -c "if [ '${DBENGINE}' = 'mysql' ]; then mysql -h 127.0.0.1 -u root -e 'DROP DATABASE IF EXISTS concurrency;'; fi"
21+
@sh -c "if [ '${DBENGINE}' = 'mysql' ]; then mysql -h 127.0.0.1 -u root -e 'CREATE DATABASE IF NOT EXISTS concurrency;'; fi"
2222

23-
@sh -c "if [ '${DBENGINE}' = 'pg' ]; then psql -c 'DROP DATABASE IF EXISTS concurrency;' -U postgres; fi"
24-
@sh -c "if [ '${DBENGINE}' = 'pg' ]; then psql -c 'CREATE DATABASE concurrency;' -U postgres; fi"
23+
@sh -c "if [ '${DBENGINE}' = 'pg' ]; then psql -h localhost -c 'DROP DATABASE IF EXISTS concurrency;' -U postgres; fi"
24+
@sh -c "if [ '${DBENGINE}' = 'pg' ]; then psql -h localhost -c 'CREATE DATABASE concurrency;' -U postgres; fi"
2525

2626
test:
2727
py.test -v --create-db
2828

29-
qa:
30-
flake8 src/ tests/
31-
isort -rc src/ --check-only
32-
check-manifest
29+
lint:
30+
pre-commit run --all-files
31+
pipenv run isort -rc src/ --check-only
32+
pipenv run check-manifest
33+
34+
travis:
35+
docker run --privileged --name travis-debug -it -u travis travisci/ci-amethyst:packer-1512508255-986baf0 /bin/bash -l
3336

3437

3538
clean:
@@ -45,7 +48,7 @@ fullclean:
4548

4649
docs: .mkbuilddir
4750
mkdir -p ${BUILDDIR}/docs
48-
sphinx-build -aE docs/ ${BUILDDIR}/docs
51+
pipenv run sphinx-build -aE docs/ ${BUILDDIR}/docs
4952
ifdef BROWSE
5053
firefox ${BUILDDIR}/docs/index.html
5154
endif

Pipfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
django = "==2.1"
8+
pre-commit = "*"
9+
10+
[dev-packages]
11+
django-reversion = "*"
12+
django-webtest = "*"
13+
mock = "*"
14+
pytest = "*"
15+
pytest-cov = "*"
16+
pytest-django = "*"
17+
pytest-echo = "*"
18+
pytest-pythonpath = "*"
19+
tox = "*"
20+
"psycopg2-binary" = "*"
21+
check-manifest = "*"
22+
sphinx = "*"
23+
24+
[requires]
25+
python_version = "3.6"

README.rst

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ Django Concurrency
33
==================
44

55

6+
.. image:: https://badge.fury.io/py/django-concurrency.svg
7+
:target: http://badge.fury.io/py/django-concurrency
8+
:alt: PyPI package
9+
10+
611
django-concurrency is an optimistic lock [1]_ implementation for Django.
712

8-
Supported Django versions: 1.8.x, 1.9.x, 1.10.x., 1.11.x
13+
Supported Django versions: 1.8.x, 1.9.x, 1.10.x., 1.11.x, 2.x
914

1015
It prevents users from doing concurrent editing in Django both from UI and from a
1116
django command.
@@ -66,25 +71,30 @@ Links
6671
| Documentation: |https://django-concurrency.readthedocs.org/en/latest/ |
6772
+--------------------+---------------+--------------+-------------------------+
6873

69-
.. |master-build| image:: https://secure.travis-ci.org/saxix/django-concurrency.png?branch=master
74+
.. |master-build| image:: https://secure.travis-ci.org/saxix/django-concurrency.svg?branch=master
7075
:target: http://travis-ci.org/saxix/django-concurrency/
7176

7277
.. |master-cov| image:: https://codecov.io/gh/saxix/django-concurrency/branch/master/graph/badge.svg
7378
:target: https://codecov.io/gh/saxix/django-concurrency
7479

75-
.. |dev-build| image:: https://secure.travis-ci.org/saxix/django-concurrency.png?branch=develop
80+
.. |master-doc| image:: https://readthedocs.org/projects/django-concurrency/badge/?version=stable
81+
:target: http://django-concurrency.readthedocs.io/en/stable/
82+
83+
.. |dev-build| image:: https://secure.travis-ci.org/saxix/django-concurrency.svg?branch=develop
7684
:target: http://travis-ci.org/saxix/django-concurrency/
7785

7886
.. |dev-cov| image:: https://codecov.io/gh/saxix/django-concurrency/branch/develop/graph/badge.svg
7987
:target: https://codecov.io/gh/saxix/django-concurrency
8088

89+
.. |dev-doc| image:: https://readthedocs.org/projects/django-concurrency/badge/?version=stable
90+
:target: http://django-concurrency.readthedocs.io/en/stable/
8191

8292

83-
.. |wheel| image:: https://pypip.in/wheel/blackhole/badge.png
93+
94+
.. |wheel| image:: https://img.shields.io/pypi/wheel/django-concurrency.svg
8495

8596
_list-editable: https://django-concurrency.readthedocs.org/en/latest/admin.html#list-editable
8697

87-
.. _list-editable: https://django-concurrency.readthedocs.org/en/latest/admin.html#list-editable
8898

8999
.. _django-locking: https://github.com/stdbrouw/django-locking
90100

@@ -96,8 +106,6 @@ _list-editable: https://django-concurrency.readthedocs.org/en/latest/admin.html#
96106

97107
.. _disable_concurrency: https://django-concurrency.readthedocs.org/en/latest/api.html?#disable-concurrency
98108

99-
.. [1] http://en.wikipedia.org/wiki/Optimistic_concurrency_control
100-
101109

102110

103111
.. image:: https://badges.gitter.im/Join%20Chat.svg

0 commit comments

Comments
 (0)