code-annotations 1.7.0__tar.gz → 1.8.1__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 (47) hide show
  1. {code-annotations-1.7.0 → code-annotations-1.8.1}/CHANGELOG.rst +12 -0
  2. {code-annotations-1.7.0 → code-annotations-1.8.1}/PKG-INFO +17 -4
  3. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/__init__.py +1 -1
  4. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/base.py +2 -2
  5. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/cli.py +9 -9
  6. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/contrib/sphinx/extensions/featuretoggles.py +1 -1
  7. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/generate_docs.py +1 -1
  8. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations.egg-info/PKG-INFO +17 -4
  9. {code-annotations-1.7.0 → code-annotations-1.8.1}/setup.py +2 -1
  10. {code-annotations-1.7.0 → code-annotations-1.8.1}/LICENSE.txt +0 -0
  11. {code-annotations-1.7.0 → code-annotations-1.8.1}/MANIFEST.in +0 -0
  12. {code-annotations-1.7.0 → code-annotations-1.8.1}/NOTICE.txt +0 -0
  13. {code-annotations-1.7.0 → code-annotations-1.8.1}/README.rst +0 -0
  14. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/annotation_errors.py +0 -0
  15. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/contrib/config/__init__.py +0 -0
  16. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/contrib/config/feature_toggle_annotations.yaml +0 -0
  17. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/contrib/config/openedx_events_annotations.yaml +0 -0
  18. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/contrib/config/setting_annotations.yaml +0 -0
  19. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/contrib/sphinx/extensions/__init__.py +0 -0
  20. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/contrib/sphinx/extensions/base.py +0 -0
  21. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/contrib/sphinx/extensions/openedx_events.py +0 -0
  22. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/contrib/sphinx/extensions/settings.py +0 -0
  23. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/exceptions.py +0 -0
  24. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/extensions/__init__.py +0 -0
  25. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/extensions/base.py +0 -0
  26. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/extensions/javascript.py +0 -0
  27. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/extensions/python.py +0 -0
  28. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/find_django.py +0 -0
  29. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/find_static.py +0 -0
  30. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations/helpers.py +0 -0
  31. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations.egg-info/SOURCES.txt +0 -0
  32. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations.egg-info/dependency_links.txt +0 -0
  33. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations.egg-info/entry_points.txt +0 -0
  34. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations.egg-info/not-zip-safe +0 -0
  35. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations.egg-info/requires.txt +2 -2
  36. {code-annotations-1.7.0 → code-annotations-1.8.1}/code_annotations.egg-info/top_level.txt +0 -0
  37. {code-annotations-1.7.0 → code-annotations-1.8.1}/requirements/base.in +0 -0
  38. {code-annotations-1.7.0 → code-annotations-1.8.1}/setup.cfg +0 -0
  39. {code-annotations-1.7.0 → code-annotations-1.8.1}/tests/test_base.py +0 -0
  40. {code-annotations-1.7.0 → code-annotations-1.8.1}/tests/test_django_coverage.py +0 -0
  41. {code-annotations-1.7.0 → code-annotations-1.8.1}/tests/test_django_generate_safelist.py +0 -0
  42. {code-annotations-1.7.0 → code-annotations-1.8.1}/tests/test_django_list_local_models.py +0 -0
  43. {code-annotations-1.7.0 → code-annotations-1.8.1}/tests/test_find_django.py +0 -0
  44. {code-annotations-1.7.0 → code-annotations-1.8.1}/tests/test_find_static.py +0 -0
  45. {code-annotations-1.7.0 → code-annotations-1.8.1}/tests/test_generate_docs.py +0 -0
  46. {code-annotations-1.7.0 → code-annotations-1.8.1}/tests/test_search.py +0 -0
  47. {code-annotations-1.7.0 → code-annotations-1.8.1}/tests/test_sphinx.py +0 -0
