edx-celeryutils 1.3.0__tar.gz → 2.0.0__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.
Files changed (36) hide show
  1. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/CHANGELOG.rst +5 -0
  2. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/PKG-INFO +19 -4
  3. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/__init__.py +1 -1
  4. edx_celeryutils-2.0.0/celery_utils/migrations/0003_rename_failedtask_task_name_exc_idx_failedtask_task_exc.py +18 -0
  5. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/models.py +2 -2
  6. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/edx_celeryutils.egg-info/PKG-INFO +19 -4
  7. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/edx_celeryutils.egg-info/SOURCES.txt +1 -0
  8. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/setup.py +37 -8
  9. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/AUTHORS +0 -0
  10. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/LICENSE.txt +0 -0
  11. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/MANIFEST.in +0 -0
  12. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/README.rst +0 -0
  13. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/admin.py +0 -0
  14. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/apps.py +0 -0
  15. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/logged_task.py +0 -0
  16. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/management/__init__.py +0 -0
  17. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/management/commands/__init__.py +0 -0
  18. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/management/commands/cleanup_resolved_tasks.py +0 -0
  19. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/management/commands/reapply_tasks.py +0 -0
  20. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/management/commands/tests/__init__.py +0 -0
  21. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/management/commands/tests/test_cleanup_resolved_tasks.py +0 -0
  22. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/management/commands/tests/test_reapply_tasks.py +0 -0
  23. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/migrations/0001_initial.py +0 -0
  24. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/migrations/0002_chordable_django_backend.py +0 -0
  25. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/migrations/__init__.py +0 -0
  26. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/persist_on_failure.py +0 -0
  27. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/celery_utils/tasks.py +0 -0
  28. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/edx_celeryutils.egg-info/dependency_links.txt +0 -0
  29. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/edx_celeryutils.egg-info/not-zip-safe +0 -0
  30. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/edx_celeryutils.egg-info/requires.txt +0 -0
  31. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/edx_celeryutils.egg-info/top_level.txt +0 -0
  32. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/requirements/base.in +0 -0
  33. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/requirements/constraints.txt +0 -0
  34. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/setup.cfg +0 -0
  35. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/tests/test_logged_task.py +0 -0
  36. {edx-celeryutils-1.3.0 → edx_celeryutils-2.0.0}/tests/test_persist_on_failure.py +0 -0
@@ -14,6 +14,11 @@ Change Log
14
14
  Unreleased
15
15
  ~~~~~~~~~~
16
16
 
17
+ [1.4.0] - 2024-03-31
18
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19
+ * Added django5.2 support. Adding new migration with index_together change.
20
+ * Dropped Python 3.8 support
21
+
17
22
  [1.3.0] - 2024-03-31
18
23
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19
24
  * Added python3.11 and 3.12 support. Dropped django32 support.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: edx-celeryutils
3
- Version: 1.3.0
3
+ Version: 2.0.0
4
4
  Summary: Code to support working with celery
5
5
  Home-page: https://github.com/openedx/edx-celeryutils
6
6
  Author: edX
@@ -14,15 +14,25 @@ Classifier: Intended Audience :: Developers
14
14
  Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: Natural Language :: English
16
16
  Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.8
18
- Classifier: Programming Language :: Python :: 3.11
19
17
  Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Framework :: Django :: 4.2
19
+ Classifier: Framework :: Django :: 5.2
20
20
  License-File: LICENSE.txt
21
21
  License-File: AUTHORS
22
22
  Requires-Dist: Django
23
23
  Requires-Dist: celery<6.0
24
24
  Requires-Dist: django-model-utils
25
25
  Requires-Dist: jsonfield
26
+ Dynamic: author
27
+ Dynamic: author-email
28
+ Dynamic: classifier
29
+ Dynamic: description
30
+ Dynamic: home-page
31
+ Dynamic: keywords
32
+ Dynamic: license
33
+ Dynamic: license-file
34
+ Dynamic: requires-dist
35
+ Dynamic: summary
26
36
 
27
37
  edx-celeryutils
28
38
  =============================
@@ -123,6 +133,11 @@ Change Log
123
133
  Unreleased
