openedx-plugin-sample 3.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.
- openedx_plugin_sample-3.0.0/.annotation_safe_list.yml +41 -0
- openedx_plugin_sample-3.0.0/.coveragerc +10 -0
- openedx_plugin_sample-3.0.0/.editorconfig +100 -0
- openedx_plugin_sample-3.0.0/.gitignore +69 -0
- openedx_plugin_sample-3.0.0/.pii_annotations.yml +35 -0
- openedx_plugin_sample-3.0.0/.readthedocs.yaml +27 -0
- openedx_plugin_sample-3.0.0/LICENSE.txt +180 -0
- openedx_plugin_sample-3.0.0/Makefile +103 -0
- openedx_plugin_sample-3.0.0/PKG-INFO +579 -0
- openedx_plugin_sample-3.0.0/README.md +551 -0
- openedx_plugin_sample-3.0.0/codecov.yml +12 -0
- openedx_plugin_sample-3.0.0/docs/Makefile +230 -0
- openedx_plugin_sample-3.0.0/docs/_static/theme_overrides.css +10 -0
- openedx_plugin_sample-3.0.0/docs/concepts/index.rst +2 -0
- openedx_plugin_sample-3.0.0/docs/conf.py +532 -0
- openedx_plugin_sample-3.0.0/docs/decisions/0001-purpose-of-this-repo.rst +57 -0
- openedx_plugin_sample-3.0.0/docs/decisions/README.rst +8 -0
- openedx_plugin_sample-3.0.0/docs/decisions.rst +12 -0
- openedx_plugin_sample-3.0.0/docs/getting_started.rst +18 -0
- openedx_plugin_sample-3.0.0/docs/how-tos/index.rst +4 -0
- openedx_plugin_sample-3.0.0/docs/index.rst +32 -0
- openedx_plugin_sample-3.0.0/docs/internationalization.rst +49 -0
- openedx_plugin_sample-3.0.0/docs/make.bat +281 -0
- openedx_plugin_sample-3.0.0/docs/openedx_plugin_sample.rst +69 -0
- openedx_plugin_sample-3.0.0/docs/quickstarts/index.rst +2 -0
- openedx_plugin_sample-3.0.0/docs/references/index.rst +2 -0
- openedx_plugin_sample-3.0.0/docs/testing.rst +44 -0
- openedx_plugin_sample-3.0.0/manage.py +29 -0
- openedx_plugin_sample-3.0.0/pylintrc +390 -0
- openedx_plugin_sample-3.0.0/pylintrc_tweaks +11 -0
- openedx_plugin_sample-3.0.0/pyproject.toml +151 -0
- openedx_plugin_sample-3.0.0/setup.cfg +15 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/__init__.py +7 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/apps.py +134 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/conf/locale/config.yaml +85 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/migrations/0001_initial.py +78 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/migrations/__init__.py +0 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/models.py +65 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/pipeline.py +156 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/py.typed +0 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/serializers.py +39 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/settings/common.py +135 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/settings/production.py +16 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/settings/test.py +17 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/signals.py +132 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/templates/openedx_plugin_sample/base.html +26 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/urls.py +21 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample/views.py +241 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample.egg-info/PKG-INFO +579 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample.egg-info/SOURCES.txt +61 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample.egg-info/dependency_links.txt +1 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample.egg-info/entry_points.txt +5 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample.egg-info/requires.txt +7 -0
- openedx_plugin_sample-3.0.0/src/openedx_plugin_sample.egg-info/top_level.txt +1 -0
- openedx_plugin_sample-3.0.0/test_settings.py +121 -0
- openedx_plugin_sample-3.0.0/test_utils/__init__.py +10 -0
- openedx_plugin_sample-3.0.0/tests/test_api.py +446 -0
- openedx_plugin_sample-3.0.0/tests/test_models.py +98 -0
- openedx_plugin_sample-3.0.0/tests/test_plugin_integration.py +23 -0
- openedx_plugin_sample-3.0.0/tests/urls.py +11 -0
- openedx_plugin_sample-3.0.0/tox.ini +94 -0
- openedx_plugin_sample-3.0.0/uv.lock +2133 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# This is a Code Annotations automatically-generated Django model safelist file.
|
|
2
|
+
# These models must be annotated as follows in order to be counted in the coverage report.
|
|
3
|
+
# See https://code-annotations.readthedocs.io/en/latest/safelist.html for more information.
|
|
4
|
+
#
|
|
5
|
+
# fake_app_1.FakeModelName:
|
|
6
|
+
# ".. no_pii:": "This model has no PII"
|
|
7
|
+
# fake_app_2.FakeModel2:
|
|
8
|
+
# ".. choice_annotation:": foo, bar, baz
|
|
9
|
+
|
|
10
|
+
admin.LogEntry:
|
|
11
|
+
".. no_pii:": "This model has no PII"
|
|
12
|
+
auth.Group:
|
|
13
|
+
".. no_pii:": "This model has no PII"
|
|
14
|
+
auth.Permission:
|
|
15
|
+
".. no_pii:": "This model has no PII"
|
|
16
|
+
auth.User:
|
|
17
|
+
".. pii": "This model minimally contains a username, password, and email"
|
|
18
|
+
".. pii_types": "username, email_address, password"
|
|
19
|
+
".. pii_retirement": "consumer_api"
|
|
20
|
+
contenttypes.ContentType:
|
|
21
|
+
".. no_pii:": "This model has no PII"
|
|
22
|
+
sessions.Session:
|
|
23
|
+
".. no_pii:": "This model has no PII"
|
|
24
|
+
social_django.Association:
|
|
25
|
+
".. no_pii:": "This model has no PII"
|
|
26
|
+
social_django.Code:
|
|
27
|
+
".. pii:": "Email address"
|
|
28
|
+
".. pii_types:": other
|
|
29
|
+
".. pii_retirement:": local_api
|
|
30
|
+
social_django.Nonce:
|
|
31
|
+
".. no_pii:": "This model has no PII"
|
|
32
|
+
social_django.Partial:
|
|
33
|
+
".. no_pii:": "This model has no PII"
|
|
34
|
+
social_django.UserSocialAuth:
|
|
35
|
+
".. no_pii:": "This model has no PII"
|
|
36
|
+
waffle.Flag:
|
|
37
|
+
".. no_pii:": "This model has no PII"
|
|
38
|
+
waffle.Sample:
|
|
39
|
+
".. no_pii:": "This model has no PII"
|
|
40
|
+
waffle.Switch:
|
|
41
|
+
".. no_pii:": "This model has no PII"
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# ***************************
|
|
2
|
+
# ** DO NOT EDIT THIS FILE **
|
|
3
|
+
# ***************************
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by edx-lint: https://github.com/openedx/edx-lint
|
|
6
|
+
#
|
|
7
|
+
# If you want to change this file, you have two choices, depending on whether
|
|
8
|
+
# you want to make a local change that applies only to this repo, or whether
|
|
9
|
+
# you want to make a central change that applies to all repos using edx-lint.
|
|
10
|
+
#
|
|
11
|
+
# Note: If your .editorconfig file is simply out-of-date relative to the latest
|
|
12
|
+
# .editorconfig in edx-lint, ensure you have the latest edx-lint installed
|
|
13
|
+
# and then follow the steps for a "LOCAL CHANGE".
|
|
14
|
+
#
|
|
15
|
+
# LOCAL CHANGE:
|
|
16
|
+
#
|
|
17
|
+
# 1. Edit the local .editorconfig_tweaks file to add changes just to this
|
|
18
|
+
# repo's file.
|
|
19
|
+
#
|
|
20
|
+
# 2. Run:
|
|
21
|
+
#
|
|
22
|
+
# $ edx_lint write .editorconfig
|
|
23
|
+
#
|
|
24
|
+
# 3. This will modify the local file. Submit a pull request to get it
|
|
25
|
+
# checked in so that others will benefit.
|
|
26
|
+
#
|
|
27
|
+
#
|
|
28
|
+
# CENTRAL CHANGE:
|
|
29
|
+
#
|
|
30
|
+
# 1. Edit the .editorconfig file in the edx-lint repo at
|
|
31
|
+
# https://github.com/openedx/edx-lint/blob/master/edx_lint/files/.editorconfig
|
|
32
|
+
#
|
|
33
|
+
# 2. install the updated version of edx-lint (in edx-lint):
|
|
34
|
+
#
|
|
35
|
+
# $ pip install .
|
|
36
|
+
#
|
|
37
|
+
# 3. Run (in edx-lint):
|
|
38
|
+
#
|
|
39
|
+
# $ edx_lint write .editorconfig
|
|
40
|
+
#
|
|
41
|
+
# 4. Make a new version of edx_lint, submit and review a pull request with the
|
|
42
|
+
# .editorconfig update, and after merging, update the edx-lint version and
|
|
43
|
+
# publish the new version.
|
|
44
|
+
#
|
|
45
|
+
# 5. In your local repo, install the newer version of edx-lint.
|
|
46
|
+
#
|
|
47
|
+
# 6. Run:
|
|
48
|
+
#
|
|
49
|
+
# $ edx_lint write .editorconfig
|
|
50
|
+
#
|
|
51
|
+
# 7. This will modify the local file. Submit a pull request to get it
|
|
52
|
+
# checked in so that others will benefit.
|
|
53
|
+
#
|
|
54
|
+
#
|
|
55
|
+
#
|
|
56
|
+
#
|
|
57
|
+
#
|
|
58
|
+
# STAY AWAY FROM THIS FILE!
|
|
59
|
+
#
|
|
60
|
+
#
|
|
61
|
+
#
|
|
62
|
+
#
|
|
63
|
+
#
|
|
64
|
+
# SERIOUSLY.
|
|
65
|
+
#
|
|
66
|
+
# ------------------------------
|
|
67
|
+
# Generated by edx-lint version: 5.2.5
|
|
68
|
+
# ------------------------------
|
|
69
|
+
[*]
|
|
70
|
+
end_of_line = lf
|
|
71
|
+
insert_final_newline = true
|
|
72
|
+
charset = utf-8
|
|
73
|
+
indent_style = space
|
|
74
|
+
indent_size = 4
|
|
75
|
+
max_line_length = 120
|
|
76
|
+
trim_trailing_whitespace = true
|
|
77
|
+
|
|
78
|
+
[{Makefile, *.mk}]
|
|
79
|
+
indent_style = tab
|
|
80
|
+
indent_size = 8
|
|
81
|
+
|
|
82
|
+
[*.{yml,yaml,json}]
|
|
83
|
+
indent_size = 2
|
|
84
|
+
|
|
85
|
+
[*.js]
|
|
86
|
+
indent_size = 2
|
|
87
|
+
|
|
88
|
+
[*.diff]
|
|
89
|
+
trim_trailing_whitespace = false
|
|
90
|
+
|
|
91
|
+
[.git/*]
|
|
92
|
+
trim_trailing_whitespace = false
|
|
93
|
+
|
|
94
|
+
[COMMIT_EDITMSG]
|
|
95
|
+
max_line_length = 72
|
|
96
|
+
|
|
97
|
+
[*.rst]
|
|
98
|
+
max_line_length = 79
|
|
99
|
+
|
|
100
|
+
# f2f02689fced7a2e0c62c2f9803184114dc2ae4b
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
# Virtual environments
|
|
36
|
+
/venv/
|
|
37
|
+
/venv-*/
|
|
38
|
+
/.venv/
|
|
39
|
+
/.venv-*/
|
|
40
|
+
|
|
41
|
+
# The Silver Searcher
|
|
42
|
+
.agignore
|
|
43
|
+
|
|
44
|
+
# OS X artifacts
|
|
45
|
+
*.DS_Store
|
|
46
|
+
|
|
47
|
+
# Logging
|
|
48
|
+
log/
|
|
49
|
+
logs/
|
|
50
|
+
chromedriver.log
|
|
51
|
+
ghostdriver.log
|
|
52
|
+
|
|
53
|
+
# Complexity
|
|
54
|
+
output/*.html
|
|
55
|
+
output/*/index.html
|
|
56
|
+
|
|
57
|
+
# Sphinx
|
|
58
|
+
docs/_build
|
|
59
|
+
docs/modules.rst
|
|
60
|
+
docs/sample_plugin.rst
|
|
61
|
+
docs/sample_plugin.*.rst
|
|
62
|
+
|
|
63
|
+
# Private requirements
|
|
64
|
+
requirements/private.in
|
|
65
|
+
requirements/private.txt
|
|
66
|
+
|
|
67
|
+
# Test cruft
|
|
68
|
+
default.db
|
|
69
|
+
pii_report
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
source_path: ./
|
|
2
|
+
report_path: pii_report
|
|
3
|
+
safelist_path: .annotation_safe_list.yml
|
|
4
|
+
coverage_target: 100.0
|
|
5
|
+
annotations:
|
|
6
|
+
".. no_pii:":
|
|
7
|
+
"pii_group":
|
|
8
|
+
- ".. pii:":
|
|
9
|
+
- ".. pii_types:":
|
|
10
|
+
choices:
|
|
11
|
+
- id # Unique identifier for the user which is shared across systems
|
|
12
|
+
- name # Used for any part of the user's name
|
|
13
|
+
- username
|
|
14
|
+
- password
|
|
15
|
+
- location # Used for any part of any type address or country stored
|
|
16
|
+
- phone_number # Used for phone or fax numbers
|
|
17
|
+
- email_address
|
|
18
|
+
- birth_date # Used for any part of a stored birth date
|
|
19
|
+
- ip # IP address
|
|
20
|
+
- external_service # Used for external service ids or links such as social media links or usernames, website links, etc.
|
|
21
|
+
- biography # Any type of free-form biography field
|
|
22
|
+
- gender
|
|
23
|
+
- sex
|
|
24
|
+
- image
|
|
25
|
+
- video
|
|
26
|
+
- other
|
|
27
|
+
- ".. pii_retirement:":
|
|
28
|
+
choices:
|
|
29
|
+
- retained # Intentionally kept for legal reasons
|
|
30
|
+
- local_api # An API exists in this repository for retiring this information
|
|
31
|
+
- consumer_api # The data's consumer must implement an API for retiring this information
|
|
32
|
+
- third_party # A third party API exists to retire this data
|
|
33
|
+
extensions:
|
|
34
|
+
python:
|
|
35
|
+
- py
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
fail_on_warning: true
|
|
12
|
+
|
|
13
|
+
# Set the version of python needed to build these docs.
|
|
14
|
+
build:
|
|
15
|
+
os: "ubuntu-22.04"
|
|
16
|
+
tools:
|
|
17
|
+
python: "3.12"
|
|
18
|
+
|
|
19
|
+
python:
|
|
20
|
+
install:
|
|
21
|
+
- requirements: requirements/doc.txt
|
|
22
|
+
|
|
23
|
+
# This will pip install this repo into the python environment
|
|
24
|
+
# if you are using this in a repo that is not pip installable
|
|
25
|
+
# then you should remove the following two lines.
|
|
26
|
+
- method: pip
|
|
27
|
+
path: .
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
Apache License
|
|
4
|
+
Version 2.0, January 2004
|
|
5
|
+
http://www.apache.org/licenses/
|
|
6
|
+
|
|
7
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
+
|
|
9
|
+
1. Definitions.
|
|
10
|
+
|
|
11
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
12
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
13
|
+
|
|
14
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
15
|
+
the copyright owner that is granting the License.
|
|
16
|
+
|
|
17
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
18
|
+
other entities that control, are controlled by, or are under common
|
|
19
|
+
control with that entity. For the purposes of this definition,
|
|
20
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
21
|
+
direction or management of such entity, whether by contract or
|
|
22
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
23
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
24
|
+
|
|
25
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
26
|
+
exercising permissions granted by this License.
|
|
27
|
+
|
|
28
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
29
|
+
including but not limited to software source code, documentation
|
|
30
|
+
source, and configuration files.
|
|
31
|
+
|
|
32
|
+
"Object" form shall mean any form resulting from mechanical
|
|
33
|
+
transformation or translation of a Source form, including but
|
|
34
|
+
not limited to compiled object code, generated documentation,
|
|
35
|
+
and conversions to other media types.
|
|
36
|
+
|
|
37
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
38
|
+
Object form, made available under the License, as indicated by a
|
|
39
|
+
copyright notice that is included in or attached to the work
|
|
40
|
+
(an example is provided in the Appendix below).
|
|
41
|
+
|
|
42
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
43
|
+
form, that is based on (or derived from) the Work and for which the
|
|
44
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
45
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
46
|
+
of this License, Derivative Works shall not include works that remain
|
|
47
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
48
|
+
the Work and Derivative Works thereof.
|
|
49
|
+
|
|
50
|
+
"Contribution" shall mean any work of authorship, including
|
|
51
|
+
the original version of the Work and any modifications or additions
|
|
52
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
53
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
54
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
55
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
56
|
+
means any form of electronic, verbal, or written communication sent
|
|
57
|
+
to the Licensor or its representatives, including but not limited to
|
|
58
|
+
communication on electronic mailing lists, source code control systems,
|
|
59
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
60
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
61
|
+
excluding communication that is conspicuously marked or otherwise
|
|
62
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
63
|
+
|
|
64
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
65
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
66
|
+
subsequently incorporated within the Work.
|
|
67
|
+
|
|
68
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
69
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
70
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
71
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
72
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
73
|
+
Work and such Derivative Works in Source or Object form.
|
|
74
|
+
|
|
75
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
76
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
77
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
78
|
+
(except as stated in this section) patent license to make, have made,
|
|
79
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
80
|
+
where such license applies only to those patent claims licensable
|
|
81
|
+
by such Contributor that are necessarily infringed by their
|
|
82
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
83
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
84
|
+
institute patent litigation against any entity (including a
|
|
85
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
86
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
87
|
+
or contributory patent infringement, then any patent licenses
|
|
88
|
+
granted to You under this License for that Work shall terminate
|
|
89
|
+
as of the date such litigation is filed.
|
|
90
|
+
|
|
91
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
92
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
93
|
+
modifications, and in Source or Object form, provided that You
|
|
94
|
+
meet the following conditions:
|
|
95
|
+
|
|
96
|
+
(a) You must give any other recipients of the Work or
|
|
97
|
+
Derivative Works a copy of this License; and
|
|
98
|
+
|
|
99
|
+
(b) You must cause any modified files to carry prominent notices
|
|
100
|
+
stating that You changed the files; and
|
|
101
|
+
|
|
102
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
103
|
+
that You distribute, all copyright, patent, trademark, and
|
|
104
|
+
attribution notices from the Source form of the Work,
|
|
105
|
+
excluding those notices that do not pertain to any part of
|
|
106
|
+
the Derivative Works; and
|
|
107
|
+
|
|
108
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
109
|
+
distribution, then any Derivative Works that You distribute must
|
|
110
|
+
include a readable copy of the attribution notices contained
|
|
111
|
+
within such NOTICE file, excluding those notices that do not
|
|
112
|
+
pertain to any part of the Derivative Works, in at least one
|
|
113
|
+
of the following places: within a NOTICE text file distributed
|
|
114
|
+
as part of the Derivative Works; within the Source form or
|
|
115
|
+
documentation, if provided along with the Derivative Works; or,
|
|
116
|
+
within a display generated by the Derivative Works, if and
|
|
117
|
+
wherever such third-party notices normally appear. The contents
|
|
118
|
+
of the NOTICE file are for informational purposes only and
|
|
119
|
+
do not modify the License. You may add Your own attribution
|
|
120
|
+
notices within Derivative Works that You distribute, alongside
|
|
121
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
122
|
+
that such additional attribution notices cannot be construed
|
|
123
|
+
as modifying the License.
|
|
124
|
+
|
|
125
|
+
You may add Your own copyright statement to Your modifications and
|
|
126
|
+
may provide additional or different license terms and conditions
|
|
127
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
128
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
129
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
130
|
+
the conditions stated in this License.
|
|
131
|
+
|
|
132
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
133
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
134
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
135
|
+
this License, without any additional terms or conditions.
|
|
136
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
137
|
+
the terms of any separate license agreement you may have executed
|
|
138
|
+
with Licensor regarding such Contributions.
|
|
139
|
+
|
|
140
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
141
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
142
|
+
except as required for reasonable and customary use in describing the
|
|
143
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
144
|
+
|
|
145
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
146
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
147
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
148
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
149
|
+
implied, including, without limitation, any warranties or conditions
|
|
150
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
151
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
152
|
+
appropriateness of using or redistributing the Work and assume any
|
|
153
|
+
risks associated with Your exercise of permissions under this License.
|
|
154
|
+
|
|
155
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
156
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
157
|
+
unless required by applicable law (such as deliberate and grossly
|
|
158
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
159
|
+
liable to You for damages, including any direct, indirect, special,
|
|
160
|
+
incidental, or consequential damages of any character arising as a
|
|
161
|
+
result of this License or out of the use or inability to use the
|
|
162
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
163
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
164
|
+
other commercial damages or losses), even if such Contributor
|
|
165
|
+
has been advised of the possibility of such damages.
|
|
166
|
+
|
|
167
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
168
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
169
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
170
|
+
or other liability obligations and/or rights consistent with this
|
|
171
|
+
License. However, in accepting such obligations, You may act only
|
|
172
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
173
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
174
|
+
defend, and hold each Contributor harmless for any liability
|
|
175
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
176
|
+
of your accepting any such warranty or additional liability.
|
|
177
|
+
|
|
178
|
+
END OF TERMS AND CONDITIONS
|
|
179
|
+
|
|
180
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
.PHONY: clean clean_tox compile_translations coverage diff_cover docs dummy_translations \
|
|
2
|
+
extract_translations fake_translations help pii_check pull_translations \
|
|
3
|
+
quality requirements selfcheck test test-all upgrade compile-requirements validate install_transifex_client
|
|
4
|
+
|
|
5
|
+
.DEFAULT_GOAL := help
|
|
6
|
+
|
|
7
|
+
# For opening files in a browser. Use like: $(BROWSER)relative/path/to/file.html
|
|
8
|
+
BROWSER := python -m webbrowser file://$(CURDIR)/
|
|
9
|
+
|
|
10
|
+
help: ## display this help message
|
|
11
|
+
@echo "Please use \`make <target>' where <target> is one of"
|
|
12
|
+
@awk -F ':.*?## ' '/^[a-zA-Z]/ && NF==2 {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
|
|
13
|
+
|
|
14
|
+
clean: ## remove generated byte code, coverage reports, and build artifacts
|
|
15
|
+
find . -name '__pycache__' -exec rm -rf {} +
|
|
16
|
+
find . -name '*.pyc' -exec rm -f {} +
|
|
17
|
+
find . -name '*.pyo' -exec rm -f {} +
|
|
18
|
+
find . -name '*~' -exec rm -f {} +
|
|
19
|
+
coverage erase
|
|
20
|
+
rm -fr build/
|
|
21
|
+
rm -fr dist/
|
|
22
|
+
rm -fr *.egg-info
|
|
23
|
+
|
|
24
|
+
clean_tox: ## clear tox requirements cache
|
|
25
|
+
rm -fr .tox
|
|
26
|
+
|
|
27
|
+
coverage: clean ## generate and view HTML coverage report
|
|
28
|
+
pytest --cov-report html
|
|
29
|
+
$(BROWSER)htmlcov/index.html
|
|
30
|
+
|
|
31
|
+
docs: ## generate Sphinx HTML documentation, including API docs
|
|
32
|
+
tox -e docs
|
|
33
|
+
$(BROWSER)docs/_build/html/index.html
|
|
34
|
+
|
|
35
|
+
compile-requirements: ## generate the uv.lock file without upgrading packages
|
|
36
|
+
uv lock
|
|
37
|
+
|
|
38
|
+
upgrade: ## upgrade all packages in uv.lock and sync constraints from edx-lint
|
|
39
|
+
uv run --with edx-lint edx_lint write_uv_constraints pyproject.toml
|
|
40
|
+
uv lock --upgrade
|
|
41
|
+
|
|
42
|
+
quality: ## check coding style with pycodestyle and pylint
|
|
43
|
+
tox -e quality
|
|
44
|
+
|
|
45
|
+
pii_check: ## check for PII annotations on all Django models
|
|
46
|
+
tox -e pii_check
|
|
47
|
+
|
|
48
|
+
requirements: clean_tox ## install development environment requirements
|
|
49
|
+
uv sync --group dev
|
|
50
|
+
|
|
51
|
+
test: clean ## run tests in the current virtualenv
|
|
52
|
+
pytest
|
|
53
|
+
|
|
54
|
+
diff_cover: test ## find diff lines that need test coverage
|
|
55
|
+
diff-cover coverage.xml
|
|
56
|
+
|
|
57
|
+
test-all: quality pii_check ## run tests on every supported Python/Django combination
|
|
58
|
+
tox
|
|
59
|
+
tox -e docs
|
|
60
|
+
|
|
61
|
+
validate: quality pii_check test ## run tests and quality checks
|
|
62
|
+
|
|
63
|
+
selfcheck: ## check that the Makefile is well-formed
|
|
64
|
+
@echo "The Makefile is well-formed."
|
|
65
|
+
|
|
66
|
+
## Localization targets
|
|
67
|
+
|
|
68
|
+
extract_translations: ## extract strings to be translated, outputting .mo files
|
|
69
|
+
rm -rf docs/_build
|
|
70
|
+
cd sample_plugin && i18n_tool extract --no-segment
|
|
71
|
+
|
|
72
|
+
compile_translations: ## compile translation files, outputting .po files for each supported language
|
|
73
|
+
cd sample_plugin && i18n_tool generate
|
|
74
|
+
|
|
75
|
+
detect_changed_source_translations:
|
|
76
|
+
cd sample_plugin && i18n_tool changed
|
|
77
|
+
|
|
78
|
+
ifeq ($(OPENEDX_ATLAS_PULL),)
|
|
79
|
+
pull_translations: ## Pull translations from Transifex
|
|
80
|
+
tx pull -t -a -f --mode reviewed --minimum-perc=1
|
|
81
|
+
else
|
|
82
|
+
# Experimental: OEP-58 Pulls translations using atlas
|
|
83
|
+
pull_translations:
|
|
84
|
+
find sample_plugin/conf/locale -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \;
|
|
85
|
+
atlas pull $(OPENEDX_ATLAS_ARGS) translations/sample-plugin/sample_plugin/conf/locale:sample_plugin/conf/locale
|
|
86
|
+
python manage.py compilemessages
|
|
87
|
+
|
|
88
|
+
@echo "Translations have been pulled via Atlas and compiled."
|
|
89
|
+
endif
|
|
90
|
+
|
|
91
|
+
dummy_translations: ## generate dummy translation (.po) files
|
|
92
|
+
cd sample_plugin && i18n_tool dummy
|
|
93
|
+
|
|
94
|
+
build_dummy_translations: extract_translations dummy_translations compile_translations ## generate and compile dummy translation files
|
|
95
|
+
|
|
96
|
+
validate_translations: build_dummy_translations detect_changed_source_translations ## validate translations
|
|
97
|
+
|
|
98
|
+
install_transifex_client: ## Install the Transifex client
|
|
99
|
+
# Installing client will skip CHANGELOG and LICENSE files from git changes
|
|
100
|
+
# so remind the user to commit the change first before installing client.
|
|
101
|
+
git diff -s --exit-code HEAD || { echo "Please commit changes first."; exit 1; }
|
|
102
|
+
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
|
|
103
|
+
git checkout -- LICENSE README.md ## overwritten by Transifex installer
|