code-annotations 3.0.0__tar.gz → 3.1.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 (161) hide show
  1. code_annotations-3.1.0/.annotations_sample +21 -0
  2. code_annotations-3.1.0/.github/ISSUE_TEMPLATE.md +15 -0
  3. code_annotations-3.1.0/.github/PULL_REQUEST_TEMPLATE.md +38 -0
  4. code_annotations-3.1.0/.github/dependabot.yml +7 -0
  5. code_annotations-3.1.0/.github/workflows/add-depr-ticket-to-depr-board.yml +19 -0
  6. code_annotations-3.1.0/.github/workflows/add-remove-label-on-comment.yml +20 -0
  7. code_annotations-3.1.0/.github/workflows/ci.yml +41 -0
  8. code_annotations-3.1.0/.github/workflows/commitlint.yml +10 -0
  9. code_annotations-3.1.0/.github/workflows/release.yml +118 -0
  10. code_annotations-3.1.0/.github/workflows/self-assign-issue.yml +12 -0
  11. code_annotations-3.1.0/.github/workflows/upgrade-python-requirements.yml +31 -0
  12. code_annotations-3.1.0/.gitignore +77 -0
  13. code_annotations-3.1.0/.readthedocs.yml +23 -0
  14. code_annotations-3.1.0/MANIFEST.in +6 -0
  15. code_annotations-3.1.0/Makefile +63 -0
  16. code_annotations-3.1.0/PKG-INFO +82 -0
  17. code_annotations-3.1.0/catalog-info.yaml +12 -0
  18. code_annotations-3.1.0/codecov.yml +12 -0
  19. code_annotations-3.1.0/docs/Makefile +230 -0
  20. code_annotations-3.1.0/docs/_static/theme_overrides.css +10 -0
  21. code_annotations-3.1.0/docs/changelog.rst +1 -0
  22. code_annotations-3.1.0/docs/conf.py +512 -0
  23. code_annotations-3.1.0/docs/configuration.rst +97 -0
  24. code_annotations-3.1.0/docs/contrib/how_to/add_new_annotations_and_extracted_docs.rst +33 -0
  25. code_annotations-3.1.0/docs/contrib/how_to/documenting_django_settings.rst +64 -0
  26. code_annotations-3.1.0/docs/contrib/sphinx_extensions.rst +45 -0
  27. code_annotations-3.1.0/docs/decisions/0001-config-and-tools.rst +33 -0
  28. code_annotations-3.1.0/docs/django_search.rst +122 -0
  29. code_annotations-3.1.0/docs/extensions.rst +55 -0
  30. code_annotations-3.1.0/docs/getting_started.rst +142 -0
  31. code_annotations-3.1.0/docs/index.rst +42 -0
  32. code_annotations-3.1.0/docs/make.bat +281 -0
  33. code_annotations-3.1.0/docs/readme.rst +1 -0
  34. code_annotations-3.1.0/docs/static_search.rst +60 -0
  35. code_annotations-3.1.0/docs/testing.rst +44 -0
  36. code_annotations-3.1.0/docs/writing_annotations.rst +236 -0
  37. code_annotations-3.1.0/openedx.yaml +14 -0
  38. code_annotations-3.1.0/pylintrc +386 -0
  39. code_annotations-3.1.0/pylintrc_tweaks +9 -0
  40. code_annotations-3.1.0/pyproject.toml +140 -0
  41. code_annotations-3.1.0/setup.cfg +4 -0
  42. code_annotations-3.1.0/src/code_annotations/__init__.py +6 -0
  43. code_annotations-3.1.0/src/code_annotations/contrib/README.rst +8 -0
  44. code_annotations-3.1.0/src/code_annotations.egg-info/PKG-INFO +82 -0
  45. code_annotations-3.1.0/src/code_annotations.egg-info/SOURCES.txt +150 -0
  46. code_annotations-3.1.0/src/code_annotations.egg-info/scm_file_list.json +147 -0
  47. code_annotations-3.1.0/test_utils/__init__.py +7 -0
  48. code_annotations-3.1.0/tests/__init__.py +3 -0
  49. code_annotations-3.1.0/tests/extensions/__init__.py +3 -0
  50. code_annotations-3.1.0/tests/extensions/base_test_files/empty.foo +0 -0
  51. code_annotations-3.1.0/tests/extensions/javascript_test_files/choice_failures_1.js +6 -0
  52. code_annotations-3.1.0/tests/extensions/javascript_test_files/choice_failures_2.js +6 -0
  53. code_annotations-3.1.0/tests/extensions/javascript_test_files/choice_failures_3.js +5 -0
  54. code_annotations-3.1.0/tests/extensions/javascript_test_files/choice_failures_4.js +5 -0
  55. code_annotations-3.1.0/tests/extensions/javascript_test_files/choice_failures_5.js +5 -0
  56. code_annotations-3.1.0/tests/extensions/javascript_test_files/group_failures_1.js +7 -0
  57. code_annotations-3.1.0/tests/extensions/javascript_test_files/group_failures_2.js +7 -0
  58. code_annotations-3.1.0/tests/extensions/javascript_test_files/group_failures_4.js +10 -0
  59. code_annotations-3.1.0/tests/extensions/javascript_test_files/group_failures_5.js +10 -0
  60. code_annotations-3.1.0/tests/extensions/javascript_test_files/group_ordering_1.js +8 -0
  61. code_annotations-3.1.0/tests/extensions/javascript_test_files/group_ordering_2.js +30 -0
  62. code_annotations-3.1.0/tests/extensions/javascript_test_files/simple_success.js +63 -0
  63. code_annotations-3.1.0/tests/extensions/python_test_files/choice_failures_1.pyt +6 -0
  64. code_annotations-3.1.0/tests/extensions/python_test_files/choice_failures_2.pyt +6 -0
  65. code_annotations-3.1.0/tests/extensions/python_test_files/choice_failures_3.pyt +5 -0
  66. code_annotations-3.1.0/tests/extensions/python_test_files/choice_failures_4.pyt +5 -0
  67. code_annotations-3.1.0/tests/extensions/python_test_files/choice_failures_5.pyt +5 -0
  68. code_annotations-3.1.0/tests/extensions/python_test_files/group_failures_1.pyt +7 -0
  69. code_annotations-3.1.0/tests/extensions/python_test_files/group_failures_2.pyt +7 -0
  70. code_annotations-3.1.0/tests/extensions/python_test_files/group_ordering_1.pyt +8 -0
  71. code_annotations-3.1.0/tests/extensions/python_test_files/group_ordering_2.pyt +23 -0
  72. code_annotations-3.1.0/tests/extensions/python_test_files/multiline_empty_first_line.pyt +7 -0
  73. code_annotations-3.1.0/tests/extensions/python_test_files/multiline_indented.pyt +6 -0
  74. code_annotations-3.1.0/tests/extensions/python_test_files/multiline_paragraphs.pyt +15 -0
  75. code_annotations-3.1.0/tests/extensions/python_test_files/multiline_simple.pyt +8 -0
  76. code_annotations-3.1.0/tests/extensions/python_test_files/multiline_singlelinecomment.pyt +7 -0
  77. code_annotations-3.1.0/tests/extensions/python_test_files/no_annotations.pyt +3 -0
  78. code_annotations-3.1.0/tests/extensions/python_test_files/simple_success.pyt +60 -0
  79. code_annotations-3.1.0/tests/extensions/test_base_extensions.py +46 -0
  80. code_annotations-3.1.0/tests/extensions/test_extension_javascript.py +35 -0
  81. code_annotations-3.1.0/tests/extensions/test_extension_python.py +99 -0
  82. code_annotations-3.1.0/tests/fake_models.py +150 -0
  83. code_annotations-3.1.0/tests/helpers.py +180 -0
  84. code_annotations-3.1.0/tests/simple_success.nothing +1 -0
  85. code_annotations-3.1.0/tests/test_configurations/.annotations_test +22 -0
  86. code_annotations-3.1.0/tests/test_configurations/.annotations_test_coverage_int +20 -0
  87. code_annotations-3.1.0/tests/test_configurations/.annotations_test_coverage_nan +20 -0
  88. code_annotations-3.1.0/tests/test_configurations/.annotations_test_coverage_negative +20 -0
  89. code_annotations-3.1.0/tests/test_configurations/.annotations_test_coverage_none +20 -0
  90. code_annotations-3.1.0/tests/test_configurations/.annotations_test_coverage_over_100 +20 -0
  91. code_annotations-3.1.0/tests/test_configurations/.annotations_test_duplicate_token +21 -0
  92. code_annotations-3.1.0/tests/test_configurations/.annotations_test_duplicate_token_2_groups +23 -0
  93. code_annotations-3.1.0/tests/test_configurations/.annotations_test_group_bad_type +21 -0
  94. code_annotations-3.1.0/tests/test_configurations/.annotations_test_group_no_annotations +15 -0
  95. code_annotations-3.1.0/tests/test_configurations/.annotations_test_group_one_token +16 -0
  96. code_annotations-3.1.0/tests/test_configurations/.annotations_test_missing_coverage_target +19 -0
  97. code_annotations-3.1.0/tests/test_configurations/.annotations_test_missing_extension +17 -0
  98. code_annotations-3.1.0/tests/test_configurations/.annotations_test_missing_report_path +16 -0
  99. code_annotations-3.1.0/tests/test_configurations/.annotations_test_missing_safelist_path +19 -0
  100. code_annotations-3.1.0/tests/test_configurations/.annotations_test_missing_source_path +16 -0
  101. code_annotations-3.1.0/tests/test_configurations/.annotations_test_python_only +17 -0
  102. code_annotations-3.1.0/tests/test_configurations/.annotations_test_success_with_report_docs +22 -0
  103. code_annotations-3.1.0/tests/test_configurations/.annotations_test_success_with_report_docs_html +26 -0
  104. code_annotations-3.1.0/tox.ini +59 -0
  105. code_annotations-3.1.0/uv.lock +1858 -0
  106. code_annotations-3.0.0/MANIFEST.in +0 -7
  107. code_annotations-3.0.0/PKG-INFO +0 -297
  108. code_annotations-3.0.0/code_annotations/__init__.py +0 -5
  109. code_annotations-3.0.0/code_annotations.egg-info/PKG-INFO +0 -297
  110. code_annotations-3.0.0/code_annotations.egg-info/SOURCES.txt +0 -55
  111. code_annotations-3.0.0/code_annotations.egg-info/not-zip-safe +0 -1
  112. code_annotations-3.0.0/requirements/base.in +0 -9
  113. code_annotations-3.0.0/setup.cfg +0 -13
  114. code_annotations-3.0.0/setup.py +0 -110
  115. {code_annotations-3.0.0 → code_annotations-3.1.0}/CHANGELOG.rst +0 -0
  116. {code_annotations-3.0.0 → code_annotations-3.1.0}/LICENSE.txt +0 -0
  117. {code_annotations-3.0.0 → code_annotations-3.1.0}/NOTICE.txt +0 -0
  118. {code_annotations-3.0.0 → code_annotations-3.1.0}/README.rst +0 -0
  119. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/annotation_errors.py +0 -0
  120. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/base.py +0 -0
  121. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/cli.py +0 -0
  122. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/contrib/config/__init__.py +0 -0
  123. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/contrib/config/feature_toggle_annotations.yaml +0 -0
  124. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/contrib/config/openedx_events_annotations.yaml +0 -0
  125. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/contrib/config/setting_annotations.yaml +0 -0
  126. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/contrib/sphinx/extensions/__init__.py +0 -0
  127. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/contrib/sphinx/extensions/base.py +0 -0
  128. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/contrib/sphinx/extensions/featuretoggles.py +0 -0
  129. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/contrib/sphinx/extensions/openedx_events.py +0 -0
  130. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/contrib/sphinx/extensions/settings.py +0 -0
  131. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/exceptions.py +0 -0
  132. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/extensions/__init__.py +0 -0
  133. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/extensions/base.py +0 -0
  134. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/extensions/javascript.py +0 -0
  135. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/extensions/python.py +0 -0
  136. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/find_django.py +0 -0
  137. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/find_static.py +0 -0
  138. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/generate_docs.py +0 -0
  139. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/helpers.py +0 -0
  140. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/report_templates/html/annotation.tpl +0 -0
  141. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/report_templates/html/annotation_data.tpl +0 -0
  142. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/report_templates/html/annotation_list.tpl +0 -0
  143. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/report_templates/html/base.tpl +0 -0
  144. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/report_templates/rst/annotation.tpl +0 -0
  145. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/report_templates/rst/annotation_data.tpl +0 -0
  146. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/report_templates/rst/annotation_group.tpl +0 -0
  147. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/report_templates/rst/annotation_list.tpl +0 -0
  148. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations/report_templates/rst/base.tpl +0 -0
  149. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations.egg-info/dependency_links.txt +0 -0
  150. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations.egg-info/entry_points.txt +0 -0
  151. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations.egg-info/requires.txt +0 -0
  152. {code_annotations-3.0.0 → code_annotations-3.1.0/src}/code_annotations.egg-info/top_level.txt +0 -0
  153. {code_annotations-3.0.0 → code_annotations-3.1.0}/tests/test_base.py +0 -0
  154. {code_annotations-3.0.0 → code_annotations-3.1.0}/tests/test_django_coverage.py +0 -0
  155. {code_annotations-3.0.0 → code_annotations-3.1.0}/tests/test_django_generate_safelist.py +0 -0
  156. {code_annotations-3.0.0 → code_annotations-3.1.0}/tests/test_django_list_local_models.py +0 -0
  157. {code_annotations-3.0.0 → code_annotations-3.1.0}/tests/test_find_django.py +0 -0
  158. {code_annotations-3.0.0 → code_annotations-3.1.0}/tests/test_find_static.py +0 -0
  159. {code_annotations-3.0.0 → code_annotations-3.1.0}/tests/test_generate_docs.py +0 -0
  160. {code_annotations-3.0.0 → code_annotations-3.1.0}/tests/test_search.py +0 -0
  161. {code_annotations-3.0.0 → code_annotations-3.1.0}/tests/test_sphinx.py +0 -0
