Skip to content

Commit a2d8b8a

Browse files
authored
Merge pull request #250 from saxix/feature/pep621
pep 621
2 parents f3c5ac1 + b1dd950 commit a2d8b8a

16 files changed

+84
-162
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ __pycache__
2020
.testmondata
2121
Pipfile.lock
2222
poetry.lock
23-
pyproject.toml
23+
!pyproject.toml
2424
.venv/
25+
pdm.lock

.pre-commit-config.yaml

+2-8
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ repos:
1212
entry: isort
1313
language: system
1414
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
2215

23-
- repo: git://github.com/pre-commit/pre-commit-hooks
16+
17+
- repo: https://github.com/pre-commit/pre-commit-hooks
2418
rev: v1.4.0
2519
hooks:
2620
- id: debug-statements

.readthedocs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version: 2
88
build:
99
os: ubuntu-22.04
1010
tools:
11-
python: "3.9"
11+
python: "3.10"
1212
# You can also specify other tool versions:
1313
# nodejs: "20"
1414
# rust: "1.70"

CHANGES

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-----------
33
* add support do Django 5.x
44
* drop support python 3.9
5+
* move to .pyproject.toml
56

67

78
Release 2.5

Pipfile

-26
This file was deleted.

docs/conf.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
'django': ('http://django.readthedocs.org/en/latest/', None),
4646
'sphinx': ('http://sphinx.readthedocs.org/en/latest/', None),
4747
}
48-
extlinks = {'issue': ('https://github.com/saxix/django-concurrency/issues/%s', 'issue #'),
49-
'django_issue': ('https://code.djangoproject.com/ticket/%s', 'issue #'),
48+
extlinks = {'issue': ('https://github.com/saxix/django-concurrency/issues/%s', 'issue #%s'),
49+
'django_issue': ('https://code.djangoproject.com/ticket/%s', 'issue #%s'),
5050

5151
}
5252

@@ -81,7 +81,7 @@
8181
version = concurrency.VERSION
8282
# The full version, including alpha/beta/rc tags.
8383
release = concurrency.VERSION
84-
next_version = '1.5'
84+
next_version = '2.6'
8585

8686
# The language for content autogenerated by Sphinx. Refer to documentation
8787
# for a list of supported languages.
@@ -122,7 +122,7 @@
122122

123123
# The theme to use for HTML and HTML Help pages. See the documentation for
124124
# a list of builtin themes.
125-
html_theme = "default"
125+
# html_theme = "default"
126126
#
127127
# Theme options are theme-specific and customize the look and feel of a theme
128128
# further. For a list of options available for each theme, see the

docs/requirements.pip

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
sphinx==3.5.2
1+
sphinx
22
django
33
sphinx_issues

pyproject.toml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
[project]
2+
name = "django-concurrency"
3+
version = "2.5"
4+
description = "Optimistic lock implementation for Django. Prevents users from doing concurrent editing"
5+
authors = [
6+
{name = "sax", email = "[email protected]"},
7+
]
8+
dependencies = []
9+
requires-python = ">=3.10"
10+
readme = "README.md"
11+
license = {text = "MIT"}
12+
13+
[tool.pdm]
14+
[[tool.pdm.source]]
15+
url = "https://pypi.org/simple"
16+
verify_ssl = true
17+
name = "pypi"
18+
19+
[tool.pdm.dev-dependencies]
20+
dev = [
21+
"black",
22+
"bump2version>=1.0.1",
23+
"check-manifest",
24+
"django",
25+
"django-reversion",
26+
"django-webtest",
27+
"flake8",
28+
"isort",
29+
"mock",
30+
"pre-commit",
31+
"psycopg2-binary",
32+
"pytest",
33+
"pytest-cov",
34+
"pytest-django",
35+
"pytest-echo",
36+
"sphinx",
37+
"sphinx-issues",
38+
"tox",
39+
"twine",
40+
]
41+
42+
[tool.isort]
43+
combine_as_imports = true
44+
default_section = "THIRDPARTY"
45+
include_trailing_comma = true
46+
known_tests = "pytest,unittest,factory"
47+
known_demo = "demo"
48+
known_django = "django"
49+
sections = "FUTURE,STDLIB,DJANGO,THIRDPARTY,TESTS,FIRSTPARTY,DEMO,LOCALFOLDER"
50+
known_first_party = "etools_validator"
51+
multi_line_output = 3
52+
line_length = 120
53+
balanced_wrapping = true
54+
order_by_type = false

setup.cfg

-9
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,3 @@ max-complexity = 12
1717
max-line-length = 160
1818
exclude = .tox,migrations,.git,docs,diff_match_patch.py, deploy/**,settings
1919
ignore = E501,E401,W391,E128,E261,E731,W504
20-
21-
[aliases]
22-
test=pytest
23-
24-
[bdist_wheel]
25-
universal=1
26-
27-
[devpi:upload]
28-
formats = bdist_wheel,sdist.tgz

setup.py

-97
This file was deleted.

src/concurrency/admin.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
from django.core.exceptions import ImproperlyConfigured, ValidationError
1010
from django.db import transaction
1111
from django.db.models import Q
12+
from django.forms import CheckboxInput
1213
from django.forms.formsets import INITIAL_FORM_COUNT, ManagementForm, MAX_NUM_FORM_COUNT, TOTAL_FORM_COUNT
1314
from django.forms.models import BaseModelFormSet
1415
from django.http import HttpResponse, HttpResponseRedirect
1516
from django.utils.encoding import force_str
17+
from django.utils.html import format_html
1618
from django.utils.safestring import mark_safe
17-
from django.utils.translation import ngettext
19+
from django.utils.translation import gettext_lazy as _, ngettext
1820

1921
from concurrency import core, forms
2022
from concurrency.api import get_revision_of_object
@@ -23,9 +25,7 @@
2325
from concurrency.exceptions import RecordModifiedError
2426
from concurrency.forms import ConcurrentForm, VersionWidget
2527
from concurrency.utils import flatten
26-
from django.forms import CheckboxInput
27-
from django.utils.html import format_html
28-
from django.utils.translation import gettext_lazy as _
28+
2929
ALL = object()
3030

3131

tests/demoapp/demo/backends.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from typing import Any
2-
31
from django.conf import settings
42
from django.contrib.auth import get_user_model
53
from django.contrib.auth.backends import ModelBackend

tests/demoapp/demo/migrations5/0001_initial.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Generated by Django 5.0.1 on 2024-01-25 17:49
22

3-
import concurrency.fields
43
import django.contrib.auth.models
54
import django.db.models.deletion
65
from django.conf import settings
76
from django.db import migrations, models
87

8+
import concurrency.fields
9+
910

1011
class Migration(migrations.Migration):
1112

tests/demoapp/demo/settings.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import os
22
from tempfile import mktemp
33

4+
import django
5+
46
try:
57
from psycopg2cffi import compat
68

@@ -28,8 +30,6 @@
2830
'reversion',
2931
'demo'
3032
]
31-
import django
32-
3333
IS_DJANGO_5 = django.VERSION[0] == 5
3434
if IS_DJANGO_5:
3535
MIGRATION_MODULES = {

tests/test_forms.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
from django.conf import settings
12
from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation
23
from django.forms.models import modelform_factory
34
from django.forms.widgets import HiddenInput, TextInput
45
from django.test import override_settings, TestCase
56
from django.test.testcases import SimpleTestCase
67
from django.utils.encoding import smart_str
78
from django.utils.translation import gettext as _
8-
from django.conf import settings
9+
910
import pytest
1011

1112
from concurrency.exceptions import VersionError

0 commit comments

Comments
 (0)