2019-12-04 09:56:23 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-django-pglocks
|
|
|
|
#
|
2024-06-25 06:20:38 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2019-12-04 09:56:23 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2024-03-28 07:37:30 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
2019-12-04 09:56:23 +00:00
|
|
|
Name: python-django-pglocks
|
2020-04-02 12:20:05 +00:00
|
|
|
Version: 1.0.4
|
2019-12-04 09:56:23 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: PostgreSQL Advisory Locks for Django
|
|
|
|
License: MIT
|
|
|
|
URL: https://github.com/Xof/django-pglocks
|
|
|
|
Source: https://files.pythonhosted.org/packages/source/d/django-pglocks/django-pglocks-%{version}.tar.gz
|
|
|
|
BuildRequires: %{python_module Django}
|
2024-06-25 06:20:38 +00:00
|
|
|
BuildRequires: %{python_module pip}
|
2019-12-04 09:56:23 +00:00
|
|
|
BuildRequires: %{python_module psycopg2}
|
|
|
|
BuildRequires: %{python_module setuptools}
|
2024-06-25 06:20:38 +00:00
|
|
|
BuildRequires: %{python_module wheel}
|
2019-12-04 09:56:23 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
Requires: python-Django
|
|
|
|
Requires: python-psycopg2
|
2024-06-25 06:20:38 +00:00
|
|
|
Requires: python-six
|
2019-12-04 09:56:23 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
django-pglocks provides a useful context manager to manage PostgreSQL advisory
|
|
|
|
locks. It requires Django (tested with 1.5), PostgreSQL, and (probably) psycopg2.
|
|
|
|
|
|
|
|
Advisory locks are application-level locks that are acquired and released purely
|
|
|
|
by the client of the database; PostgreSQL never acquires them on its own. They
|
|
|
|
are very useful as a way of signalling to other sessions that a higher-level
|
|
|
|
resource than a single row is in use, without having to lock an entire table or
|
|
|
|
some other structure.
|
|
|
|
|
|
|
|
It's entirely up to the application to correctly acquire the right lock.
|
|
|
|
|
|
|
|
Advisory locks are either session locks or transaction locks. A session lock is
|
|
|
|
held until the database session disconnects (or is reset); a transaction lock is
|
|
|
|
held until the transaction terminates.
|
|
|
|
|
|
|
|
Currently, the context manager only creates session locks, as the behavior of a
|
|
|
|
lock persisting after the context body has been exited is surprising, and
|
|
|
|
there's no way of releasing a transaction-scope advisory lock except to exit
|
|
|
|
the transaction.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n django-pglocks-%{version}
|
|
|
|
|
|
|
|
%build
|
2024-06-25 06:20:38 +00:00
|
|
|
%pyproject_wheel
|
2019-12-04 09:56:23 +00:00
|
|
|
|
|
|
|
%install
|
2024-06-25 06:20:38 +00:00
|
|
|
%pyproject_install
|
2019-12-04 09:56:23 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
|
|
# Here could be unittests, but we don't want to spool up a PostgreSQL server
|
|
|
|
# at this point.
|
|
|
|
|
|
|
|
%files %{python_files}
|
|
|
|
%doc CHANGES.txt
|
|
|
|
%license LICENSE.txt
|
2024-06-25 06:20:38 +00:00
|
|
|
%{python_sitelib}/django_pglocks
|
|
|
|
%{python_sitelib}/django_pglocks-%{version}.dist-info
|
2019-12-04 09:56:23 +00:00
|
|
|
|
|
|
|
%changelog
|