124
134
  ~~~~~~~~~~
125
135
 
136
+ [1.4.0] - 2024-03-31
137
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138
+ * Added django5.2 support. Adding new migration with index_together change.
139
+ * Dropped Python 3.8 support
140
+
126
141
  [1.3.0] - 2024-03-31
127
142
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
128
143
  * Added python3.11 and 3.12 support. Dropped django32 support.
@@ -2,4 +2,4 @@
2
2
  Code to support working with celery.
3
3
  """
4
4
 
5
- __version__ = '1.3.0'
5
+ __version__ = '2.0.0'
@@ -0,0 +1,18 @@
1
+ # Generated by Django 4.2.11 on 2025-04-09 02:33
2
+
3
+ from django.db import migrations
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('celery_utils', '0002_chordable_django_backend'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.RenameIndex(
14
+ model_name='failedtask',
15
+ new_name='idx_failedtask_task_exc',
16
+ old_fields=('task_name', 'exc'),
17
+ ),
18
+ ]
@@ -39,8 +39,8 @@ class FailedTask(TimeStampedModel):
39
39
  To specify any metadata for FailedTask model.
40
40
  """
41
41
 
42
- index_together = [
43
- ('task_name', 'exc'),
42
+ indexes = [
43
+ models.Index(fields=['task_name', 'exc'], name='idx_failedtask_task_exc')
44
44
  ]
45
45
 
46
46
  def reapply(self):
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: edx-celeryutils
3
- Version: 1.3.0
3
+ Version: 2.0.0
4
4
  Summary: Code to support working with celery
5
5
  Home-page: https://github.com/openedx/edx-celeryutils
6
6
  Author: edX
@@ -14,15 +14,25 @@ Classifier: Intended Audience :: Developers
14
14
  Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: Natural Language :: English
16
16
  Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.8
18
- Classifier: Programming Language :: Python :: 3.11
19
17
  Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Framework :: Django :: 4.2
19
+ Classifier: Framework :: Django :: 5.2
20
20
  License-File: LICENSE.txt
21
21
  License-File: AUTHORS
22
22
  Requires-Dist: Django
23
23
  Requires-Dist: celery<6.0
24
24
  Requires-Dist: django-model-utils
25
25
  Requires-Dist: jsonfield
26
+ Dynamic: author
27
+ Dynamic: author-email
28
+ Dynamic: classifier
29
+ Dynamic: description
30
+ Dynamic: home-page
31
+ Dynamic: keywords
32
+ Dynamic: license
33
+ Dynamic: license-file
34
+ Dynamic: requires-dist
35
+ Dynamic: summary
26
36
 
27
37
  edx-celeryutils
28
38
  =============================
@@ -123,6 +133,11 @@ Change Log
123
133
  Unreleased
124
134
  ~~~~~~~~~~
125
135
 
136
+ [1.4.0] - 2024-03-31
137
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138
+ * Added django5.2 support. Adding new migration with index_together change.
139
+ * Dropped Python 3.8 support
140
+
126
141
  [1.3.0] - 2024-03-31
127
142
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
128
143
  * Added python3.11 and 3.12 support. Dropped django32 support.
@@ -21,6 +21,7 @@ celery_utils/management/commands/tests/test_cleanup_resolved_tasks.py
21
21
  celery_utils/management/commands/tests/test_reapply_tasks.py
22
22
  celery_utils/migrations/0001_initial.py
23
23
  celery_utils/migrations/0002_chordable_django_backend.py
24
+ celery_utils/migrations/0003_rename_failedtask_task_name_exc_idx_failedtask_task_exc.py
24
25
  celery_utils/migrations/__init__.py
25
26
  edx_celeryutils.egg-info/PKG-INFO
26
27
  edx_celeryutils.egg-info/SOURCES.txt
@@ -32,20 +32,48 @@ def load_requirements(*requirements_paths):
32
32
  """
33
33
  # UPDATED VIA SEMGREP - if you need to remove/modify this method remove this line and add a comment specifying why.
34
34
 
35
+ # e.g. {"django": "Django", "confluent-kafka": "confluent_kafka[avro]"}
36
+ by_canonical_name = {}
37
+
38
+ def check_name_consistent(package):
39
+ """
40
+ Raise exception if package is named different ways.
41
+
42
+ This ensures that packages are named consistently so we can match
43
+ constraints to packages. It also ensures that if we require a package
44
+ with extras we don't constrain it without mentioning the extras (since
45
+ that too would interfere with matching constraints.)
46
+ """
47
+ canonical = package.lower().replace('_', '-').split('[')[0]
48
+ seen_spelling = by_canonical_name.get(canonical)
49
+ if seen_spelling is None:
50
+ by_canonical_name[canonical] = package
51
+ elif seen_spelling != package:
52
+ raise Exception(
53
+ f'Encountered both "{seen_spelling}" and "{package}" in requirements '
54
+ 'and constraints files; please use just one or the other.'
55
+ )
56
+
35
57
  requirements = {}
36
58
  constraint_files = set()
37
59
 
38
- # groups "my-package-name<=x.y.z,..." into ("my-package-name", "<=x.y.z,...")
39
- requirement_line_regex = re.compile(r"([a-zA-Z0-9-_.]+)([<>=][^#\s]+)?")
60
+ # groups "pkg<=x.y.z,..." into ("pkg", "<=x.y.z,...")
61
+ re_package_name_base_chars = r"a-zA-Z0-9\-_." # chars allowed in base package name
62
+ # Two groups: name[maybe,extras], and optionally a constraint
63
+ requirement_line_regex = re.compile(
64
+ r"([%s]+(?:\[[%s,\s]+\])?)([<>=][^#\s]+)?"
65
+ % (re_package_name_base_chars, re_package_name_base_chars)
66
+ )
40
67
 
41
68
  def add_version_constraint_or_raise(current_line, current_requirements, add_if_not_present):
42
69
  regex_match = requirement_line_regex.match(current_line)
43
70
  if regex_match:
44
71
  package = regex_match.group(1)
45
72
  version_constraints = regex_match.group(2)
73
+ check_name_consistent(package)
46
74
  existing_version_constraints = current_requirements.get(package, None)
47
- # it's fine to add constraints to an unconstrained package, but raise an error if there are already
48
- # constraints in place
75
+ # It's fine to add constraints to an unconstrained package,
76
+ # but raise an error if there are already constraints in place.
49
77
  if existing_version_constraints and existing_version_constraints != version_constraints:
50
78
  raise BaseException(f'Multiple constraint definitions found for {package}:'
51
79
  f' "{existing_version_constraints}" and "{version_constraints}".'
@@ -54,7 +82,8 @@ def load_requirements(*requirements_paths):
54
82
  if add_if_not_present or package in current_requirements:
55
83
  current_requirements[package] = version_constraints
56
84
 
57
- # process .in files and store the path to any constraint files that are pulled in
85
+ # Read requirements from .in files and store the path to any
86
+ # constraint files that are pulled in.
58
87
  for path in requirements_paths:
59
88
  with open(path) as reqs:
60
89
  for line in reqs:
@@ -63,7 +92,7 @@ def load_requirements(*requirements_paths):
63
92
  if line and line.startswith('-c') and not line.startswith('-c http'):
64
93
  constraint_files.add(os.path.dirname(path) + '/' + line.split('#')[0].replace('-c', '').strip())
65
94
 
66
- # process constraint files and add any new constraints found to existing requirements
95
+ # process constraint files: add constraints to existing requirements
67
96
  for constraint_file in constraint_files:
68
97
  with open(constraint_file) as reader:
69
98
  for line in reader:
@@ -123,8 +152,8 @@ setup(
123
152
  'License :: OSI Approved :: Apache Software License',
124
153
  'Natural Language :: English',
125
154
  'Programming Language :: Python :: 3',
126
- 'Programming Language :: Python :: 3.8',
127
- 'Programming Language :: Python :: 3.11',
128
155
  'Programming Language :: Python :: 3.12',
156
+ 'Framework :: Django :: 4.2',
157
+ 'Framework :: Django :: 5.2',
129
158
  ],
130
159
  )
File without changes