@@ -14,6 +14,18 @@ Change Log
14
14
  Unreleased
15
15
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16
16
 
17
+ [1.8.1] - 2024-07-11
18
+ ~~~~~~~~~~~~~~~~~~~~
19
+
20
+ * Fix elapsed-time calculations to always use UTC. Other clocks can be altered partway through by Django config settings being loaded while the timer is running, resulting in reporting elapsed time of "-17999.895582 seconds" or similar.
21
+ * Fix report filename to use year-month-day order, not year-day-month. (Also more compact, now.)
22
+
23
+ [1.8.0] - 2024-03-31
24
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25
+
26
+ * Added python3.11 and 3.12 support. Dropped django32 support.
27
+
28
+
17
29
  [1.6.0] - 2024-01-31
18
30
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19
31
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code-annotations
3
- Version: 1.7.0
3
+ Version: 1.8.1
4
4
  Summary: Extensible tools for parsing annotations in codebases
5
5
  Home-page: https://github.com/openedx/code-annotations
6
6
  Author: edX
@@ -9,7 +9,6 @@ License: Apache Software License 2.0
9
9
  Keywords: edx pii code annotations
10
10
  Classifier: Development Status :: 3 - Alpha
11
11
  Classifier: Framework :: Django
12
- Classifier: Framework :: Django :: 3.2
13
12
  Classifier: Framework :: Django :: 4.2
14
13
  Classifier: Intended Audience :: Developers
15
14
  Classifier: License :: OSI Approved :: Apache Software License
@@ -17,14 +16,16 @@ Classifier: Natural Language :: English
17
16
  Classifier: Programming Language :: Python
18
17
  Classifier: Programming Language :: Python :: 3
19
18
  Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
20
21
  Description-Content-Type: text/x-rst
21
22
  License-File: LICENSE.txt
22
23
  License-File: NOTICE.txt
23
- Requires-Dist: python-slugify
24
24
  Requires-Dist: click
25
+ Requires-Dist: Jinja2
25
26
  Requires-Dist: pyyaml
27
+ Requires-Dist: python-slugify
26
28
  Requires-Dist: stevedore
27
- Requires-Dist: Jinja2
28
29
  Provides-Extra: django
29
30
  Requires-Dist: Django<2.3,>=2.2; extra == "django"
30
31
 
@@ -128,6 +129,18 @@ Change Log
128
129
  Unreleased
129
130
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130
131
 
132
+ [1.8.1] - 2024-07-11
133
+ ~~~~~~~~~~~~~~~~~~~~
134
+
135
+ * Fix elapsed-time calculations to always use UTC. Other clocks can be altered partway through by Django config settings being loaded while the timer is running, resulting in reporting elapsed time of "-17999.895582 seconds" or similar.
136
+ * Fix report filename to use year-month-day order, not year-day-month. (Also more compact, now.)
137
+
138
+ [1.8.0] - 2024-03-31
139
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
140
+
141
+ * Added python3.11 and 3.12 support. Dropped django32 support.
142
+
143
+
131
144
  [1.6.0] - 2024-01-31
132
145
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133
146
 
@@ -2,4 +2,4 @@
2
2
  Extensible tools for parsing annotations in codebases.
3
3
  """
4
4
 
5
- __version__ = '1.7.0'
5
+ __version__ = '1.8.1'
@@ -616,9 +616,9 @@ class BaseSearch(metaclass=ABCMeta):
616
616
  """
617
617
  self.echo.echo_vv(yaml.dump(all_results, default_flow_style=False))
618
618
 
619
- now = datetime.datetime.now()
619
+ now = datetime.datetime.utcnow()
620
620
  report_filename = os.path.join(self.config.report_path, '{}{}.yaml'.format(
621
- report_prefix, now.strftime('%Y-%d-%m-%H-%M-%S')
621
+ report_prefix, now.strftime('%Y%m%d-%H%M%S')
622
622
  ))
623
623
 
