taskflow 5.2.0__py3-none-any.whl → 5.4.0__py3-none-any.whl

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.
@@ -1,5 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
1
  # Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
4
2
  # Copyright (C) 2013 Rackspace Hosting All Rights Reserved.
5
3
  #
@@ -15,7 +13,6 @@
15
13
  # License for the specific language governing permissions and limitations
16
14
  # under the License.
17
15
 
18
- import contextlib
19
16
  import copy
20
17
  import functools
21
18
  import threading
@@ -386,7 +383,7 @@ class Connection(base.Connection):
386
383
  # once it does not mean that we will be able to connect in
387
384
  # the future, so this is more of a sanity test and is not
388
385
  # complete connection insurance.
389
- with contextlib.closing(engine.connect()):
386
+ with engine.connect():
390
387
  pass
391
388
 
392
389
  _try_connect(self._engine)
@@ -394,7 +391,7 @@ class Connection(base.Connection):
394
391
  def upgrade(self):
395
392
  try:
396
393
  with self._upgrade_lock:
397
- with contextlib.closing(self._engine.connect()) as conn:
394
+ with self._engine.connect() as conn:
398
395
  # NOTE(imelnikov): Alembic does not support SQLite,
399
396
  # and we don't recommend to use SQLite in production
400
397
  # deployments, so migrations are rarely needed
@@ -402,7 +399,8 @@ class Connection(base.Connection):
402
399
  # SQLite limitations, and create the database directly
403
400
  # from the tables when it is in use...
404
401
  if 'sqlite' in self._engine.url.drivername:
405
- self._metadata.create_all(bind=conn)
402
+ with conn.begin():
403
+ self._metadata.create_all(bind=conn)
406
404
  else:
407
405
  migration.db_sync(conn)
408
406
  except sa_exc.SQLAlchemyError:
@@ -538,7 +536,7 @@ class Connection(base.Connection):
538
536
  def get_logbook(self, book_uuid, lazy=False):
539
537
  try:
540
538
  logbooks = self._tables.logbooks
541
- with contextlib.closing(self._engine.connect()) as conn:
539
+ with self._engine.connect() as conn:
542
540
  q = (sql.select(logbooks).
543
541
  where(logbooks.c.uuid == book_uuid))
544
542
  row = conn.execute(q).first()
@@ -557,7 +555,7 @@ class Connection(base.Connection):
557
555
  def get_logbooks(self, lazy=False):
558
556
  gathered = []
559
557
  try:
560
- with contextlib.closing(self._engine.connect()) as conn:
558
+ with self._engine.connect() as conn:
561
559
  q = sql.select(self._tables.logbooks)
562
560
  for row in conn.execute(q):
563
561
  row = row._mapping
@@ -574,7 +572,7 @@ class Connection(base.Connection):
574
572
  def get_flows_for_book(self, book_uuid, lazy=False):
575
573
  gathered = []
576
574
  try:
577
- with contextlib.closing(self._engine.connect()) as conn:
575
+ with self._engine.connect() as conn:
578
576
  for fd in self._converter.flow_query_iter(conn, book_uuid):
579
577
  if not lazy:
580
578
  self._converter.populate_flow_detail(conn, fd)
@@ -626,7 +624,7 @@ class Connection(base.Connection):
626
624
  def get_atoms_for_flow(self, fd_uuid):
627
625
  gathered = []
628
626
  try:
629
- with contextlib.closing(self._engine.connect()) as conn:
627
+ with self._engine.connect() as conn:
630
628
  for ad in self._converter.atom_query_iter(conn, fd_uuid):
631
629
  gathered.append(ad)
632
630
  except sa_exc.DBAPIError:
taskflow/test.py CHANGED
@@ -1,5 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
1
  # Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
4
2
  #
5
3
  # Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -26,6 +24,7 @@ from testtools import matchers
26
24
  from testtools import testcase
27
25
 
28
26
  from taskflow import exceptions
27
+ from taskflow.tests import fixtures as taskflow_fixtures
29
28
  from taskflow.tests import utils
30
29
  from taskflow.utils import misc
31
30
 
@@ -92,6 +91,10 @@ class ItemsEqual(object):
92
91
  class TestCase(base.BaseTestCase):
93
92
  """Test case base class for all taskflow unit tests."""
94
93
 
94
+ def setUp(self):
95
+ super().setUp()
96
+ self.useFixture(taskflow_fixtures.WarningsFixture())
97
+
95
98
  def makeTmpDir(self):
