diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 628b4df..e503eab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: matrix: os: [ubuntu-20.04] python-version: ['3.8'] - toxenv: [django22, django30, django31, django32, quality, docs] + toxenv: [quality, docs, django32, django40] steps: - uses: actions/checkout@v2 @@ -36,7 +36,7 @@ jobs: run: tox - name: Run Coverage - if: matrix.python-version == '3.8' && matrix.toxenv=='django22' + if: matrix.python-version == '3.8' && matrix.toxenv=='django32' uses: codecov/codecov-action@v1 with: flags: unittests diff --git a/CHANGELOG.rst b/CHANGELOG.rst index eaa8813..6c30823 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,12 @@ Change Log Unreleased ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +[1.3.0] - 2022-02-07 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* Dropped Django 22, 30 and 31 Support +* Added Django40 Support in CI + [1.2.0] - 2021-07-26 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/code_annotations/__init__.py b/code_annotations/__init__.py index b62db45..3ae765c 100644 --- a/code_annotations/__init__.py +++ b/code_annotations/__init__.py @@ -2,4 +2,4 @@ Extensible tools for parsing annotations in codebases. """ -__version__ = '1.2.0' +__version__ = '1.3.0' diff --git a/pylintrc b/pylintrc index da859b5..9efca91 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 = ,migrations, settings, wsgi.py 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,157 +227,170 @@ 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, - django-not-configured, + 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, - 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,,invalid-name,useless-object-inheritance + + logging-fstring-interpolation,,invalid-name,useless-object-inheritance,django-not-configured,consider-using-dict-items,consider-using-with [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 @@ -454,4 +484,4 @@ int-import-graph = [EXCEPTIONS] overgeneral-exceptions = Exception -# 2baa8e2454b99e258f3d547e787ce30ef4557e22 +# 3fd87e519513f0a4e318643283ee1917ec197854 diff --git a/pylintrc_backup b/pylintrc_backup new file mode 100644 index 0000000..da859b5 --- /dev/null +++ b/pylintrc_backup @@ -0,0 +1,457 @@ +# *************************** +# ** 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 = ,migrations, settings, wsgi.py +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, + django-not-configured, + + apply-builtin, + backtick, + basestring-builtin, + buffer-builtin, + cmp-builtin, + cmp-method, + coerce-builtin, + coerce-method, + delslice-method, + 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,,invalid-name,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|logger|User)$ +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 + +# 2baa8e2454b99e258f3d547e787ce30ef4557e22 diff --git a/pylintrc_tweaks b/pylintrc_tweaks index 507a47c..62efd5b 100644 --- a/pylintrc_tweaks +++ b/pylintrc_tweaks @@ -6,4 +6,4 @@ ignore+= ,migrations, settings, wsgi.py const-rgx = (([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns|logger|User)$ [MESSAGES CONTROL] -DISABLE+= ,invalid-name,useless-object-inheritance +DISABLE+= ,invalid-name,useless-object-inheritance,django-not-configured,consider-using-dict-items,consider-using-with diff --git a/requirements/base.txt b/requirements/base.txt index e234966..fe9f75e 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade @@ -10,7 +10,7 @@ jinja2==3.0.3 # via -r requirements/base.in markupsafe==2.0.1 # via jinja2 -pbr==5.8.0 +pbr==5.8.1 # via stevedore python-slugify==5.0.2 # via -r requirements/base.in diff --git a/requirements/ci.txt b/requirements/ci.txt index bd39d70..6072882 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -1,16 +1,16 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade # certifi==2021.10.8 # via requests -charset-normalizer==2.0.10 +charset-normalizer==2.0.11 # via requests codecov==2.1.12 # via -r requirements/ci.in -coverage==6.2 +coverage==6.3.1 # via codecov distlib==0.3.4 # via virtualenv @@ -38,13 +38,13 @@ six==1.16.0 # virtualenv toml==0.10.2 # via tox -tox-battery==0.6.1 - # via -r requirements/ci.in tox==3.24.5 # via # -r requirements/ci.in # tox-battery +tox-battery==0.6.1 + # via -r requirements/ci.in urllib3==1.26.8 # via requests -virtualenv==20.13.0 +virtualenv==20.13.1 # via tox diff --git a/requirements/dev.txt b/requirements/dev.txt index 96a0b08..cb2df3c 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade @@ -8,7 +8,7 @@ asgiref==3.5.0 # via # -r requirements/quality.txt # django -astroid==2.5.6 +astroid==2.9.3 # via # -r requirements/quality.txt # pylint @@ -23,14 +23,10 @@ certifi==2021.10.8 # requests chardet==4.0.0 # via diff-cover -charset-normalizer==2.0.10 +charset-normalizer==2.0.11 # via # -r requirements/ci.txt # requests -click-log==0.3.2 - # via - # -r requirements/quality.txt - # edx-lint click==8.0.3 # via # -r requirements/pip-tools.txt @@ -39,13 +35,17 @@ click==8.0.3 # code-annotations # edx-lint # pip-tools +click-log==0.3.2 + # via + # -r requirements/quality.txt + # edx-lint code-annotations==1.2.0 # via # -r requirements/quality.txt # edx-lint codecov==2.1.12 # via -r requirements/ci.txt -coverage[toml]==6.2 +coverage[toml]==6.3.1 # via # -r requirements/ci.txt # -r requirements/quality.txt @@ -57,7 +57,7 @@ distlib==0.3.4 # via # -r requirements/ci.txt # virtualenv -django==3.2.11 +django==3.2.12 # via # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/quality.txt @@ -105,7 +105,7 @@ packaging==21.3 # -r requirements/quality.txt # pytest # tox -pbr==5.8.0 +pbr==5.8.1 # via # -r requirements/quality.txt # stevedore @@ -113,7 +113,7 @@ pep517==0.12.0 # via # -r requirements/pip-tools.txt # pip-tools -pip-tools==6.4.0 +pip-tools==6.5.0 # via -r requirements/pip-tools.txt platformdirs==2.4.1 # via @@ -140,37 +140,37 @@ pydocstyle==6.1.1 # via -r requirements/quality.txt pygments==2.11.2 # via diff-cover -pylint-celery==0.3 +pylint==2.12.2 # via # -r requirements/quality.txt # edx-lint -pylint-django==2.4.4 + # pylint-celery + # pylint-django + # pylint-plugin-utils +pylint-celery==0.3 # via # -r requirements/quality.txt # edx-lint -pylint-plugin-utils==0.7 +pylint-django==2.5.0 # via # -r requirements/quality.txt - # pylint-celery - # pylint-django -pylint==2.8.2 + # edx-lint +pylint-plugin-utils==0.7 # via # -r requirements/quality.txt - # edx-lint # pylint-celery # pylint-django - # pylint-plugin-utils pyparsing==3.0.7 # via # -r requirements/ci.txt # -r requirements/quality.txt # packaging -pytest-cov==3.0.0 - # via -r requirements/quality.txt -pytest==6.2.5 +pytest==7.0.0 # via # -r requirements/quality.txt # pytest-cov +pytest-cov==3.0.0 + # via -r requirements/quality.txt python-slugify==5.0.2 # via # -r requirements/quality.txt @@ -215,7 +215,6 @@ toml==0.10.2 # -r requirements/ci.txt # -r requirements/quality.txt # pylint - # pytest # tox tomli==2.0.0 # via @@ -223,12 +222,13 @@ tomli==2.0.0 # -r requirements/quality.txt # coverage # pep517 -tox-battery==0.6.1 - # via -r requirements/ci.txt + # pytest tox==3.24.5 # via # -r requirements/ci.txt # tox-battery +tox-battery==0.6.1 + # via -r requirements/ci.txt typing-extensions==4.0.1 # via # -r requirements/quality.txt @@ -238,7 +238,7 @@ urllib3==1.26.8 # via # -r requirements/ci.txt # requests -virtualenv==20.13.0 +virtualenv==20.13.1 # via # -r requirements/ci.txt # tox @@ -246,7 +246,7 @@ wheel==0.37.1 # via # -r requirements/pip-tools.txt # pip-tools -wrapt==1.12.1 +wrapt==1.13.3 # via # -r requirements/quality.txt # astroid diff --git a/requirements/django.txt b/requirements/django.txt index bbf0a77..4181daa 100644 --- a/requirements/django.txt +++ b/requirements/django.txt @@ -1,12 +1,12 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade # asgiref==3.5.0 # via django -django==3.2.11 +django==3.2.12 # via # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/django.in diff --git a/requirements/doc.txt b/requirements/doc.txt index e555aaa..0541e58 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade @@ -20,15 +20,15 @@ bleach==4.1.0 # via readme-renderer certifi==2021.10.8 # via requests -charset-normalizer==2.0.10 +charset-normalizer==2.0.11 # via requests click==8.0.3 # via -r requirements/test.txt -coverage[toml]==6.2 +coverage[toml]==6.3.1 # via # -r requirements/test.txt # pytest-cov -django==3.2.11 +django==3.2.12 # via # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/test.txt @@ -68,7 +68,7 @@ packaging==21.3 # bleach # pytest # sphinx -pbr==5.8.0 +pbr==5.8.1 # via # -r requirements/test.txt # stevedore @@ -89,12 +89,12 @@ pyparsing==3.0.7 # via # -r requirements/test.txt # packaging -pytest-cov==3.0.0 - # via -r requirements/test.txt -pytest==6.2.5 +pytest==7.0.0 # via # -r requirements/test.txt # pytest-cov +pytest-cov==3.0.0 + # via -r requirements/test.txt python-slugify==5.0.2 # via -r requirements/test.txt pytz==2021.3 @@ -144,14 +144,11 @@ text-unidecode==1.3 # via # -r requirements/test.txt # python-slugify -toml==0.10.2 - # via - # -r requirements/test.txt - # pytest tomli==2.0.0 # via # -r requirements/test.txt # coverage + # pytest urllib3==1.26.8 # via requests webencodings==0.5.1 diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 8d7c0b6..ced79b1 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade @@ -8,7 +8,7 @@ click==8.0.3 # via pip-tools pep517==0.12.0 # via pip-tools -pip-tools==6.4.0 +pip-tools==6.5.0 # via -r requirements/pip-tools.in tomli==2.0.0 # via pep517 diff --git a/requirements/pip.in b/requirements/pip.in index 7b68e86..68caafe 100644 --- a/requirements/pip.in +++ b/requirements/pip.in @@ -1,4 +1,5 @@ # Core dependencies for installing other packages +-c constraints.txt pip setuptools diff --git a/requirements/pip.txt b/requirements/pip.txt index 0877e96..a1ebd56 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade @@ -8,7 +8,9 @@ wheel==0.37.1 # via -r requirements/pip.in # The following packages are considered to be unsafe in a requirements file: -pip==21.3.1 - # via -r requirements/pip.in -setuptools==60.5.0 +pip==22.0.3 # via -r requirements/pip.in +setuptools==59.8.0 + # via + # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt + # -r requirements/pip.in diff --git a/requirements/quality.txt b/requirements/quality.txt index bb9d023..d63e64e 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade @@ -8,7 +8,7 @@ asgiref==3.5.0 # via # -r requirements/test.txt # django -astroid==2.5.6 +astroid==2.9.3 # via # pylint # pylint-celery @@ -16,21 +16,21 @@ attrs==21.4.0 # via # -r requirements/test.txt # pytest -click-log==0.3.2 - # via edx-lint click==8.0.3 # via # -r requirements/test.txt # click-log # code-annotations # edx-lint +click-log==0.3.2 + # via edx-lint code-annotations==1.2.0 # via edx-lint -coverage[toml]==6.2 +coverage[toml]==6.3.1 # via # -r requirements/test.txt # pytest-cov -django==3.2.11 +django==3.2.12 # via # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/test.txt @@ -62,7 +62,7 @@ packaging==21.3 # via # -r requirements/test.txt # pytest -pbr==5.8.0 +pbr==5.8.1 # via # -r requirements/test.txt # stevedore @@ -80,30 +80,30 @@ pycodestyle==2.8.0 # via -r requirements/quality.in pydocstyle==6.1.1 # via -r requirements/quality.in +pylint==2.12.2 + # via + # edx-lint + # pylint-celery + # pylint-django + # 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.7 # via # pylint-celery # pylint-django -pylint==2.8.2 - # via - # edx-lint - # pylint-celery - # pylint-django - # pylint-plugin-utils pyparsing==3.0.7 # via # -r requirements/test.txt # packaging -pytest-cov==3.0.0 - # via -r requirements/test.txt -pytest==6.2.5 +pytest==7.0.0 # via # -r requirements/test.txt # pytest-cov +pytest-cov==3.0.0 + # via -r requirements/test.txt python-slugify==5.0.2 # via # -r requirements/test.txt @@ -133,19 +133,17 @@ text-unidecode==1.3 # -r requirements/test.txt # python-slugify toml==0.10.2 - # via - # -r requirements/test.txt - # pylint - # pytest + # via pylint tomli==2.0.0 # via # -r requirements/test.txt # coverage + # pytest typing-extensions==4.0.1 # via # astroid # pylint -wrapt==1.12.1 +wrapt==1.13.3 # via astroid # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/test.txt b/requirements/test.txt index 9e9c0c9..ff32e2d 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade @@ -12,7 +12,7 @@ attrs==21.4.0 # via pytest click==8.0.3 # via -r requirements/base.txt -coverage[toml]==6.2 +coverage[toml]==6.3.1 # via pytest-cov # via # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt @@ -29,7 +29,7 @@ mock==4.0.3 # via -r requirements/test.in packaging==21.3 # via pytest -pbr==5.8.0 +pbr==5.8.1 # via # -r requirements/base.txt # stevedore @@ -39,10 +39,10 @@ py==1.11.0 # via pytest pyparsing==3.0.7 # via packaging +pytest==7.0.0 + # via pytest-cov pytest-cov==3.0.0 # via -r requirements/test.in -pytest==6.2.5 - # via pytest-cov python-slugify==5.0.2 # via -r requirements/base.txt pytz==2021.3 @@ -61,7 +61,7 @@ text-unidecode==1.3 # via # -r requirements/base.txt # python-slugify -toml==0.10.2 - # via pytest tomli==2.0.0 - # via coverage + # via + # coverage + # pytest diff --git a/setup.py b/setup.py index 1ab26a3..e43cc47 100644 --- a/setup.py +++ b/setup.py @@ -96,10 +96,8 @@ def is_requirement(line): classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', - 'Framework :: Django :: 2.2', - 'Framework :: Django :: 3.0', - 'Framework :: Django :: 3.1', 'Framework :: Django :: 3.2', + 'Framework :: Django :: 4.0', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Natural Language :: English', diff --git a/tox.ini b/tox.ini index 09ecd6e..6026ab4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38-django{22,30,31,32} +envlist = py38-django{32,40} [doc8] ignore = D001 @@ -16,40 +16,38 @@ addopts = --cov code_annotations --cov-report term-missing --cov-report xml norecursedirs = .* docs requirements [testenv] -deps = - django22: Django>=2.2,<2.3 - django30: Django>=3.0,<3.1 - django31: Django>=3.1,<3.2 - django32: Django>=3.2,<3.3 - -r{toxinidir}/requirements/test.txt -commands = - python -Wd -m pytest {posargs} +deps = + django32: Django>=3.2,<4.0 + django40: Django>=4.0,<4.1 + -r{toxinidir}/requirements/test.txt +commands = + python -Wd -m pytest {posargs} [testenv:docs] -setenv = - PYTHONPATH = {toxinidir} -whitelist_externals = - make - rm -deps = - -r{toxinidir}/requirements/doc.txt -commands = - doc8 --ignore-path docs/_build README.rst docs - rm -f docs/code_annotations.rst - rm -f docs/modules.rst - make -C docs clean - make -C docs html - python setup.py check --restructuredtext --strict +setenv = + PYTHONPATH = {toxinidir} +whitelist_externals = + make + rm +deps = + -r{toxinidir}/requirements/doc.txt +commands = + doc8 --ignore-path docs/_build README.rst docs + rm -f docs/code_annotations.rst + rm -f docs/modules.rst + make -C docs clean + make -C docs html + python setup.py check --restructuredtext --strict [testenv:quality] -whitelist_externals = - make -deps = - -r{toxinidir}/requirements/quality.txt -commands = - pylint code_annotations tests test_utils setup.py - pycodestyle code_annotations tests setup.py - pydocstyle code_annotations tests setup.py - isort --check-only --diff tests test_utils code_annotations setup.py - make selfcheck +whitelist_externals = + make +deps = + -r{toxinidir}/requirements/quality.txt +commands = + pylint code_annotations tests test_utils setup.py + pycodestyle code_annotations tests setup.py + pydocstyle code_annotations tests setup.py + isort --check-only --diff tests test_utils code_annotations setup.py + make selfcheck