diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b9e243..87915ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,9 +12,10 @@ jobs: name: Tests runs-on: ubuntu-20.04 strategy: + fail-fast: false matrix: python-version: ['3.8'] - toxenv: [quality, django22, django30, django31, django32] + toxenv: [quality, django32, django40] steps: - uses: actions/checkout@v2 diff --git a/pylintrc b/pylintrc index 6235f16..0b33867 100644 --- a/pylintrc +++ b/pylintrc @@ -2,12 +2,16 @@ # ** DO NOT EDIT THIS FILE ** # *************************** # -# This file was generated by edx-lint: http://github.com/edx/edx-lint +# This file was generated by edx-lint: https://github.com/edx/edx-lint # # If you want to change this file, you have two choices, depending on whether # you want to make a local change that applies only to this repo, or whether # you want to make a central change that applies to all repos using edx-lint. # +# Note: If your pylintrc file is simply out-of-date relative to the latest +# pylintrc in edx-lint, ensure you have the latest edx-lint installed +# and then follow the steps for a "LOCAL CHANGE". +# # LOCAL CHANGE: # # 1. Edit the local pylintrc_tweaks file to add changes just to this @@ -32,19 +36,16 @@ # # 3. Run (in edx-lint): # -# # uses pylintrc_tweaks from edx-lint for linting in edx-lint -# # NOTE: Use Python 3.x, which no longer includes comments in the output file # $ edx_lint write pylintrc # # 4. Make a new version of edx_lint, submit and review a pull request with the -# pylintrc update, and after merging, update the edx-lint version by -# creating a new tag in the repo (uses pbr). +# pylintrc update, and after merging, update the edx-lint version and +# publish the new version. # # 5. In your local repo, install the newer version of edx-lint. # # 6. Run: # -# # uses local pylintrc_tweaks # $ edx_lint write pylintrc # # 7. This will modify the local file. Submit a pull request to get it @@ -63,6 +64,8 @@ # SERIOUSLY. # # ------------------------------ +# Generated by edx-lint version: 5.2.1 +# ------------------------------ [MASTER] ignore = .tox,migrations,tests,.pycharm_helpers persistent = yes @@ -73,136 +76,150 @@ enable = blacklisted-name, line-too-long, - syntax-error, - init-is-generator, - return-in-init, - function-redefined, - not-in-loop, - return-outside-function, - yield-outside-function, - return-arg-in-generator, - nonexistent-operator, - duplicate-argument-name, abstract-class-instantiated, - bad-reversed-sequence, - continue-in-finally, - method-hidden, + abstract-method, access-member-before-definition, - no-method-argument, - no-self-argument, - invalid-slots-object, + anomalous-backslash-in-string, + anomalous-unicode-escape-in-string, + arguments-differ, + assert-on-tuple, assigning-non-slot, - invalid-slots, - inherit-non-class, - inconsistent-mro, + assignment-from-no-return, + assignment-from-none, + attribute-defined-outside-init, + bad-except-order, + bad-format-character, + bad-format-string-key, + bad-format-string, + bad-open-mode, + bad-reversed-sequence, + bad-staticmethod-argument, + bad-str-strip-call, + bad-super-call, + binary-op-exception, + boolean-datetime, + catching-non-exception, + cell-var-from-loop, + confusing-with-statement, + continue-in-finally, + cyclical-import, + dangerous-default-value, + dict-items-not-iterating, + dict-keys-not-iterating, + dict-values-not-iterating, + duplicate-argument-name, duplicate-bases, - non-iterator-returned, - unexpected-special-method-signature, - invalid-length-returned, + duplicate-except, + duplicate-key, + eq-without-hash, + exception-escape, + exception-message-attribute, + expression-not-assigned, + filter-builtin-not-iterating, + format-combined-specification, + format-needs-mapping, + function-redefined, + global-variable-undefined, import-error, - used-before-assignment, - undefined-variable, - undefined-all-variable, + import-self, + inconsistent-mro, + indexing-exception, + inherit-non-class, + init-is-generator, invalid-all-object, - no-name-in-module, - unbalance-tuple-unpacking, - unpacking-non-sequence, - bad-except-order, - raising-bad-type, - misplaced-bare-raise, - raising-non-exception, - nonimplemented-raised, - catching-non-exception, - slots-on-old-class, - super-on-old-class, - bad-super-call, - missing-super-argument, - no-member, - not-callable, - assignment-from-no-return, - no-value-for-parameter, - too-many-function-args, - unexpected-keyword-arg, - redundant-keyword-arg, + invalid-encoded-data, + invalid-format-index, + invalid-length-returned, invalid-sequence-index, invalid-slice-index, - assignment-from-none, - not-context-manager, + invalid-slots-object, + invalid-slots, + invalid-str-codec, invalid-unary-operand-type, - unsupported-binary-operation, - repeated-keyword, - not-an-iterable, - not-a-mapping, - unsupported-membership-test, - unsubscriptable-object, - logging-unsupported-format, - logging-too-many-args, logging-too-few-args, - bad-format-character, - truncated-format-string, - mixed-fomat-string, - format-needs-mapping, + logging-too-many-args, + logging-unsupported-format, + lost-exception, + map-builtin-not-iterating, + method-hidden, + misplaced-bare-raise, + misplaced-future, + missing-format-argument-key, + missing-format-attribute, missing-format-string-key, - too-many-format-args, - too-few-format-args, - bad-str-strip-call, + missing-super-argument, + mixed-fomat-string, model-unicode-not-callable, - super-method-not-called, + no-member, + no-method-argument, + no-name-in-module, + no-self-argument, + no-value-for-parameter, + non-iterator-returned, non-parent-method-called, - test-inherits-tests, - translation-of-non-string, - redefined-variable-type, - cyclical-import, - unreachable, - dangerous-default-value, + nonexistent-operator, + nonimplemented-raised, + nonstandard-exception, + not-a-mapping, + not-an-iterable, + not-callable, + not-context-manager, + not-in-loop, pointless-statement, pointless-string-statement, - expression-not-assigned, - duplicate-key, - confusing-with-statement, - using-constant-test, - lost-exception, - assert-on-tuple, - attribute-defined-outside-init, - bad-staticmethod-argument, - arguments-differ, - signature-differs, - abstract-method, - super-init-not-called, - relative-import, - import-self, - misplaced-future, - invalid-encoded-data, - global-variable-undefined, - redefined-outer-name, + property-on-old-class, + raising-bad-type, + raising-non-exception, + raising-string, + range-builtin-not-iterating, redefined-builtin, redefined-in-handler, + redefined-outer-name, + redefined-variable-type, + redundant-keyword-arg, + relative-import, + repeated-keyword, + return-arg-in-generator, + return-in-init, + return-outside-function, + signature-differs, + slots-on-old-class, + super-init-not-called, + super-method-not-called, + super-on-old-class, + syntax-error, + sys-max-int, + test-inherits-tests, + too-few-format-args, + too-many-format-args, + too-many-function-args, + translation-of-non-string, + truncated-format-string, + unbalance-tuple-unpacking, + undefined-all-variable, undefined-loop-variable, - cell-var-from-loop, - duplicate-except, - nonstandard-exception, - binary-op-exception, - property-on-old-class, - bad-format-string-key, - unused-format-string-key, - bad-format-string, - missing-format-argument-key, + undefined-variable, + unexpected-keyword-arg, + unexpected-special-method-signature, + unpacking-non-sequence, + unreachable, + unsubscriptable-object, + unsupported-binary-operation, + unsupported-membership-test, unused-format-string-argument, - format-combined-specification, - missing-format-attribute, - invalid-format-index, - anomalous-backslash-in-string, - anomalous-unicode-escape-in-string, - bad-open-mode, - boolean-datetime, + unused-format-string-key, + used-before-assignment, + using-constant-test, + yield-outside-function, + zip-builtin-not-iterating, - fatal, astroid-error, - parse-error, - method-check-failed, + django-not-available-placeholder, django-not-available, + fatal, + method-check-failed, + parse-error, raw-checker-failed, - django-not-available-placeholder, empty-docstring, invalid-characters-in-docstring, @@ -210,158 +227,171 @@ enable = wrong-spelling-in-comment, wrong-spelling-in-docstring, + unused-argument, unused-import, unused-variable, - unused-argument, - exec-used, eval-used, + exec-used, bad-classmethod-argument, bad-mcs-classmethod-argument, bad-mcs-method-argument, bad-whitespace, + bare-except, + broad-except, consider-iterating-dictionary, consider-using-enumerate, + global-at-module-level, + global-variable-not-assigned, literal-used-as-attribute, + logging-format-interpolation, + logging-not-lazy, + metaclass-assignment, + model-has-unicode, + model-missing-unicode, + model-no-explicit-unicode, multiple-imports, multiple-statements, + no-classmethod-decorator, + no-staticmethod-decorator, + old-raise-syntax, old-style-class, + protected-access, + redundant-unittest-assert, + reimported, + simplifiable-if-statement, simplifiable-range, singleton-comparison, superfluous-parens, unidiomatic-typecheck, - unneeded-not, - wrong-assert-type, - simplifiable-if-statement, - no-classmethod-decorator, - no-staticmethod-decorator, - unnecessary-pass, unnecessary-lambda, - useless-else-on-loop, + unnecessary-pass, unnecessary-semicolon, - reimported, - global-variable-not-assigned, - global-at-module-level, - bare-except, - broad-except, - logging-not-lazy, - redundant-unittest-assert, - model-missing-unicode, - model-has-unicode, - model-no-explicit-unicode, - protected-access, + unneeded-not, + useless-else-on-loop, + wrong-assert-type, - deprecated-module, deprecated-method, + deprecated-module, + too-many-boolean-expressions, too-many-nested-blocks, too-many-statements, - too-many-boolean-expressions, + wildcard-import, wrong-import-order, wrong-import-position, - wildcard-import, missing-final-newline, + mixed-indentation, mixed-line-endings, trailing-newlines, trailing-whitespace, unexpected-line-ending-format, - mixed-indentation, + bad-inline-option, bad-option-value, + deprecated-pragma, unrecognized-inline-option, useless-suppression, - bad-inline-option, - deprecated-pragma, + + cmp-method, + coerce-method, + delslice-method, + dict-iter-method, + dict-view-method, + div-method, + getslice-method, + hex-method, + idiv-method, + next-method-called, + next-method-defined, + nonzero-method, + oct-method, + rdiv-method, + setslice-method, + using-cmp-argument, disable = bad-continuation, - invalid-name, - misplaced-comparison-constant, - file-ignored, bad-indentation, - lowercase-l-suffix, - unused-wildcard-import, + consider-using-f-string, + duplicate-code, + file-ignored, + fixme, global-statement, + invalid-name, + locally-disabled, + locally-enabled, + lowercase-l-suffix, + misplaced-comparison-constant, no-else-return, + no-init, + no-self-use, + suppressed-message, + too-few-public-methods, + too-many-ancestors, + too-many-arguments, + too-many-branches, + too-many-instance-attributes, + too-many-lines, + too-many-locals, + too-many-public-methods, + too-many-return-statements, + ungrouped-imports, + unspecified-encoding, + unused-wildcard-import, + use-maxsplit-arg, + + feature-toggle-needs-doc, + illegal-waffle-usage, apply-builtin, backtick, + bad-python3-import, basestring-builtin, buffer-builtin, cmp-builtin, - cmp-method, coerce-builtin, - coerce-method, - delslice-method, - django-not-configured, - dict-iter-method, - dict-view-method, - duplicate-code, + deprecated-itertools-function, + deprecated-operator-function, + deprecated-str-translate-call, + deprecated-string-function, + deprecated-sys-function, + deprecated-types-field, + deprecated-urllib-function, execfile-builtin, - feature-toggle-needs-doc, file-builtin, - filter-builtin-not-iterating, - fixme, - getslice-method, - hex-method, - illegal-waffle-usage, import-star-module-level, - indexing-exception, input-builtin, intern-builtin, - locally-disabled, - locally-enabled, - logging-format-interpolation, long-builtin, long-suffix, - map-builtin-not-iterating, - metaclass-assignment, - next-method-called, no-absolute-import, - no-init, - no-self-use, - nonzero-method, - oct-method, + non-ascii-bytes-literal, old-division, old-ne-operator, old-octal-literal, - old-raise-syntax, parameter-unpacking, print-statement, - raising-string, - range-builtin-not-iterating, raw_input-builtin, reduce-builtin, reload-builtin, round-builtin, - setslice-method, standarderror-builtin, - suppressed-message, - too-few-public-methods, - too-many-ancestors, - too-many-arguments, - too-many-branches, - too-many-instance-attributes, - too-many-lines, - too-many-locals, - too-many-public-methods, - too-many-return-statements, - ungrouped-imports, unichr-builtin, unicode-builtin, unpacking-in-except, - using-cmp-argument, xrange-builtin, - zip-builtin-not-iterating, + + logging-fstring-interpolation, useless-object-inheritance, [REPORTS] output-format = text files-output = no reports = no -evaluation = 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) +score = no [BASIC] bad-functions = map,filter,apply,input @@ -455,4 +485,4 @@ int-import-graph = [EXCEPTIONS] overgeneral-exceptions = Exception -# c22b10ad981357b4c544549658a94092255a50d4 +# 6a244ef8b04e25d76738f15ddb2e8c65cfed393f diff --git a/pylintrc_backup b/pylintrc_backup new file mode 100644 index 0000000..6235f16 --- /dev/null +++ b/pylintrc_backup @@ -0,0 +1,458 @@ +# *************************** +# ** DO NOT EDIT THIS FILE ** +# *************************** +# +# This file was generated by edx-lint: http://github.com/edx/edx-lint +# +# If you want to change this file, you have two choices, depending on whether +# you want to make a local change that applies only to this repo, or whether +# you want to make a central change that applies to all repos using edx-lint. +# +# LOCAL CHANGE: +# +# 1. Edit the local pylintrc_tweaks file to add changes just to this +# repo's file. +# +# 2. Run: +# +# $ edx_lint write pylintrc +# +# 3. This will modify the local file. Submit a pull request to get it +# checked in so that others will benefit. +# +# +# CENTRAL CHANGE: +# +# 1. Edit the pylintrc file in the edx-lint repo at +# https://github.com/edx/edx-lint/blob/master/edx_lint/files/pylintrc +# +# 2. install the updated version of edx-lint (in edx-lint): +# +# $ pip install . +# +# 3. Run (in edx-lint): +# +# # uses pylintrc_tweaks from edx-lint for linting in edx-lint +# # NOTE: Use Python 3.x, which no longer includes comments in the output file +# $ edx_lint write pylintrc +# +# 4. Make a new version of edx_lint, submit and review a pull request with the +# pylintrc update, and after merging, update the edx-lint version by +# creating a new tag in the repo (uses pbr). +# +# 5. In your local repo, install the newer version of edx-lint. +# +# 6. Run: +# +# # uses local pylintrc_tweaks +# $ edx_lint write pylintrc +# +# 7. This will modify the local file. Submit a pull request to get it +# checked in so that others will benefit. +# +# +# +# +# +# STAY AWAY FROM THIS FILE! +# +# +# +# +# +# SERIOUSLY. +# +# ------------------------------ +[MASTER] +ignore = .tox,migrations,tests,.pycharm_helpers +persistent = yes +load-plugins = edx_lint.pylint,pylint_django,pylint_celery + +[MESSAGES CONTROL] +enable = + blacklisted-name, + line-too-long, + + syntax-error, + init-is-generator, + return-in-init, + function-redefined, + not-in-loop, + return-outside-function, + yield-outside-function, + return-arg-in-generator, + nonexistent-operator, + duplicate-argument-name, + abstract-class-instantiated, + bad-reversed-sequence, + continue-in-finally, + method-hidden, + access-member-before-definition, + no-method-argument, + no-self-argument, + invalid-slots-object, + assigning-non-slot, + invalid-slots, + inherit-non-class, + inconsistent-mro, + duplicate-bases, + non-iterator-returned, + unexpected-special-method-signature, + invalid-length-returned, + import-error, + used-before-assignment, + undefined-variable, + undefined-all-variable, + invalid-all-object, + no-name-in-module, + unbalance-tuple-unpacking, + unpacking-non-sequence, + bad-except-order, + raising-bad-type, + misplaced-bare-raise, + raising-non-exception, + nonimplemented-raised, + catching-non-exception, + slots-on-old-class, + super-on-old-class, + bad-super-call, + missing-super-argument, + no-member, + not-callable, + assignment-from-no-return, + no-value-for-parameter, + too-many-function-args, + unexpected-keyword-arg, + redundant-keyword-arg, + invalid-sequence-index, + invalid-slice-index, + assignment-from-none, + not-context-manager, + invalid-unary-operand-type, + unsupported-binary-operation, + repeated-keyword, + not-an-iterable, + not-a-mapping, + unsupported-membership-test, + unsubscriptable-object, + logging-unsupported-format, + logging-too-many-args, + logging-too-few-args, + bad-format-character, + truncated-format-string, + mixed-fomat-string, + format-needs-mapping, + missing-format-string-key, + too-many-format-args, + too-few-format-args, + bad-str-strip-call, + model-unicode-not-callable, + super-method-not-called, + non-parent-method-called, + test-inherits-tests, + translation-of-non-string, + redefined-variable-type, + cyclical-import, + unreachable, + dangerous-default-value, + pointless-statement, + pointless-string-statement, + expression-not-assigned, + duplicate-key, + confusing-with-statement, + using-constant-test, + lost-exception, + assert-on-tuple, + attribute-defined-outside-init, + bad-staticmethod-argument, + arguments-differ, + signature-differs, + abstract-method, + super-init-not-called, + relative-import, + import-self, + misplaced-future, + invalid-encoded-data, + global-variable-undefined, + redefined-outer-name, + redefined-builtin, + redefined-in-handler, + undefined-loop-variable, + cell-var-from-loop, + duplicate-except, + nonstandard-exception, + binary-op-exception, + property-on-old-class, + bad-format-string-key, + unused-format-string-key, + bad-format-string, + missing-format-argument-key, + unused-format-string-argument, + format-combined-specification, + missing-format-attribute, + invalid-format-index, + anomalous-backslash-in-string, + anomalous-unicode-escape-in-string, + bad-open-mode, + boolean-datetime, + + fatal, + astroid-error, + parse-error, + method-check-failed, + django-not-available, + raw-checker-failed, + django-not-available-placeholder, + + empty-docstring, + invalid-characters-in-docstring, + missing-docstring, + wrong-spelling-in-comment, + wrong-spelling-in-docstring, + + unused-import, + unused-variable, + unused-argument, + + exec-used, + eval-used, + + bad-classmethod-argument, + bad-mcs-classmethod-argument, + bad-mcs-method-argument, + bad-whitespace, + consider-iterating-dictionary, + consider-using-enumerate, + literal-used-as-attribute, + multiple-imports, + multiple-statements, + old-style-class, + simplifiable-range, + singleton-comparison, + superfluous-parens, + unidiomatic-typecheck, + unneeded-not, + wrong-assert-type, + simplifiable-if-statement, + no-classmethod-decorator, + no-staticmethod-decorator, + unnecessary-pass, + unnecessary-lambda, + useless-else-on-loop, + unnecessary-semicolon, + reimported, + global-variable-not-assigned, + global-at-module-level, + bare-except, + broad-except, + logging-not-lazy, + redundant-unittest-assert, + model-missing-unicode, + model-has-unicode, + model-no-explicit-unicode, + protected-access, + + deprecated-module, + deprecated-method, + + too-many-nested-blocks, + too-many-statements, + too-many-boolean-expressions, + + wrong-import-order, + wrong-import-position, + wildcard-import, + + missing-final-newline, + mixed-line-endings, + trailing-newlines, + trailing-whitespace, + unexpected-line-ending-format, + mixed-indentation, + + bad-option-value, + unrecognized-inline-option, + useless-suppression, + bad-inline-option, + deprecated-pragma, +disable = + bad-continuation, + invalid-name, + misplaced-comparison-constant, + file-ignored, + bad-indentation, + lowercase-l-suffix, + unused-wildcard-import, + global-statement, + no-else-return, + + apply-builtin, + backtick, + basestring-builtin, + buffer-builtin, + cmp-builtin, + cmp-method, + coerce-builtin, + coerce-method, + delslice-method, + django-not-configured, + dict-iter-method, + dict-view-method, + duplicate-code, + execfile-builtin, + feature-toggle-needs-doc, + file-builtin, + filter-builtin-not-iterating, + fixme, + getslice-method, + hex-method, + illegal-waffle-usage, + import-star-module-level, + indexing-exception, + input-builtin, + intern-builtin, + locally-disabled, + locally-enabled, + logging-format-interpolation, + long-builtin, + long-suffix, + map-builtin-not-iterating, + metaclass-assignment, + next-method-called, + no-absolute-import, + no-init, + no-self-use, + nonzero-method, + oct-method, + old-division, + old-ne-operator, + old-octal-literal, + old-raise-syntax, + parameter-unpacking, + print-statement, + raising-string, + range-builtin-not-iterating, + raw_input-builtin, + reduce-builtin, + reload-builtin, + round-builtin, + setslice-method, + standarderror-builtin, + suppressed-message, + too-few-public-methods, + too-many-ancestors, + too-many-arguments, + too-many-branches, + too-many-instance-attributes, + too-many-lines, + too-many-locals, + too-many-public-methods, + too-many-return-statements, + ungrouped-imports, + unichr-builtin, + unicode-builtin, + unpacking-in-except, + using-cmp-argument, + xrange-builtin, + zip-builtin-not-iterating, + useless-object-inheritance, + +[REPORTS] +output-format = text +files-output = no +reports = no +evaluation = 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +[BASIC] +bad-functions = map,filter,apply,input +module-rgx = (([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ +const-rgx = (([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns)$ +class-rgx = [A-Z_][a-zA-Z0-9]+$ +function-rgx = ([a-z_][a-z0-9_]{2,40}|test_[a-z0-9_]+)$ +method-rgx = ([a-z_][a-z0-9_]{2,40}|setUp|set[Uu]pClass|tearDown|tear[Dd]ownClass|assert[A-Z]\w*|maxDiff|test_[a-z0-9_]+)$ +attr-rgx = [a-z_][a-z0-9_]{2,30}$ +argument-rgx = [a-z_][a-z0-9_]{2,30}$ +variable-rgx = [a-z_][a-z0-9_]{2,30}$ +class-attribute-rgx = ([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ +inlinevar-rgx = [A-Za-z_][A-Za-z0-9_]*$ +good-names = f,i,j,k,db,ex,Run,_,__ +bad-names = foo,bar,baz,toto,tutu,tata +no-docstring-rgx = __.*__$|test_.+|setUp$|setUpClass$|tearDown$|tearDownClass$|Meta$ +docstring-min-length = 5 + +[FORMAT] +max-line-length = 120 +ignore-long-lines = ^\s*(# )?((?)|(\.\. \w+: .*))$ +single-line-if-stmt = no +no-space-check = trailing-comma,dict-separator +max-module-lines = 1000 +indent-string = ' ' + +[MISCELLANEOUS] +notes = FIXME,XXX,TODO + +[SIMILARITIES] +min-similarity-lines = 4 +ignore-comments = yes +ignore-docstrings = yes +ignore-imports = no + +[TYPECHECK] +ignore-mixin-members = yes +ignored-classes = SQLObject +unsafe-load-any-extension = yes +generated-members = + REQUEST, + acl_users, + aq_parent, + objects, + DoesNotExist, + can_read, + can_write, + get_url, + size, + content, + status_code, + create, + build, + fields, + tag, + org, + course, + category, + name, + revision, + _meta, + +[VARIABLES] +init-import = no +dummy-variables-rgx = _|dummy|unused|.*_unused +additional-builtins = + +[CLASSES] +defining-attr-methods = __init__,__new__,setUp +valid-classmethod-first-arg = cls +valid-metaclass-classmethod-first-arg = mcs + +[DESIGN] +max-args = 5 +ignored-argument-names = _.* +max-locals = 15 +max-returns = 6 +max-branches = 12 +max-statements = 50 +max-parents = 7 +max-attributes = 7 +min-public-methods = 2 +max-public-methods = 20 + +[IMPORTS] +deprecated-modules = regsub,TERMIOS,Bastion,rexec +import-graph = +ext-import-graph = +int-import-graph = + +[EXCEPTIONS] +overgeneral-exceptions = Exception + +# c22b10ad981357b4c544549658a94092255a50d4 diff --git a/requirements/base.txt b/requirements/base.txt index f5c637f..9de06ed 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -6,11 +6,11 @@ # appdirs==1.4.4 # via fs -fs==2.4.13 +fs==2.4.15 # via xblock -lxml==4.6.3 +lxml==4.7.1 # via xblock -mako==1.1.5 +mako==1.1.6 # via -r requirements/base.in markupsafe==2.0.1 # via @@ -18,25 +18,25 @@ markupsafe==2.0.1 # xblock python-dateutil==2.8.2 # via xblock -pytz==2021.1 +pytz==2021.3 # via # fs # xblock -pyyaml==5.4.1 +pyyaml==6.0 # via xblock -simplejson==3.17.5 +simplejson==3.17.6 # via -r requirements/base.in six==1.16.0 # via # fs # python-dateutil -web-fragments==1.1.0 +web-fragments==2.0.0 # via # -r requirements/base.in # xblock webob==1.8.7 # via xblock -xblock==1.5.1 +xblock==1.6.1 # via -r requirements/base.in # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/ci.txt b/requirements/ci.txt index b32b85c..e7250dd 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -4,23 +4,21 @@ # # make upgrade # -backports.entry-points-selectable==1.1.0 +distlib==0.3.4 # via virtualenv -distlib==0.3.2 - # via virtualenv -filelock==3.0.12 +filelock==3.4.2 # via # tox # virtualenv -packaging==21.0 +packaging==21.3 # via tox -platformdirs==2.3.0 +platformdirs==2.5.0 # via virtualenv pluggy==1.0.0 # via tox -py==1.10.0 +py==1.11.0 # via tox -pyparsing==2.4.7 +pyparsing==3.0.7 # via packaging six==1.16.0 # via @@ -28,11 +26,11 @@ six==1.16.0 # virtualenv toml==0.10.2 # via tox -tox==3.24.3 +tox==3.24.5 # via # -r requirements/ci.in # tox-battery tox-battery==0.6.1 # via -r requirements/ci.in -virtualenv==20.7.2 +virtualenv==20.13.1 # via tox diff --git a/requirements/dev.txt b/requirements/dev.txt index 71648c1..2aeaa21 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -8,75 +8,106 @@ appdirs==1.4.4 # via # -r requirements/test.txt # fs -astroid==2.7.3 +arrow==1.2.2 + # via + # -r requirements/test.txt + # jinja2-time +asgiref==3.5.0 + # via + # -r requirements/test.txt + # django +astroid==2.9.3 # via # -r requirements/test.txt # pylint # pylint-celery -attrs==21.2.0 +attrs==21.4.0 # via # -r requirements/test.txt # pytest -backports.entry-points-selectable==1.1.0 +binaryornot==0.4.4 # via - # -r requirements/ci.txt - # virtualenv + # -r requirements/test.txt + # cookiecutter bleach==4.1.0 # via # -r requirements/test.txt # readme-renderer bok_choy==0.7.1 # via -r requirements/test.txt -boto3==1.18.36 +boto==2.49.0 + # via + # -r requirements/test.txt + # xblock-sdk +boto3==1.20.52 # via # -r requirements/test.txt # fs-s3fs -botocore==1.21.36 +botocore==1.23.52 # via # -r requirements/test.txt # boto3 # s3transfer -click==8.0.1 +certifi==2021.10.8 + # via + # -r requirements/test.txt + # requests +chardet==4.0.0 + # via + # -r requirements/test.txt + # binaryornot +charset-normalizer==2.0.11 + # via + # -r requirements/test.txt + # requests +click==8.0.3 # via # -r requirements/pip-tools.txt # -r requirements/test.txt # click-log # code-annotations + # cookiecutter # edx-lint # pip-tools click-log==0.3.2 # via # -r requirements/test.txt # edx-lint -code-annotations==1.2.0 +code-annotations==1.3.0 # via # -r requirements/test.txt # edx-lint -ddt==1.4.2 +cookiecutter==1.7.3 + # via + # -r requirements/test.txt + # xblock-sdk +ddt==1.4.4 # via -r requirements/test.txt -distlib==0.3.2 +distlib==0.3.4 # via # -r requirements/ci.txt # virtualenv -django==2.2.24 +django==3.2.12 # via # -r requirements/test.txt # django-pyfs # xblock-sdk -django-pyfs==3.1.0 - # via -r requirements/test.txt -docutils==0.17.1 +django-pyfs==3.2.0 + # via + # -r requirements/test.txt + # xblock-sdk +docutils==0.18.1 # via # -r requirements/test.txt # readme-renderer -edx-lint==5.1.0 +edx-lint==5.2.1 # via -r requirements/test.txt -filelock==3.0.12 +filelock==3.4.2 # via # -r requirements/ci.txt # tox # virtualenv -fs==2.4.13 +fs==2.4.15 # via # -r requirements/test.txt # django-pyfs @@ -86,18 +117,29 @@ fs-s3fs==1.1.1 # via # -r requirements/test.txt # django-pyfs + # xblock-sdk +idna==3.3 + # via + # -r requirements/test.txt + # requests iniconfig==1.1.1 # via # -r requirements/test.txt # pytest -isort==5.9.3 +isort==5.10.1 # via # -r requirements/test.txt # pylint -jinja2==3.0.1 +jinja2==3.0.3 # via # -r requirements/test.txt # code-annotations + # cookiecutter + # jinja2-time +jinja2-time==0.2.0 + # via + # -r requirements/test.txt + # cookiecutter jmespath==0.10.0 # via # -r requirements/test.txt @@ -107,15 +149,17 @@ lazy==1.4 # via # -r requirements/test.txt # bok-choy -lazy-object-proxy==1.6.0 + # xblock-sdk +lazy-object-proxy==1.7.1 # via # -r requirements/test.txt # astroid -lxml==4.6.3 +lxml==4.7.1 # via # -r requirements/test.txt # xblock -mako==1.1.5 + # xblock-sdk +mako==1.1.6 # via -r requirements/test.txt markupsafe==2.0.1 # via @@ -137,28 +181,28 @@ nose==1.3.7 # via # -r requirements/test.txt # needle -packaging==21.0 +packaging==21.3 # via # -r requirements/ci.txt # -r requirements/test.txt # bleach # pytest # tox -pbr==5.6.0 +pbr==5.8.1 # via # -r requirements/test.txt # stevedore -pep517==0.11.0 +pep517==0.12.0 # via # -r requirements/pip-tools.txt # pip-tools -pillow==8.3.2 +pillow==9.0.1 # via # -r requirements/test.txt # needle -pip-tools==6.2.0 +pip-tools==6.5.1 # via -r requirements/pip-tools.txt -platformdirs==2.3.0 +platformdirs==2.5.0 # via # -r requirements/ci.txt # -r requirements/test.txt @@ -170,19 +214,23 @@ pluggy==1.0.0 # -r requirements/test.txt # pytest # tox -py==1.10.0 +poyo==0.5.0 + # via + # -r requirements/test.txt + # cookiecutter +py==1.11.0 # via # -r requirements/ci.txt # -r requirements/test.txt # pytest # tox -pycodestyle==2.7.0 +pycodestyle==2.8.0 # via -r requirements/test.txt -pygments==2.10.0 +pygments==2.11.2 # via # -r requirements/test.txt # readme-renderer -pylint==2.10.2 +pylint==2.12.2 # via # -r requirements/test.txt # edx-lint @@ -193,51 +241,60 @@ pylint-celery==0.3 # via # -r requirements/test.txt # edx-lint -pylint-django==2.4.4 +pylint-django==2.5.0 # via # -r requirements/test.txt # edx-lint -pylint-plugin-utils==0.6 +pylint-plugin-utils==0.7 # via # -r requirements/test.txt # pylint-celery # pylint-django -pyparsing==2.4.7 +pyparsing==3.0.7 # via # -r requirements/ci.txt # -r requirements/test.txt # packaging pypng==0.0.21 - # via -r requirements/test.txt -pytest==6.2.5 + # via + # -r requirements/test.txt + # xblock-sdk +pytest==7.0.0 # via # -r requirements/test.txt # pytest-django -pytest-django==4.4.0 +pytest-django==4.5.2 # via -r requirements/test.txt python-dateutil==2.8.2 # via # -r requirements/test.txt + # arrow # botocore # xblock python-slugify==5.0.2 # via # -r requirements/test.txt # code-annotations -pytz==2021.1 + # cookiecutter +pytz==2021.3 # via # -r requirements/test.txt # django # fs # xblock -pyyaml==5.4.1 +pyyaml==6.0 # via # -r requirements/test.txt # code-annotations # xblock -readme-renderer==29.0 +readme-renderer==32.0 # via -r requirements/test.txt -s3transfer==0.5.0 +requests==2.27.1 + # via + # -r requirements/test.txt + # cookiecutter + # xblock-sdk +s3transfer==0.5.1 # via # -r requirements/test.txt # boto3 @@ -246,26 +303,28 @@ selenium==3.4.1 # -r requirements/test.txt # bok-choy # needle -simplejson==3.17.5 - # via -r requirements/test.txt +simplejson==3.17.6 + # via + # -r requirements/test.txt + # xblock-sdk six==1.16.0 # via # -r requirements/ci.txt # -r requirements/test.txt # bleach # bok-choy + # cookiecutter # edx-lint # fs # fs-s3fs # python-dateutil - # readme-renderer # tox # virtualenv -sqlparse==0.4.1 +sqlparse==0.4.2 # via # -r requirements/test.txt # django -stevedore==3.4.0 +stevedore==3.5.0 # via # -r requirements/test.txt # code-annotations @@ -278,30 +337,38 @@ toml==0.10.2 # -r requirements/ci.txt # -r requirements/test.txt # pylint - # pytest # tox -tomli==1.2.1 +tomli==2.0.1 # via # -r requirements/pip-tools.txt + # -r requirements/test.txt # pep517 -tox==3.24.3 + # pytest +tox==3.24.5 # via # -r requirements/ci.txt # tox-battery tox-battery==0.6.1 # via -r requirements/ci.txt -urllib3==1.26.6 +typing-extensions==4.0.1 + # via + # -r requirements/test.txt + # astroid + # pylint +urllib3==1.26.8 # via # -r requirements/test.txt # botocore -virtualenv==20.7.2 + # requests +virtualenv==20.13.1 # via # -r requirements/ci.txt # tox -web-fragments==1.1.0 +web-fragments==2.0.0 # via # -r requirements/test.txt # xblock + # xblock-sdk webencodings==0.5.1 # via # -r requirements/test.txt @@ -310,17 +377,20 @@ webob==1.8.7 # via # -r requirements/test.txt # xblock -wheel==0.37.0 + # xblock-sdk +wheel==0.37.1 # via # -r requirements/pip-tools.txt # pip-tools -wrapt==1.12.1 +wrapt==1.13.3 # via # -r requirements/test.txt # astroid -xblock==1.5.1 - # via -r requirements/test.txt -xblock-sdk==0.3.0 +xblock==1.6.1 + # via + # -r requirements/test.txt + # xblock-sdk +xblock-sdk==0.5.1 # via -r requirements/test.txt # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 3a172bb..2a6effa 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -4,15 +4,15 @@ # # make upgrade # -click==8.0.1 +click==8.0.3 # via pip-tools -pep517==0.11.0 +pep517==0.12.0 # via pip-tools -pip-tools==6.2.0 +pip-tools==6.5.1 # via -r requirements/pip-tools.in -tomli==1.2.1 +tomli==2.0.1 # via pep517 -wheel==0.37.0 +wheel==0.37.1 # via pip-tools # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/test.txt b/requirements/test.txt index 0642973..2d28cb1 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -8,72 +8,103 @@ appdirs==1.4.4 # via # -r requirements/base.txt # fs -astroid==2.7.3 +arrow==1.2.2 + # via jinja2-time +asgiref==3.5.0 + # via django +astroid==2.9.3 # via # pylint # pylint-celery -attrs==21.2.0 +attrs==21.4.0 # via pytest +binaryornot==0.4.4 + # via cookiecutter bleach==4.1.0 # via readme-renderer bok_choy==0.7.1 # via # -c requirements/constraints.txt # -r requirements/test.in -boto3==1.18.36 +boto==2.49.0 + # via xblock-sdk +boto3==1.20.52 # via fs-s3fs -botocore==1.21.36 +botocore==1.23.52 # via # boto3 # s3transfer -click==8.0.1 +certifi==2021.10.8 + # via requests +chardet==4.0.0 + # via binaryornot +charset-normalizer==2.0.11 + # via requests +click==8.0.3 # via # click-log # code-annotations + # cookiecutter # edx-lint click-log==0.3.2 # via edx-lint -code-annotations==1.2.0 +code-annotations==1.3.0 # via edx-lint -ddt==1.4.2 +cookiecutter==1.7.3 + # via xblock-sdk +ddt==1.4.4 # via -r requirements/test.in # via # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # django-pyfs # xblock-sdk -django-pyfs==3.1.0 - # via -r requirements/test.in -docutils==0.17.1 +django-pyfs==3.2.0 + # via + # -r requirements/test.in + # xblock-sdk +docutils==0.18.1 # via readme-renderer -edx-lint==5.1.0 +edx-lint==5.2.1 # via -r requirements/test.in -fs==2.4.13 +fs==2.4.15 # via # -r requirements/base.txt # django-pyfs # fs-s3fs # xblock fs-s3fs==1.1.1 - # via django-pyfs + # via + # django-pyfs + # xblock-sdk +idna==3.3 + # via requests iniconfig==1.1.1 # via pytest -isort==5.9.3 +isort==5.10.1 # via pylint -jinja2==3.0.1 - # via code-annotations +jinja2==3.0.3 + # via + # code-annotations + # cookiecutter + # jinja2-time +jinja2-time==0.2.0 + # via cookiecutter jmespath==0.10.0 # via # boto3 # botocore lazy==1.4 - # via bok-choy -lazy-object-proxy==1.6.0 + # via + # bok-choy + # xblock-sdk +lazy-object-proxy==1.7.1 # via astroid -lxml==4.6.3 +lxml==4.7.1 # via # -r requirements/base.txt # xblock -mako==1.1.5 + # xblock-sdk +mako==1.1.6 # via -r requirements/base.txt markupsafe==2.0.1 # via @@ -89,25 +120,27 @@ needle==0.5.0 # via bok-choy nose==1.3.7 # via needle -packaging==21.0 +packaging==21.3 # via # bleach # pytest -pbr==5.6.0 +pbr==5.8.1 # via stevedore -pillow==8.3.2 +pillow==9.0.1 # via needle -platformdirs==2.3.0 +platformdirs==2.5.0 # via pylint pluggy==1.0.0 # via pytest -py==1.10.0 +poyo==0.5.0 + # via cookiecutter +py==1.11.0 # via pytest -pycodestyle==2.7.0 +pycodestyle==2.8.0 # via -r requirements/test.in -pygments==2.10.0 +pygments==2.11.2 # via readme-renderer -pylint==2.10.2 +pylint==2.12.2 # via # edx-lint # pylint-celery @@ -115,41 +148,50 @@ pylint==2.10.2 # pylint-plugin-utils pylint-celery==0.3 # via edx-lint -pylint-django==2.4.4 +pylint-django==2.5.0 # via edx-lint -pylint-plugin-utils==0.6 +pylint-plugin-utils==0.7 # via # pylint-celery # pylint-django -pyparsing==2.4.7 +pyparsing==3.0.7 # via packaging pypng==0.0.21 - # via -r requirements/test.in -pytest==6.2.5 + # via + # -r requirements/test.in + # xblock-sdk +pytest==7.0.0 # via pytest-django -pytest-django==4.4.0 +pytest-django==4.5.2 # via -r requirements/test.in python-dateutil==2.8.2 # via # -r requirements/base.txt + # arrow # botocore # xblock python-slugify==5.0.2 - # via code-annotations -pytz==2021.1 + # via + # code-annotations + # cookiecutter +pytz==2021.3 # via # -r requirements/base.txt # django # fs # xblock -pyyaml==5.4.1 +pyyaml==6.0 # via # -r requirements/base.txt # code-annotations # xblock -readme-renderer==29.0 +readme-renderer==32.0 # via -r requirements/test.in -s3transfer==0.5.0 +requests==2.27.1 + # via + # cookiecutter + # xblock-sdk +s3transfer==0.5.1 # via boto3 selenium==3.4.1 # via @@ -157,45 +199,57 @@ selenium==3.4.1 # -r requirements/test.in # bok-choy # needle -simplejson==3.17.5 - # via -r requirements/base.txt +simplejson==3.17.6 + # via + # -r requirements/base.txt + # xblock-sdk six==1.16.0 # via # -r requirements/base.txt # bleach # bok-choy + # cookiecutter # edx-lint # fs # fs-s3fs # python-dateutil - # readme-renderer -sqlparse==0.4.1 +sqlparse==0.4.2 # via django -stevedore==3.4.0 +stevedore==3.5.0 # via code-annotations text-unidecode==1.3 # via python-slugify toml==0.10.2 + # via pylint +tomli==2.0.1 + # via pytest +typing-extensions==4.0.1 # via + # astroid # pylint - # pytest -urllib3==1.26.6 - # via botocore -web-fragments==1.1.0 +urllib3==1.26.8 + # via + # botocore + # requests +web-fragments==2.0.0 # via # -r requirements/base.txt # xblock + # xblock-sdk webencodings==0.5.1 # via bleach webob==1.8.7 # via # -r requirements/base.txt # xblock -wrapt==1.12.1 + # xblock-sdk +wrapt==1.13.3 # via astroid -xblock==1.5.1 - # via -r requirements/base.txt -xblock-sdk==0.3.0 +xblock==1.6.1 + # via + # -r requirements/base.txt + # xblock-sdk +xblock-sdk==0.5.1 # via -r requirements/test.in # The following packages are considered to be unsafe in a requirements file: diff --git a/setup.py b/setup.py index bd3da8c..a5ef397 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,7 @@ import os.path import re import sys + from setuptools import setup @@ -102,10 +103,8 @@ def get_version(*file_paths): package_data=package_data("xblockutils", ["public", "templates", "templatetags"]), url='https://github.com/edx/xblock-utils', classifiers=[ - 'Framework :: Django :: 2.2', - 'Framework :: Django :: 3.0', - 'Framework :: Django :: 3.1', 'Framework :: Django :: 3.2', + 'Framework :: Django :: 4.0', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.8', diff --git a/tox.ini b/tox.ini index c9bb253..f0cfeba 100644 --- a/tox.ini +++ b/tox.ini @@ -1,24 +1,24 @@ [tox] -envlist = py38-django{22,30,31,32}, quality +envlist = py38-django{32,40}, quality [testenv] -passenv = - CI DISPLAY -deps = - -r requirements/test.txt -commands = - django22: pip install Django>=2.2,<2.3 - django30: pip install Django>=3.0,<3.1 - django31: pip install Django>=3.1,<3.2 - django32: pip install Django>=3.2,<3.3 - python -Wd -m pytest {posargs} +passenv = + CI DISPLAY +deps = + -r requirements/test.txt +commands = + django22: pip install Django>=2.2,<2.3 + django30: pip install Django>=3.0,<3.1 + django31: pip install Django>=3.1,<3.2 + django32: pip install Django>=3.2,<3.3 + python -Wd -m pytest {posargs} [testenv:quality] basepython = python3.8 -deps = - -r requirements/test.txt -commands = - pycodestyle . - pylint xblockutils - python setup.py check -r -s +deps = + -r requirements/test.txt +commands = + pycodestyle . + pylint xblockutils + python setup.py check -r -s diff --git a/xblockutils/templatetags/i18n.py b/xblockutils/templatetags/i18n.py index adde331..90ab8a8 100644 --- a/xblockutils/templatetags/i18n.py +++ b/xblockutils/templatetags/i18n.py @@ -8,7 +8,7 @@ from django.template import Library, Node from django.templatetags import i18n -from django.utils.translation import trans_real, get_language +from django.utils.translation import get_language, trans_real register = Library()