96
99
  t_dir = self.useFixture(fixtures.TempDir())
97
100
  return t_dir.path
@@ -0,0 +1,58 @@
1
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may
2
+ # not use this file except in compliance with the License. You may obtain
3
+ # a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
+ # License for the specific language governing permissions and limitations
11
+ # under the License.
12
+
13
+ import warnings
14
+
15
+ import fixtures
16
+ from sqlalchemy import exc as sqla_exc
17
+
18
+
19
+ class WarningsFixture(fixtures.Fixture):
20
+ """Filters out warnings during test runs."""
21
+ def setUp(self):
22
+ super().setUp()
23
+
24
+ self._original_warning_filters = warnings.filters[:]
25
+
26
+ warnings.simplefilter('once', DeprecationWarning)
27
+
28
+ # The UUIDFields emits a warning if the value is not a valid UUID.
29
+ # Let's escalate that to an exception in the test to prevent adding
30
+ # violations.
31
+
32
+ warnings.filterwarnings('error', message='.*invalid UUID.*')
33
+
34
+ # Enable deprecation warnings for taskflow itself to capture upcoming
35
+ # SQLAlchemy changes
36
+ warnings.filterwarnings(
37
+ 'ignore',
38
+ category=sqla_exc.SADeprecationWarning,
39
+ )
40
+
41
+ warnings.filterwarnings(
42
+ 'error',
43
+ module='taskflow',
44
+ category=sqla_exc.SADeprecationWarning,
45
+ )
46
+
47
+ # Enable general SQLAlchemy warnings also to ensure we're not doing
48
+ # silly stuff. It's possible that we'll need to filter things out here
49
+ # with future SQLAlchemy versions, but that's a good thing
50
+ warnings.filterwarnings(
51
+ 'error',
52
+ module='taskflow',
53
+ category=sqla_exc.SAWarning,
54
+ )
55
+ self.addCleanup(self._reset_warning_filters)
56
+
57
+ def _reset_warning_filters(self):
58
+ warnings.filters[:] = self._original_warning_filters
@@ -154,10 +154,10 @@ class UriParseTest(test.TestCase):
154
154
  self.assertEqual('', parsed.path)
155
155
 
156
156
  def test_ipv6_host(self):
157
- url = "rsync://[2001:db8:0:1]:873"
157
+ url = "rsync://[2001:db8:0:1::2]:873"
158
158
  parsed = misc.parse_uri(url)
159
159
  self.assertEqual('rsync', parsed.scheme)
160
- self.assertEqual('2001:db8:0:1', parsed.hostname)
160
+ self.assertEqual('2001:db8:0:1::2', parsed.hostname)
161
161
  self.assertEqual(873, parsed.port)
162
162
 
