Skip to content

Commit

Permalink
Merge branch 'release/0.6b'
Browse files Browse the repository at this point in the history
  • Loading branch information
saxix committed Jul 5, 2013
2 parents 05da58f + 5da0168 commit 77b1f0f
Show file tree
Hide file tree
Showing 79 changed files with 2,626 additions and 558 deletions.
Binary file added .coverage
Binary file not shown.
27 changes: 27 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[run]
branch = True
source = concurrency
include =

omit =


[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about missing debug-only code:
def __repr__
if self\.debug
# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
# Don't complain if non-runnable code isn't run:
#if 0:
if __name__ == .__main__.:

ignore_errors = True

[html]
directory = ~build/coverage
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
notes.txt
/.idea
/.tox
docs/build/
Expand All @@ -8,6 +9,7 @@ docs/build/
*.pyc
*.log
*.pot
*.mo
*.pyc
*.egg-info
*.sqlite
Expand Down
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ env:
- DJANGO="Django==1.5.1" DBENGINE=mysql
- DJANGO="Django==1.5.1" DBENGINE=pg

- DJANGO="https://www.djangoproject.com/download/1.6b1/tarball/" DBENGINE=pg

install:
- make install-deps
- sh -c "if [ '$DBENGINE' = 'pg' ]; then pip install -q psycopg2; fi"
- sh -c "if [ '$DBENGINE' = 'mysql' ]; then pip install -q MySQL-python; fi"
- pip install -q $DJANGO
- python setup.py -q install

script:
cd demoproject && ./manage.py test concurrency
- make test

before_install:
- sh -c "if [ '$DBENGINE' = 'pg' ]; then psql -c 'DROP DATABASE IF EXISTS concurrency;' -U postgres; fi"
Expand All @@ -37,3 +40,6 @@ matrix:
env: DJANGO="Django==1.4.5" DBENGINE=pg
- python: 3.2
env: DJANGO="Django==1.5.1" DBENGINE=mysql

after_success:
- coveralls
9 changes: 9 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[django-concurrency.django-concurrency]
file_filter = concurrency/locale/<lang>/LC_MESSAGES/django.po
source_file = concurrency/locale/en/LC_MESSAGES/django.po
source_lang = en

[main]
host = https://www.transifex.com
type = PO

22 changes: 18 additions & 4 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
Release 0.6.0 (beta)
---------------------------------

* new :ref:`disable_concurrency` context manager
* added documentation for :ref:`concurrency.middleware.ConcurrencyMiddleware <concurrencymiddleware>`
* **BACKWARD INCOMPATIBLE** Fixed typo: ``CONCURRECY_SANITY_CHECK`` now ``CONCURRENCY_SANITY_CHECK``
* added :ref:`disable_sanity_check` context manager
* added configuration
* check admin actions for concurrent deletion
* added concurrency check for admin's :ref:`list_editable`


Release 0.5.0
---------------------------------

* python 3.x compatibility
* new :ref:`CONCURRENCY_FIELD_SIGNER`
* new :setting:`CONCURRENCY_FIELD_SIGNER`


Release 0.4.0
---------------------------------

* start deprecation of ``concurrency.core.VersionChangedError``, ``concurrency.core.RecordModifiedError``, ``concurrency.core.InconsistencyError``,moved in ``concurrency.exceptions``
* start deprecation of ``concurrency.core.VersionChangedError``, ``concurrency.core.RecordModifiedError``,
``concurrency.core.InconsistencyError``,moved in ``concurrency.exceptions``
* start deprecation of ``concurrency.core.apply_concurrency_check``, ``concurrency.core.concurrency_check`` moved in ``concurrency.api``
* added :ref:`CONCURRECY_SANITY_CHECK` settings entry
* added :setting:`CONCURRECY_SANITY_CHECK` settings entry
* signing of version number to avoid tampering (:ref:`concurrentform`)
* added :ref:`ConcurrencyTestMixin` to help test on concurrency managed models
* added :ref:`concurrencytestmixin` to help test on concurrency managed models
* changed way to add concurrency to exisiting models (:ref:`apply_concurrency_check`)
* fixed #4 (thanks FrankBie)
* removed RandomVersionField
Expand Down
6 changes: 3 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include README.rst
include AUTHORS
include CHANGES
include LICENSE
include MANIFEST.in
include setup.py
recursive-include concurrency *.py
recursive-include docs *
recursive-include demoproject *
recursive-exclude docs/OUT *
recursive-include concurrency/templates *.html
recursive-include docs *.py
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
VERSION=2.0.0
BUILDDIR='~build'
DJANGO_SETTINGS_MODULE:=demoproject.settings
PYTHONPATH:=${PWD}/demo/:${PWD}


install-deps:
pip install -r demo/demoproject/requirements.pip -r requirements.pip python-coveralls coverage


locale:
cd concurrency && django-admin.py makemessages -l en
export PYTHONPATH=${PYTHONPATH}
cd concurrency && django-admin.py compilemessages --settings=${DJANGO_SETTINGS_MODULE}

docs:
mkdir -p ${BUILDDIR}/
sphinx-build -aE docs ${BUILDDIR}/docs
firefox ${BUILDDIR}/docs/index.html

test:
export PYTHONPATH=${PYTHONPATH}
coverage run demo/manage.py test concurrency --settings=${DJANGO_SETTINGS_MODULE}

coverage:
export PYTHONPATH=${PYTHONPATH}
coverage run demo/manage.py test concurrency --settings=${DJANGO_SETTINGS_MODULE}
coverage report

clean:
rm -fr ${BUILDDIR} dist *.egg-info .coverage
find concurrency/locale -name django.mo | xargs rm -f

.PHONY: docs
12 changes: 11 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ Django Concurrency
:target: http://travis-ci.org/saxix/django-concurrency/


django-concurrency is a optimistic locking library for Django 1.4.
.. image:: https://coveralls.io/repos/saxix/django-concurrency/badge.png
:target: https://coveralls.io/r/saxix/django-concurrency

.. image:: https://pypip.in/v/django-concurrency/badge.png
:target: https://crate.io/packages/django-concurrency/

.. image:: https://pypip.in/d/django-concurrency/badge.png
:target: https://crate.io/packages/django-concurrency/


django-concurrency is a optimistic locking library for Django. (requires version >=1.4)

It prevents users from doing concurrent editing in Django both from UI as from a
django command.
Expand Down
7 changes: 3 additions & 4 deletions concurrency/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import datetime
import os

VERSION = __version__ = (0, 5, 0, 'final', 0)
VERSION = __version__ = (0, 6, 0, 'beta', 0)
__author__ = 'sax'


Expand Down Expand Up @@ -38,12 +38,11 @@ def get_git_changeset():
"""
repo_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
git_log = subprocess.Popen('git log --pretty=format:%ct --quiet -1 HEAD',
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
shell=True, cwd=repo_dir, universal_newlines=True)
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
shell=True, cwd=repo_dir, universal_newlines=True)
timestamp = git_log.communicate()[0]
try:
timestamp = datetime.datetime.utcfromtimestamp(int(timestamp))
except ValueError:
return None
return timestamp.strftime('%Y%m%d%H%M%S')

Loading

0 comments on commit 77b1f0f

Please sign in to comment.