Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mathpresso/django-db-locking
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: vikingco/django-db-locking
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 19 commits
  • 16 files changed
  • 7 contributors

Commits on Oct 4, 2017

  1. Support for MySQL/MariaDB with utf8mb4 encoding (vikingco#40)

    * Change max length on NonBlockingLock model field 'locked_object'
    * Squash migrations
    
    Warning: This commit might not be 100% backwards compatible with your data. In case the locked_object field has a longer value, it will be truncated.
    Martijn Hemeryck authored and Duologic committed Oct 4, 2017
    Copy the full SHA
    0574b53 View commit details
  2. Adds missing migration for wrong default values (vikingco#41)

    Martijn Hemeryck authored and Duologic committed Oct 4, 2017
    Copy the full SHA
    6213905 View commit details

Commits on Dec 7, 2017

  1. Add timezone awareness test

    Pieter De Decker committed Dec 7, 2017
    Copy the full SHA
    9ce731a View commit details
  2. Fix docstring style

    Pieter De Decker committed Dec 7, 2017
    Copy the full SHA
    78aae97 View commit details
  3. Clean up old migrations

    Pieter De Decker committed Dec 7, 2017
    Copy the full SHA
    b266fbb View commit details
  4. Reflect incompatibility with 2.0

    Pieter De Decker committed Dec 7, 2017
    Copy the full SHA
    8946967 View commit details
  5. Resolve ambiguous variable names

    The flake8 check in the build suddenly starting failing on this for some
    reason.
    Pieter De Decker committed Dec 7, 2017
    Copy the full SHA
    925516c View commit details
  6. Bump version

    Pieter De Decker committed Dec 7, 2017
    Copy the full SHA
    b0885fb View commit details
  7. Merge pull request vikingco#42 from vikingco/VD-775/timezone-support

    VD-775: Ensure we get no timezone awareness warnings
    Veronica Cuevas authored Dec 7, 2017

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ab5c1b1 View commit details

Commits on Dec 8, 2017

  1. Add migrations check

    Pieter De Decker committed Dec 8, 2017
    Copy the full SHA
    3021854 View commit details
  2. Add missing migration

    Pieter De Decker committed Dec 8, 2017
    Copy the full SHA
    e478b1e View commit details
  3. Remove obsolete replace statement

    Pieter De Decker committed Dec 8, 2017
    Copy the full SHA
    def80d2 View commit details
  4. Bump version

    Pieter De Decker committed Dec 8, 2017
    Copy the full SHA
    4ea07b3 View commit details
  5. Merge pull request vikingco#43 from vikingco/VD-688/fix-locking

    VD-688: Fix django-db-locking migrations
    pieterdd authored Dec 8, 2017

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7244736 View commit details

Commits on Apr 16, 2018

  1. Copy the full SHA
    e59181b View commit details
  2. Merge pull request vikingco#44 from vikingco/fix-pip

    Use correct paths for PIP 10
    nielsvanoch authored Apr 16, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9c77c55 View commit details

Commits on Nov 7, 2018

  1. Update requirements to allow django < 2.2

    Tested on django 2.0 and 2.1.
    Timvde authored and Tim Van den Eynde committed Nov 7, 2018
    Copy the full SHA
    8df41f9 View commit details
  2. Update Travis tests

    We only want to run against supported versions of Python/Django.
    
    Listed 3.6.7 explicitly because 3.6 is still the older 3.6.3 on Travis,
    which is outdated.
    Timvde authored and Tim Van den Eynde committed Nov 7, 2018
    Copy the full SHA
    ea87fc9 View commit details
  3. Bump version to 2.0.8

    Timvde authored and Tim Van den Eynde committed Nov 7, 2018
    Copy the full SHA
    378a66c View commit details
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
language: python
env:
- DJANGO='>=1.8,<1.9'
- DJANGO='>=1.9,<1.10'
- DJANGO='>=1.10,<1.11'
- DJANGO='>=1.11,<1.12'
- DJANGO='>=2.0,<2.1'
- DJANGO='>=2.1<2.2'
python:
- "2.7"
- "3.6"
- "3.6.7"
install:
- pip install --upgrade pip
- pip install -e .
- pip install -r requirements/requirements_test.txt
- pip install "Django${DJANGO}"
before_script:
flake8 locking/
# All migrations have to be generated
- (! python test_project/manage.py makemigrations --dry-run --exit)
- flake8 locking/
script:
pytest -v --capture=sys --cov=locking/ locking/ --cov-report term-missing:skip-covered
after_success:
2 changes: 1 addition & 1 deletion locking/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.0.2'
__version__ = '2.0.8'
32 changes: 16 additions & 16 deletions locking/exceptions.py
Original file line number Diff line number Diff line change
@@ -3,96 +3,96 @@ class Error(Exception):


class LockError(Error):
'''
"""
Base class for errors arising from attempts to acquire the lock.
>>> try:
... raise LockError
... except Error:
... pass
'''
"""
pass


class LockFailed(LockError):
'''
"""
Lock creation failed for some unknown reason.
>>> try:
... raise LockFailed
... except LockError:
... pass
'''
"""
pass


class AlreadyLocked(LockFailed):
'''
"""
Some other process is locking the object.
>>> try:
... raise AlreadyLocked
... except LockFailed:
... pass
'''
"""
pass


class UnlockError(Error):
'''
"""
Base class for errors arising from attempts to release the lock.
>>> try:
... raise UnlockError
... except Error:
... pass
'''
"""
pass


class NotLocked(UnlockError):
'''
"""
Raised when an attempt is made to unlock an unlocked file.
>>> try:
... raise NotLocked
... except UnlockError:
... pass
'''
"""
pass


class RenewalError(Error):
'''
"""
Base class for errors arising from attempts to renew the lock.
>>> try:
... raise RenewalError
... except Error:
... pass
'''
"""
pass


class NonexistentLock(RenewalError):
'''
"""
Raised when an attempt is made to renew a nonexistent lock.
>>> try:
... raise NonexistentLock
... except RenewalError:
... pass
'''
"""
pass


class Expired(RenewalError):
'''
"""
Raised when an attempt is made to renew an expired lock.
>>> try:
... raise Expired
... except RenewalError:
... pass
'''
"""
pass
29 changes: 0 additions & 29 deletions locking/migrations/0001_initial.py

This file was deleted.

34 changes: 34 additions & 0 deletions locking/migrations/0001_squashed_0007_auto_20171004_0900.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-04 09:01
from __future__ import unicode_literals

import datetime
from django.db import migrations, models
import uuid


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='NonBlockingLock',
fields=[
('locked_object', models.CharField(max_length=150, unique=True, verbose_name='locked object')),
('created_on', models.DateTimeField(db_index=True, verbose_name='created on')),
('max_age', models.PositiveIntegerField(default=0, help_text='The age of a lock before it can be overwritten. 0 means indefinitely.', verbose_name='Maximum lock age')),
('expires_on', models.DateTimeField(db_index=True, default=datetime.datetime(2015, 9, 7, 3, 32, 8, 543000), verbose_name='expires on')),
('renewed_on', models.DateTimeField(db_index=True, default=datetime.datetime(2015, 9, 7, 3, 32, 18, 56000), verbose_name='renewed on')),
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
],
options={
'verbose_name_plural': 'NonBlockingLocks',
'verbose_name': 'NonBlockingLock',
'ordering': ['created_on'],
},
),
]
25 changes: 25 additions & 0 deletions locking/migrations/0002_auto_20171208_0824.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-12-08 08:24
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('locking', '0001_squashed_0007_auto_20171004_0900'),
]

operations = [
migrations.AlterField(
model_name='nonblockinglock',
name='expires_on',
field=models.DateTimeField(db_index=True, verbose_name='expires on'),
),
migrations.AlterField(
model_name='nonblockinglock',
name='renewed_on',
field=models.DateTimeField(db_index=True, verbose_name='renewed on'),
),
]
20 changes: 0 additions & 20 deletions locking/migrations/0002_rename.py

This file was deleted.

39 changes: 0 additions & 39 deletions locking/migrations/0003_optimize_queries.py

This file was deleted.

25 changes: 0 additions & 25 deletions locking/migrations/0004_auto_20151115_0703.py

This file was deleted.

21 changes: 0 additions & 21 deletions locking/migrations/0004_auto_20160907_0942.py

This file was deleted.

17 changes: 0 additions & 17 deletions locking/migrations/0005_merge_20170504_1024.py

This file was deleted.

20 changes: 0 additions & 20 deletions locking/migrations/0006_auto_20170609_1342.py

This file was deleted.

Loading