163
163
  def test_user_password(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: taskflow
3
- Version: 5.2.0
3
+ Version: 5.4.0
4
4
  Summary: Taskflow structured state management library.
5
5
  Home-page: https://docs.openstack.org/taskflow/latest/
6
6
  Author: OpenStack
@@ -8,7 +8,7 @@ Author-email: openstack-discuss@lists.openstack.org
8
8
  License: UNKNOWN
9
9
  Keywords: reliable,tasks,execution,parallel,dataflow,workflows,distributed
10
10
  Platform: UNKNOWN
11
- Classifier: Development Status :: 4 - Beta
11
+ Classifier: Development Status :: 5 - Production/Stable
12
12
  Classifier: Environment :: OpenStack
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: Intended Audience :: Information Technology
@@ -45,7 +45,7 @@ Requires-Dist: psycopg2 (>=2.8.0) ; extra == 'database'
45
45
  Provides-Extra: eventlet
46
46
  Requires-Dist: eventlet (!=0.18.3,!=0.20.1,!=0.21.0,>=0.18.2) ; extra == 'eventlet'
47
47
  Provides-Extra: redis
48
- Requires-Dist: redis (>=2.10.0) ; extra == 'redis'
48
+ Requires-Dist: redis (>=3.0.0) ; extra == 'redis'
49
49
  Provides-Extra: test
50
50
  Requires-Dist: hacking (<0.11,>=0.10.0) ; extra == 'test'
51
51
  Requires-Dist: mock (>=2.0.0) ; extra == 'test'
@@ -9,7 +9,7 @@ taskflow/retry.py,sha256=Dk-IcdPi5n2502fzmVMjrWLzlrXp6h1ak_xOpOWoh6s,14537
9
9
  taskflow/states.py,sha256=3MRdAfs0x94QhDjl-RGyTfxAbkL3APtNr_qQf6apqbE,6901
10
10
  taskflow/storage.py,sha256=HZPfmUhqN33DRO8oo3b9mXQSSSuxt5fKkXVzQTwXPPw,52046
11
11
  taskflow/task.py,sha256=qw79ho1bhwe5KttSPjalfUlCTfLUjNGc1twNdTFMi4w,10052
12
- taskflow/test.py,sha256=nXBrBMTvngfysSTuaNOy14a0yTzax5HSVFFCguXBU0E,10317
12
+ taskflow/test.py,sha256=iIHle3qsM2980YPVfPDMJ8q1bpzqkmQjvreAUlMTrX4,10456
13
13
  taskflow/version.py,sha256=QWhiNICILD4xTAZPrJVUF9dsH-VoCHbHsKuwPA3IMrE,1263
14
14
  taskflow/conductors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  taskflow/conductors/base.py,sha256=k7E_zu9CIORhODWzwmxh7w8fSNhG6dJaYEfLwIxhxXE,7332
@@ -125,7 +125,7 @@ taskflow/persistence/path_based.py,sha256=0d4I9HgTdAhJarxEJkRiZNNxC-M2tbQebeDLby
125
125
  taskflow/persistence/backends/__init__.py,sha256=z5k5CZNjtbKvj2uxqNrdPmREDUGlTMrthcC723gPnsg,3352
126
126
  taskflow/persistence/backends/impl_dir.py,sha256=t8YQe4llF4ghguTh45BBEzRvvtpCllaAbuFZhOY_4os,6085
127
127
  taskflow/persistence/backends/impl_memory.py,sha256=PHKHqeV_KkkwCpT42J2j22o8gfdjAKt3recCP6k5TUw,13390
128
- taskflow/persistence/backends/impl_sqlalchemy.py,sha256=ayEkxlN-vocYZNMyi4HO-8Fhocak8VsPbrN7nqExphQ,25656
128
+ taskflow/persistence/backends/impl_sqlalchemy.py,sha256=4YJp88fb2rfDw6Pxrnfebxpo1DhtY_fu8q_8BEnuwWk,25540
129
129
  taskflow/persistence/backends/impl_zookeeper.py,sha256=PaJmf-xDk7udmYzrMxRM-ARrd1HfAucqQjYIljmpixM,6188
130
130
  taskflow/persistence/backends/sqlalchemy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
131
131
  taskflow/persistence/backends/sqlalchemy/migration.py,sha256=YS4UPcygmYV1lRTogPUuyMM39DupIZ1LwuD23yoaEno,1140
@@ -146,6 +146,7 @@ taskflow/persistence/backends/sqlalchemy/alembic/versions/6df9422fcb43_fix_flowd
146
146
  taskflow/persistence/backends/sqlalchemy/alembic/versions/84d6e888850_add_task_detail_type.py,sha256=PG7eTGhTsmUbnD02Pyn-SQqC5f7544cYdTtvnnE0xBA,1315
147
147
  taskflow/persistence/backends/sqlalchemy/alembic/versions/README,sha256=AwegmiWc0MVoYyckyRzPFV4kVZqs8Q4w6eeMm0K3I_o,38
148
148
  taskflow/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
149
+ taskflow/tests/fixtures.py,sha256=VfGlusX2q79_ktPME4cm1qt_gN9VNRAwyYy5sDBAX0Y,2004
149
150
  taskflow/tests/test_examples.py,sha256=g2zhguLKE4Tex2e_vSmKMhsNXItnKWj89_VbnmgGejU,4925
150
151
  taskflow/tests/utils.py,sha256=P6RPD2w5h00KAse7r31LC9tJils0jaeiUx5QiVqLOA0,11157
151
152
  taskflow/tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -171,7 +172,7 @@ taskflow/tests/unit/test_storage.py,sha256=SlShgJ4hirdnggDkpB3GoosY--4B0PqMOVvMB
171
172
  taskflow/tests/unit/test_suspend.py,sha256=j4M5J2G1aoGUJb111_xUUb0oYJfgRo9hC4ZFyr-00d4,9900
172
173
  taskflow/tests/unit/test_task.py,sha256=PGXlOIhpYdCo8hTScleIHxQ5gGa-1b1MJhwaiB_fQss,15947
173
174
  taskflow/tests/unit/test_types.py,sha256=uecv0lBqPAfAdTDXYMoM8Pi-P9JROR-aA_xkK0trJSQ,20225
174
- taskflow/tests/unit/test_utils.py,sha256=WnTW4hVhq16O0I88K1oMEv1X8x1DMMaK8H_wT2q9W8E,11029
175
+ taskflow/tests/unit/test_utils.py,sha256=m5Wct0kqv8CoX03sUBXcVczAuGcF-AQtbYPxUDq64oo,11035
175
176
  taskflow/tests/unit/test_utils_async_utils.py,sha256=BkVaxbRO3XX2ueAy6kSplq4D1SVos8DOaf9V1mueEf4,981
176
177
  taskflow/tests/unit/test_utils_binary.py,sha256=OdF2BIeUCIP4hXi6QsYv8IqZtDpmqCZySlv5nLZ6UOk,3168
177
178
  taskflow/tests/unit/test_utils_iter_utils.py,sha256=jzUJzUtfL1EPRoQLoUzZ0chlkuTKoqQKHjz7F-LaZ3Y,5716
@@ -231,11 +232,11 @@ taskflow/utils/persistence_utils.py,sha256=GWceOcxdfsf-MtrdR74xmC2khClF8im6DpZmR
231
232
  taskflow/utils/redis_utils.py,sha256=zJBvXmlNZUQ_gwGZAaNLySVtCtou3YayHAkGSCNKDUw,4345
232
233
  taskflow/utils/schema_utils.py,sha256=Zf6eL0NK0_TVFD_Sc1yEZYswFz9K0tet1Dmj48F8uMA,1434
233
234
  taskflow/utils/threading_utils.py,sha256=eiaNUK127DOBr_zfj3-j4Oi5a2dsD7VunVeTYN6NjPo,5849
234
- taskflow-5.2.0.dist-info/AUTHORS,sha256=8LPPL_6_SL4FA3G4Fj_pa8s7JbrrSS3vOkZgjQmB_3k,4485
235
- taskflow-5.2.0.dist-info/LICENSE,sha256=0t4vVm0tDgtQn7DqH6Nmn0kGSrHeIcV0U8qzdQojTo8,10143
236
- taskflow-5.2.0.dist-info/METADATA,sha256=mCTjNSQQ6d7dW7-_Yallj87W2TVCEjRuxDEtIot-y7k,5087
237
- taskflow-5.2.0.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
238
- taskflow-5.2.0.dist-info/entry_points.txt,sha256=MGjjnng_YpSJs9BMAJBC2hJnljMV0pNllXl_5VoHJV0,1183
239
- taskflow-5.2.0.dist-info/pbr.json,sha256=21TJbvAYsMpxXC6nA14I-JZJRWCNcA1fGGFOZBla3iM,47
240
- taskflow-5.2.0.dist-info/top_level.txt,sha256=PsdN41vwysesDlqHCSVVXH4mkTMdMiZFW_yHEAXiZE4,9
241
- taskflow-5.2.0.dist-info/RECORD,,
235
+ taskflow-5.4.0.dist-info/AUTHORS,sha256=8LPPL_6_SL4FA3G4Fj_pa8s7JbrrSS3vOkZgjQmB_3k,4485
236
+ taskflow-5.4.0.dist-info/LICENSE,sha256=0t4vVm0tDgtQn7DqH6Nmn0kGSrHeIcV0U8qzdQojTo8,10143
237
+ taskflow-5.4.0.dist-info/METADATA,sha256=9gmKe2v-5fXSHtdidp4MRp02KT_r_G8Co_99thivb5M,5099
238
+ taskflow-5.4.0.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
239
+ taskflow-5.4.0.dist-info/entry_points.txt,sha256=MGjjnng_YpSJs9BMAJBC2hJnljMV0pNllXl_5VoHJV0,1183
240
+ taskflow-5.4.0.dist-info/pbr.json,sha256=L8tTrR99JPU614KOf2SnnXLM42vcOpjv6SkHE658MRc,47
241
+ taskflow-5.4.0.dist-info/top_level.txt,sha256=PsdN41vwysesDlqHCSVVXH4mkTMdMiZFW_yHEAXiZE4,9
242
+ taskflow-5.4.0.dist-info/RECORD,,
@@ -0,0 +1 @@
1
+ {"git_version": "3b40c045", "is_release": true}
@@ -1 +0,0 @@
1
- {"git_version": "8fc904f5", "is_release": true}