@@ -0,0 +1,21 @@
1
+ source_path: ./
2
+ report_path: reports
3
+ safelist_path: .annotation_safe_list.yml
4
+ coverage_target: 50.0
5
+ report_template_dir: code_annotations/report_templates/
6
+ rendered_report_dir: code_annotations/reports/
7
+ rendered_report_file_extension: .rst
8
+ rendered_report_source_link_prefix: https://github.com/openedx/edx-platform/tree/master/
9
+ annotations:
10
+ ".. no_pii:":
11
+ ".. ignored:":
12
+ choices: [irrelevant, terrible, silly-silly]
13
+ "pii_group":
14
+ - ".. pii:":
15
+ - ".. pii_types:":
16
+ choices: [id, name, other]
17
+ - ".. pii_retirement:":
18
+ choices: [retained, local_api, consumer_api, third_party]
19
+ extensions:
20
+ python:
21
+ - py
@@ -0,0 +1,15 @@
1
+ * code-annotations version:
2
+ * Python version:
3
+ * Operating System:
4
+
5
+ ### Description
6
+
7
+ Describe what you were trying to get done.
8
+ Tell us what happened, what went wrong, and what you expected to happen.
9
+
10
+ ### What I Did
11
+
12
+ ```
13
+ Paste the command(s) you ran and the output.
14
+ If there was a crash, please include the traceback here.
15
+ ```
@@ -0,0 +1,38 @@
1
+ **Description:** Describe in a couple of sentence what this PR adds
2
+
3
+ **JIRA:** Link to JIRA ticket
4
+
5
+ **Dependencies:** dependencies on other outstanding PRs, issues, etc.
6
+
7
+ **Merge deadline:** List merge deadline (if any)
8
+
9
+ **Installation instructions:** List any non-trivial installation
10
+ instructions.
11
+
12
+ **Testing instructions:**
13
+
14
+ 1. Do thing A
15
+ 2. Expect B to happen
16
+ 3. If C happened instead - check failed.
17
+
18
+ **Reviewers:**
19
+ - [ ] tag reviewer
20
+ - [ ] tag reviewer
21
+
22
+ **Merge checklist:**
23
+ - [ ] All reviewers approved
24
+ - [ ] CI build is green
25
+ - [ ] Version bumped
26
+ - [ ] Changelog record added
27
+ - [ ] Documentation updated (not only docstrings)
28
+ - [ ] Commits are squashed
29
+
30
+ **Post merge:**
31
+ - [ ] Create a tag
32
+ - [ ] Check new version is pushed to PyPi after tag-triggered build is
33
+ finished.
34
+ - [ ] Delete working branch (if not needed anymore)
35
+
36
+ **Author concerns:** List any concerns about this PR - inelegant
37
+ solutions, hacks, quick-and-dirty implementations, concerns about
38
+ migrations, etc.
@@ -0,0 +1,7 @@
1
+ version: 2
2
+ updates:
3
+ # Adding new check for github-actions
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
@@ -0,0 +1,19 @@
1
+ # Run the workflow that adds new tickets that are either:
2
+ # - labelled "DEPR"
3
+ # - title starts with "[DEPR]"
4
+ # - body starts with "Proposal Date" (this is the first template field)
5
+ # to the org-wide DEPR project board
6
+
7
+ name: Add newly created DEPR issues to the DEPR project board
8
+
9
+ on:
10
+ issues:
11
+ types: [opened]
12
+
13
+ jobs:
14
+ routeissue:
15
+ uses: openedx/.github/.github/workflows/add-depr-ticket-to-depr-board.yml@master
16
+ secrets:
17
+ GITHUB_APP_ID: ${{ secrets.GRAPHQL_AUTH_APP_ID }}
18
+ GITHUB_APP_PRIVATE_KEY: ${{ secrets.GRAPHQL_AUTH_APP_PEM }}
19
+ SLACK_BOT_TOKEN: ${{ secrets.SLACK_ISSUE_BOT_TOKEN }}
@@ -0,0 +1,20 @@
1
+ # This workflow runs when a comment is made on the ticket
2
+ # If the comment starts with "label: " it tries to apply
3
+ # the label indicated in rest of comment.
4
+ # If the comment starts with "remove label: ", it tries
5
+ # to remove the indicated label.
6
+ # Note: Labels are allowed to have spaces and this script does
7
+ # not parse spaces (as often a space is legitimate), so the command
8
+ # "label: really long lots of words label" will apply the
9
+ # label "really long lots of words label"
10
+
11
+ name: Allows for the adding and removing of labels via comment
12
+
13
+ on:
14
+ issue_comment:
15
+ types: [created]
16
+
17
+ jobs:
18
+ add_remove_labels:
19
+ uses: openedx/.github/.github/workflows/add-remove-label-on-comment.yml@master
20
+
@@ -0,0 +1,41 @@
1
+ name: Python CI
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - "**"
7
+ workflow_call:
8
+
9
+ jobs:
10
+ run_tests:
11
+ name: ${{ matrix.toxenv }}
12
+ runs-on: ${{ matrix.os }}
13
+ permissions:
14
+ contents: read
15
+ strategy:
16
+ matrix:
17
+ os: [ubuntu-latest]
18
+ python-version: ["3.12"]
19
+ toxenv: [quality, docs, build, django42, django52]
20
+
21
+ steps:
22
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
23
+ - name: Setup uv
24
+ uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
25
+ with:
26
+ enable-cache: true
27
+ python-version: "${{ matrix.python-version }}"
28
+
29
+ - name: Install CI dependencies
30
+ run: uv sync --locked --group ci
31
+
32
+ - name: Run Tests
33
+ run: uv run --locked tox -e ${{ matrix.toxenv }}
34
+
35
+ - name: Run Coverage
36
+ if: matrix.python-version == '3.12' && matrix.toxenv=='django42'
37
+ uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
38
+ with:
39
+ token: ${{ secrets.CODECOV_TOKEN }}
40
+ flags: unittests
41
+ fail_ci_if_error: true
@@ -0,0 +1,10 @@
1
+ # Run commitlint on the commit messages in a pull request.
2
+
3
+ name: Lint Commit Messages
4
+
5
+ on:
6
+ - pull_request
7
+
8
+ jobs:
9
+ commitlint:
10
+ uses: openedx/.github/.github/workflows/commitlint.yml@master
@@ -0,0 +1,118 @@
1
+ name: Semantic Release
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+
7
+ jobs:
8
+ # The same aggregate a pull request has to pass, so the release runs exactly
9
+ # the checks that were required to merge -- and picks up any package added to
10
+ # ci.yml later without needing a change here.
11
+ run_ci:
12
+ uses: ./.github/workflows/ci.yml
13
+ secrets: inherit
14
+
15
+ release:
16
+ # Every package this workflow publishes has to build before we tag
17
+ # anything. The GitHub release and the PyPI uploads cannot be taken back,
18
+ # so a package that only fails to build in its publish job would leave the
19
+ # release half-finished.
20
+ needs: [run_ci]
21
+ runs-on: ubuntu-latest
22
+ if: github.ref_name == 'master'
23
+ concurrency:
24
+ group: ${{ github.workflow }}-release-${{ github.ref_name }}
25
+ cancel-in-progress: false
26
+
27
+ permissions:
28
+ contents: write
29
+
30
+ steps:
31
+ # Note: We checkout the repository at the branch that triggered the workflow.
32
+ # Python Semantic Release will automatically convert shallow clones to full clones
33
+ # if needed to ensure proper history evaluation. However, we forcefully reset the
34
+ # branch to the workflow sha because it is possible that the branch was updated
35
+ # while the workflow was running, which prevents accidentally releasing un-evaluated
36
+ # changes.
37
+ - name: Setup | Checkout Repository on Release Branch
38
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
39
+ with:
40
+ ref: ${{ github.ref_name }}
41
+
42
+ - name: Setup | Force release branch to be at workflow sha
43
+ run: |
44
+ git reset --hard ${{ github.sha }}
45
+
46
+ - name: Action | Semantic Version Release
47
+ id: release
48
+ # Adjust tag with desired version if applicable.
49
+ uses: python-semantic-release/python-semantic-release@b700dbeb1f431a0fcc30a79f3f0869407fe07278 # v10.7.0
50
+ with:
51
+ github_token: ${{ secrets.GITHUB_TOKEN }}
52
+ git_committer_name: "github-actions"
53
+ git_committer_email: "actions@users.noreply.github.com"
54
+ changelog: "false"
55
+ # Commit, tag, push and build, but don't create the GitHub release.
56
+ # We create it ourselves in the next step so that the distributions
57
+ # are attached before the release is published. See that step for why.
58
+ vcs_release: "false"
59
+
60
+ # This repo has immutable releases enabled, which freezes a release's
61
+ # assets the moment it is published, so assets cannot be attached
62
+ # afterwards. Everything we want on the release has to be built by now
63
+ # and passed to this one command, which creates the release as a draft,
64
+ # uploads the assets, and only then publishes it:
65
+ # https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/immutable-releases
66
+ - name: Publish | Create GitHub Release with Assets
67
+ if: steps.release.outputs.released == 'true'
68
+ env:
69
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70
+ # Reuse the release notes python-semantic-release generated for us.
71
+ RELEASE_NOTES: ${{ steps.release.outputs.release_notes }}
72
+ TAG: ${{ steps.release.outputs.tag }}
73
+ run: |
74
+ # Output the release notes to a file
75
+ printf '%s' "$RELEASE_NOTES" > "$RUNNER_TEMP/release_notes.md"
76
+ # Creates the release as a draft, uploads the assets, and then
77
+ # publishes it -- all within this one command.
78
+ gh release create "$TAG" \
79
+ --verify-tag \
80
+ --title "$TAG" \
81
+ --notes-file "$RUNNER_TEMP/release_notes.md" \
82
+ dist/*
83
+
84
+ - name: Upload | Distribution Artifacts
85
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
86
+ if: steps.release.outputs.released == 'true'
87
+ with:
88
+ name: distribution-artifacts
89
+ path: dist
90
+ if-no-files-found: error
91
+
92
+ outputs:
93
+ released: ${{ steps.release.outputs.released || 'false' }}
94
+ version: ${{ steps.release.outputs.version }}
95
+
96
+ publish_to_pypi:
97
+ # 1. Separate out the publish step from the github release step to run each step at
98
+ # the least amount of token privilege
99
+ # 2. Also, publishing can fail, and its better to have a separate job if you need to retry
100
+ # and it won't require reversing the release.
101
+ runs-on: ubuntu-latest
102
+ needs: release
103
+ if: github.ref_name == 'master' && needs.release.outputs.released == 'true'
104
+
105
+ permissions:
106
+ contents: read
107
+ id-token: write
108
+
109
+ steps:
110
+ - name: Setup | Download Build Artifacts
111
+ uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
112
+ id: artifact-download
113
+ with:
114
+ name: distribution-artifacts
115
+ path: dist
116
+
117
+ - name: Publish to PyPi
118
+ uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
@@ -0,0 +1,12 @@
1
+ # This workflow runs when a comment is made on the ticket
2
+ # If the comment starts with "assign me" it assigns the author to the
3
+ # ticket (case insensitive)
4
+
5
+ name: Assign comment author to ticket if they say "assign me"
6
+ on:
7
+ issue_comment:
8
+ types: [created]
9
+
10
+ jobs:
11
+ self_assign_by_comment:
12
+ uses: openedx/.github/.github/workflows/self-assign-issue.yml@master
@@ -0,0 +1,31 @@
1
+ name: Upgrade Python Requirements
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 0 * * 1"
6
+ workflow_dispatch:
7
+ inputs:
8
+ branch:
9
+ description: "Target branch against which to create requirements PR"
10
+ required: true
11
+ # If copying this template manually, you must provide your default branch name
12
+ # in quotes, such as 'master'
13
+ default: "master"
14
+
15
+ jobs:
16
+ call-upgrade-python-requirements-workflow:
17
+ uses: openedx/.github/.github/workflows/upgrade-python-requirements.yml@master
18
+ with:
19
+ # If copying manually, also provide your default branch name in quotes here
20
+ branch: ${{ github.event.inputs.branch || 'master' }}
21
+ # optional parameters below; fill in if you'd like github or email notifications
22
+ # user_reviewers: ""
23
+ # team_reviewers: ""
24
+ # email_address: ""
25
+ # send_success_notification: false
26
+ # python_version: ""
27
+ secrets:
28
+ requirements_bot_github_token: ${{ secrets.REQUIREMENTS_BOT_GITHUB_TOKEN }}
29
+ requirements_bot_github_email: ${{ secrets.REQUIREMENTS_BOT_GITHUB_EMAIL }}
30
+ edx_smtp_username: ${{ secrets.EDX_SMTP_USERNAME }}
31
+ edx_smtp_password: ${{ secrets.EDX_SMTP_PASSWORD }}
@@ -0,0 +1,77 @@
1
+ *.py[cod]
2
+ __pycache__
3
+ .pytest_cache
4
+
5
+ # C extensions
6
+ *.so
7
+
8
+ # Packages
9
+ *.egg
10
+ *.egg-info
11
+ dist
12
+ build
13
+ eggs
14
+ parts
15
+ bin
16
+ var
17
+ sdist
18
+ develop-eggs
19
+ .installed.cfg
20
+ lib
21
+ lib64
22
+
23
+ # Installer logs
24
+ pip-log.txt
25
+
26
+ # Unit test / coverage reports
27
+ .cache/
28
+ .pytest_cache/
29
+ .coverage
30
+ .coverage.*
31
+ .tox
32
+ coverage.xml
33
+ htmlcov/
34
+
35
+ # Translations
36
+ *.mo
37
+
38
+ # IDEs and text editors
39
+ *~
40
+ *.swp
41
+ .idea/
42
+ .project
43
+ .pycharm_helpers/
44
+ .pydevproject
45
+
46
+ # The Silver Searcher
47
+ .agignore
48
+
49
+ # OS X artifacts
50
+ *.DS_Store
51
+
52
+ # Logging
53
+ log/
54
+ logs/
55
+ chromedriver.log
56
+ ghostdriver.log
57
+
58
+ # Complexity
59
+ output/*.html
60
+ output/*/index.html
61
+
62
+ # Sphinx
63
+ docs/_build
64
+ docs/modules.rst
65
+ docs/code_annotations.rst
66
+ docs/code_annotations.*.rst
67
+
68
+ # Private requirements
69
+ requirements/private.in
70
+ requirements/private.txt
71
+
72
+ # Development task artifacts
73
+ default.db
74
+
75
+ # Generated reports and test reports
76
+ reports/*
77
+ test_reports/*
@@ -0,0 +1,23 @@
1
+ # .readthedocs.yml
2
+ # Read the Docs configuration file
3
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
+
5
+ # Required
6
+ version: 2
7
+
8
+ # Build documentation in the docs/ directory with Sphinx
9
+ sphinx:
10
+ configuration: docs/conf.py
11
+
12
+ build:
13
+ os: ubuntu-lts-latest
14
+ tools:
15
+ python: "3.12"
16
+ jobs:
17
+ post_install:
18
+ - pip install uv && uv export --group doc --no-hashes | pip install -r /dev/stdin
19
+
20
+ python:
21
+ install:
22
+ - method: pip
23
+ path: .
@@ -0,0 +1,6 @@
1
+ include AUTHORS
2
+ include CHANGELOG.rst
3
+ include CONTRIBUTING.rst
4
+ include LICENSE.txt
5
+ include README.rst
6
+ recursive-include src/code_annotations *.tpl *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.yaml *.yml
@@ -0,0 +1,63 @@
1
+ .PHONY: clean coverage diff_cover docs \
2
+ quality requirements selfcheck test test-all upgrade validate
3
+
4
+ .DEFAULT_GOAL := help
5
+
6
+ define BROWSER_PYSCRIPT
7
+ import os, webbrowser, sys
8
+ try:
9
+ from urllib import pathname2url
10
+ except:
11
+ from urllib.request import pathname2url
12
+
13
+ webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
14
+ endef
15
+ export BROWSER_PYSCRIPT
16
+ BROWSER := python -c "$$BROWSER_PYSCRIPT"
17
+
18
+ help: ## display this help message
19
+ @echo "Please use \`make <target>' where <target> is one of"
20
+ @perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}'
21
+
22
+ clean: ## remove generated byte code, coverage reports, and build artifacts
23
+ find . -name '__pycache__' -exec rm -rf {} +
24
+ find . -name '*.pyc' -exec rm -f {} +
25
+ find . -name '*.pyo' -exec rm -f {} +
26
+ find . -name '*~' -exec rm -f {} +
27
+ coverage erase
28
+ rm -fr build/
29
+ rm -fr dist/
30
+ rm -fr *.egg-info
31
+
32
+ coverage: clean ## generate and view HTML coverage report
33
+ pytest --cov-report html
34
+ $(BROWSER) htmlcov/index.html
35
+
36
+ docs: ## generate Sphinx HTML documentation, including API docs
37
+ tox -e docs
38
+ $(BROWSER) docs/_build/html/index.html
39
+
40
+ upgrade: ## update uv.lock and regenerate uv constraint-dependencies
41
+ uv run --with 'edx-lint>=6.2' edx_lint write_uv_constraints pyproject.toml
42
+ uv lock --upgrade
43
+
44
+ quality: ## check coding style with pycodestyle and pylint
45
+ tox -e quality
46
+
47
+ requirements: ## install development environment requirements
48
+ uv sync --group dev
49
+
50
+ test: clean ## run tests in the current virtualenv
51
+ pytest
52
+
53
+ diff_cover: test ## find diff lines that need test coverage
54
+ diff-cover coverage.xml
55
+
56
+ test-all: ## run tests on every supported Python
57
+ tox -e quality
58
+ tox
59
+
60
+ validate: quality test ## run tests and quality checks
61
+
62
+ selfcheck: ## check that the Makefile is well-formed
63
+ @echo "The Makefile is well-formed."
@@ -0,0 +1,82 @@
1
+ Metadata-Version: 2.4
2
+ Name: code-annotations
3
+ Version: 3.1.0
4
+ Summary: Extensible tools for parsing annotations in codebases
5
+ License-Expression: Apache-2.0
6
+ Project-URL: Homepage, https://github.com/openedx/code-annotations
7
+ Classifier: Development Status :: 3 - Alpha
8
+ Classifier: Framework :: Django
9
+ Classifier: Framework :: Django :: 4.2
10
+ Classifier: Framework :: Django :: 5.2
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Natural Language :: English
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Requires-Python: >=3.12
17
+ Description-Content-Type: text/x-rst
18
+ License-File: LICENSE.txt
19
+ License-File: NOTICE.txt
20
+ Requires-Dist: click
21
+ Requires-Dist: pyyaml
22
+ Requires-Dist: Jinja2
23
+ Requires-Dist: stevedore
24
+ Requires-Dist: python-slugify
25
+ Provides-Extra: django
26
+ Requires-Dist: Django>=4.2; extra == "django"
27
+ Dynamic: license-file
28
+
29
+ code-annotations
30
+ =============================
31
+
32
+ Extensible tools for parsing annotations in codebases
33
+
34
+ Overview
35
+ --------
36
+
37
+ This package provides configurable and extensible tools for parsing and
38
+ summarizing annotations in a wide range of codebases. Originally intended for
39
+ annotating code which stores personally identifiable information (PII), these
40
+ tools are optimized for that use case but can be generalized for other types of
41
+ annotations.
42
+
43
+ Additionally, a logically separate part of this repository will contain specific annotation configurations and supporting tools, such as Sphinx extensions for documenting specific annotation types. See the ``contrib`` folder.
44
+
45
+ Documentation
46
+ -------------
47
+
48
+ The full documentation is at https://code-annotations.readthedocs.org.
49
+
50
+ License
51
+ -------
52
+
53
+ The code in this repository is licensed under the Apache Software License 2.0 unless
54
+ otherwise noted.
55
+
56
+ Please see ``LICENSE.txt`` for details.
57
+
58
+ How To Contribute
59
+ -----------------
60
+
61
+ Contributions are very welcome.
62
+
63
+ Please read `How To Contribute <https://github.com/openedx/.github/blob/master/CONTRIBUTING.md>`_ for details.
64
+
65
+ PR description template should be automatically applied if you are sending PR from github interface; otherwise you
66
+ can find it it at `PULL_REQUEST_TEMPLATE.md <https://github.com/openedx/code-annotations/blob/master/.github/PULL_REQUEST_TEMPLATE.md>`_
67
+
68
+ Issue report template should be automatically applied if you are sending it from github UI as well; otherwise you
69
+ can find it at `ISSUE_TEMPLATE.md <https://github.com/openedx/code-annotations/blob/master/.github/ISSUE_TEMPLATE.md>`_
70
+
71
+ Reporting Security Issues
72
+ -------------------------
73
+
74
+ Please do not report security issues in public. Please email security@openedx.org.
75
+
76
+ Getting Help
77
+ ------------
78
+
79
+ Have a question about this repository, or about Open edX in general? Please
80
+ refer to this `list of resources`_ if you need any assistance.
81
+
82
+ .. _list of resources: https://open.edx.org/getting-help
@@ -0,0 +1,12 @@
1
+ # This file records information about this repo. Its use is described in OEP-55:
2
+ # https://open-edx-proposals.readthedocs.io/en/latest/processes/oep-0055-proc-project-maintainers.html
3
+
4
+ apiVersion: backstage.io/v1alpha1
5
+ kind: Component
6
+ metadata:
7
+ name: "code-annotations"
8
+ description: "Tools for annotating code comments, linting, and Django model coverage."
9
+ spec:
10
+ owner: "bmtcril"
11
+ type: "library"
12
+ lifecycle: "production"
@@ -0,0 +1,12 @@
1
+ coverage:
2
+ status:
3
+ project:
4
+ default:
5
+ enabled: yes
6
+ target: auto
7
+ patch:
8
+ default:
9
+ enabled: yes
10
+ target: 100%
11
+
12
+ comment: false