PALs 0.3.3__tar.gz → 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {PALs-0.3.3 → PALs-0.3.4}/PALs.egg-info/PKG-INFO +9 -1
- {PALs-0.3.3 → PALs-0.3.4}/PKG-INFO +9 -1
- {PALs-0.3.3 → PALs-0.3.4}/changelog.rst +8 -0
- {PALs-0.3.3 → PALs-0.3.4}/pals/core.py +7 -4
- PALs-0.3.4/pals/version.py +1 -0
- {PALs-0.3.3 → PALs-0.3.4}/tox.ini +11 -5
- PALs-0.3.3/pals/version.py +0 -1
- {PALs-0.3.3 → PALs-0.3.4}/.ci/pytest.ini +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/.circleci/config.yml +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/.coveragerc +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/MANIFEST.in +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/PALs.egg-info/SOURCES.txt +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/PALs.egg-info/dependency_links.txt +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/PALs.egg-info/not-zip-safe +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/PALs.egg-info/requires.txt +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/PALs.egg-info/top_level.txt +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/docker-compose.yaml +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/license.txt +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/pals/__init__.py +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/pals/tests/test_core.py +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/pyp.ini +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/readme.rst +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/scripts/hang.py +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/scripts/setup-codecov +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/setup.cfg +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/setup.py +0 -0
- {PALs-0.3.3 → PALs-0.3.4}/stable-requirements.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PALs
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: Easy distributed locking using PostgreSQL Advisory Locks.
|
|
5
5
|
Home-page: https://github.com/level12/pals
|
|
6
6
|
Author: Randy Syring
|
|
@@ -180,6 +180,14 @@ See Also
|
|
|
180
180
|
Changelog
|
|
181
181
|
=========
|
|
182
182
|
|
|
183
|
+
0.3.4 released 2023-03-06
|
|
184
|
+
-------------------------
|
|
185
|
+
|
|
186
|
+
- support SQLAlchemy 2.0 (6879081_)
|
|
187
|
+
|
|
188
|
+
.. _6879081: https://github.com/level12/pals/commit/6879081
|
|
189
|
+
|
|
190
|
+
|
|
183
191
|
0.3.3 released 2023-01-06
|
|
184
192
|
-------------------------
|
|
185
193
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PALs
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: Easy distributed locking using PostgreSQL Advisory Locks.
|
|
5
5
|
Home-page: https://github.com/level12/pals
|
|
6
6
|
Author: Randy Syring
|
|
@@ -180,6 +180,14 @@ See Also
|
|
|
180
180
|
Changelog
|
|
181
181
|
=========
|
|
182
182
|
|
|
183
|
+
0.3.4 released 2023-03-06
|
|
184
|
+
-------------------------
|
|
185
|
+
|
|
186
|
+
- support SQLAlchemy 2.0 (6879081_)
|
|
187
|
+
|
|
188
|
+
.. _6879081: https://github.com/level12/pals/commit/6879081
|
|
189
|
+
|
|
190
|
+
|
|
183
191
|
0.3.3 released 2023-01-06
|
|
184
192
|
-------------------------
|
|
185
193
|
|
|
@@ -84,7 +84,7 @@ class Locker:
|
|
|
84
84
|
name = self._lock_name(name)
|
|
85
85
|
kwargs.setdefault('blocking', self.blocking_default)
|
|
86
86
|
kwargs.setdefault('acquire_timeout', self.acquire_timeout_default)
|
|
87
|
-
return Lock(self.engine
|
|
87
|
+
return Lock(self.engine, lock_num, name, **kwargs)
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
class Lock:
|
|
@@ -106,14 +106,16 @@ class Lock:
|
|
|
106
106
|
|
|
107
107
|
if blocking:
|
|
108
108
|
timeout_sql = sa.text('set lock_timeout = :timeout')
|
|
109
|
-
self.conn.
|
|
109
|
+
with self.conn.begin():
|
|
110
|
+
self.conn.execute(timeout_sql, {'timeout': acquire_timeout})
|
|
110
111
|
|
|
111
112
|
lock_sql = sa.text(f'select pg_advisory_lock{self.shared_suffix}(:lock_num)')
|
|
112
113
|
else:
|
|
113
114
|
lock_sql = sa.text(f'select pg_try_advisory_lock{self.shared_suffix}(:lock_num)')
|
|
114
115
|
|
|
115
116
|
try:
|
|
116
|
-
|
|
117
|
+
with self.conn.begin():
|
|
118
|
+
result = self.conn.execute(lock_sql, {'lock_num': self.lock_num})
|
|
117
119
|
retval = result.scalar()
|
|
118
120
|
log.debug('Lock result was: %r', retval)
|
|
119
121
|
# At least on PG 10.6, pg_advisory_lock() returns an empty string
|
|
@@ -140,7 +142,8 @@ class Lock:
|
|
|
140
142
|
return False
|
|
141
143
|
|
|
142
144
|
sql = sa.text(f'select pg_advisory_unlock{self.shared_suffix}(:lock_num)')
|
|
143
|
-
|
|
145
|
+
with self.conn.begin():
|
|
146
|
+
result = self.conn.execute(sql, {'lock_num': self.lock_num})
|
|
144
147
|
self.conn.close()
|
|
145
148
|
self.conn = None
|
|
146
149
|
return result.scalar()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = '0.3.4'
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
[tox]
|
|
2
|
-
envlist =
|
|
3
|
-
|
|
2
|
+
envlist =
|
|
3
|
+
py37
|
|
4
|
+
py{38,39,310}-{base,stable}
|
|
5
|
+
py37-{lowest}
|
|
6
|
+
py310-{lowest}
|
|
7
|
+
project
|
|
4
8
|
|
|
5
9
|
[testenv]
|
|
6
10
|
# Ignore all "not installed in testenv" warnings.
|
|
@@ -10,10 +14,12 @@ passenv = PALS_DB_URL
|
|
|
10
14
|
skip_install = true
|
|
11
15
|
|
|
12
16
|
recreate = true
|
|
17
|
+
deps =
|
|
18
|
+
-e .[tests]
|
|
19
|
+
stable: -r stable-requirements.txt
|
|
20
|
+
lowest: sqlalchemy<2
|
|
13
21
|
commands =
|
|
14
22
|
pip --version
|
|
15
|
-
pip install --progress-bar off -e .[tests]
|
|
16
|
-
stable: pip install --progress-bar off -r ./stable-requirements.txt
|
|
17
23
|
# Output installed versions to compare with previous test runs in case a dependency's change
|
|
18
24
|
# breaks things for our build.
|
|
19
25
|
pip freeze
|
|
@@ -22,7 +28,7 @@ commands =
|
|
|
22
28
|
-c .ci/pytest.ini \
|
|
23
29
|
-ra \
|
|
24
30
|
--tb native \
|
|
25
|
-
--strict \
|
|
31
|
+
--strict-markers \
|
|
26
32
|
--cov pals \
|
|
27
33
|
--cov-config .coveragerc \
|
|
28
34
|
--cov-report xml \
|
PALs-0.3.3/pals/version.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = '0.3.3'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|