624
624
  formatted_results = self._format_results_for_report(all_results)
@@ -61,7 +61,7 @@ def django_find_annotations(
61
61
  Subcommand for dealing with annotations in Django models.
62
62
  """
63
63
  try:
64
- start_time = datetime.datetime.now()
64
+ start_time = datetime.datetime.utcnow()
65
65
  config = AnnotationConfig(config_file, report_path, verbosity)
66
66
  searcher = DjangoSearch(config)
67
67
 
@@ -106,12 +106,12 @@ def django_find_annotations(
106
106
  for filename in annotated_models:
107
107
  annotation_count += len(annotated_models[filename])
108
108
 
109
- elapsed = datetime.datetime.now() - start_time
109
+ elapsed = datetime.datetime.utcnow() - start_time
110
110
  click.echo("Search found {} annotations in {} seconds.".format(
111
111
  annotation_count, elapsed.total_seconds()
112
112
  ))
113
113
 
114
- except Exception as exc: # pylint: disable=broad-except
114
+ except Exception as exc:
115
115
  click.echo(traceback.print_exc())
116
116
  fail(str(exc))
117
117
 
@@ -137,7 +137,7 @@ def static_find_annotations(config_file, source_path, report_path, verbosity, li
137
137
  Subcommand to find annotations via static file analysis.
138
138
  """
139
139
  try:
140
- start_time = datetime.datetime.now()
140
+ start_time = datetime.datetime.utcnow()
141
141
  config = AnnotationConfig(config_file, report_path, verbosity, source_path)
142
142
  searcher = StaticSearch(config)
143
143
  all_results = searcher.search()
@@ -161,7 +161,7 @@ def static_find_annotations(config_file, source_path, report_path, verbosity, li
161
161
  report_filename = searcher.report(all_results)
162
162
  click.echo(f"Report written to {report_filename}.")
163
163
 
164
- elapsed = datetime.datetime.now() - start_time
164
+ elapsed = datetime.datetime.utcnow() - start_time
165
165
  annotation_count = 0
166
166
 
167
167
  for filename in all_results:
@@ -169,7 +169,7 @@ def static_find_annotations(config_file, source_path, report_path, verbosity, li
169
169
 
170
170
  click.echo(f"Search found {annotation_count} annotations in {elapsed}.")
171
171
 
172
- except Exception as exc: # pylint: disable=broad-except
172
+ except Exception as exc:
173
173
  click.echo(traceback.print_exc())
174
174
  fail(str(exc))
175
175
 
@@ -191,7 +191,7 @@ def generate_docs(
191
191
  """
192
192
  Generate documentation from a code annotations report.
193
193
  """
194
- start_time = datetime.datetime.now()
194
+ start_time = datetime.datetime.utcnow()
195
195
 
196
196
  try:
197
197
  config = AnnotationConfig(config_file, verbosity)
@@ -210,8 +210,8 @@ def generate_docs(
210
210
  renderer = ReportRenderer(config, report_files)
211
211
  renderer.render()
212
212
 
213
- elapsed = datetime.datetime.now() - start_time
213
+ elapsed = datetime.datetime.utcnow() - start_time
214
214
  click.echo(f"Report rendered in {elapsed.total_seconds()} seconds.")
215
- except Exception as exc: # pylint: disable=broad-except
215
+ except Exception as exc:
216
216
  click.echo(traceback.print_exc())
217
217
  fail(str(exc))
@@ -111,7 +111,7 @@ class FeatureToggles(SphinxDirective):
111
111
  for opt in optional_attrs:
112
112
  if toggle.get(f".. toggle_{opt}:") not in (None, "None", "n/a", "N/A"):
113
113
  toggle_section += nodes.paragraph(
114
- text=f'{opt.title().replace("_"," ")}: {toggle[f".. toggle_{opt}:"]}',
114
+ text=f'{opt.title().replace("_", " ")}: {toggle[f".. toggle_{opt}:"]}',
115
115
  ids=[f"{opt}-{toggle_name}"],
116
116
  )
117
117
  yield toggle_section
@@ -27,7 +27,7 @@ class ReportRenderer:
27
27
  self.config = config
28
28
  self.echo = self.config.echo
29
29
  self.report_files = report_files
30
- self.create_time = datetime.datetime.now().isoformat()
30
+ self.create_time = datetime.datetime.utcnow().isoformat()
31
31
 
32
32
  self.full_report = self._aggregate_reports()
33
33
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code-annotations
3
- Version: 1.7.0
3
+ Version: 1.8.1
4
4
  Summary: Extensible tools for parsing annotations in codebases
5
5
  Home-page: https://github.com/openedx/code-annotations
6
6
  Author: edX
@@ -9,7 +9,6 @@ License: Apache Software License 2.0
9
9
  Keywords: edx pii code annotations
10
10
  Classifier: Development Status :: 3 - Alpha
11
11
  Classifier: Framework :: Django
12
- Classifier: Framework :: Django :: 3.2
13
12
  Classifier: Framework :: Django :: 4.2
14
13
  Classifier: Intended Audience :: Developers
15
14
  Classifier: License :: OSI Approved :: Apache Software License
@@ -17,14 +16,16 @@ Classifier: Natural Language :: English
17
16
  Classifier: Programming Language :: Python
18
17
  Classifier: Programming Language :: Python :: 3
19
18
  Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
20
21
  Description-Content-Type: text/x-rst
21
22
  License-File: LICENSE.txt
22
23
  License-File: NOTICE.txt
23
- Requires-Dist: python-slugify
24
24
  Requires-Dist: click
25
+ Requires-Dist: Jinja2
25
26
  Requires-Dist: pyyaml
27
+ Requires-Dist: python-slugify
26
28
  Requires-Dist: stevedore
27
- Requires-Dist: Jinja2
28
29
  Provides-Extra: django
29
30
  Requires-Dist: Django<2.3,>=2.2; extra == "django"
30
31
 
@@ -128,6 +129,18 @@ Change Log
128
129
  Unreleased
129
130
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130
131
 
132
+ [1.8.1] - 2024-07-11
133
+ ~~~~~~~~~~~~~~~~~~~~
134
+
135
+ * Fix elapsed-time calculations to always use UTC. Other clocks can be altered partway through by Django config settings being loaded while the timer is running, resulting in reporting elapsed time of "-17999.895582 seconds" or similar.
136
+ * Fix report filename to use year-month-day order, not year-day-month. (Also more compact, now.)
137
+
138
+ [1.8.0] - 2024-03-31
139
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
140
+
141
+ * Added python3.11 and 3.12 support. Dropped django32 support.
142
+
143
+
131
144
  [1.6.0] - 2024-01-31
132
145
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133
146
 
@@ -97,7 +97,6 @@ setup(
97
97
  classifiers=[
98
98
  'Development Status :: 3 - Alpha',
99
99
  'Framework :: Django',
100
- 'Framework :: Django :: 3.2',
101
100
  'Framework :: Django :: 4.2',
102
101
  'Intended Audience :: Developers',
103
102
  'License :: OSI Approved :: Apache Software License',
@@ -105,5 +104,7 @@ setup(
105
104
  'Programming Language :: Python',
106
105
  'Programming Language :: Python :: 3',
107
106
  'Programming Language :: Python :: 3.8',
107
+ 'Programming Language :: Python :: 3.11',
108
+ 'Programming Language :: Python :: 3.12',
108
109
  ],
109
110
  )
@@ -1,8 +1,8 @@
1
- python-slugify
2
1
  click
2
+ Jinja2
3
3
  pyyaml
4
+ python-slugify
4
5
  stevedore
5
- Jinja2
6
6
 
7
7
  [django]
8
8
  Django<2.3,>=2.2