From b99f07f9c53e2efead026f0171b6ac8ea296efba Mon Sep 17 00:00:00 2001 From: Jawayria Date: Fri, 24 Jun 2022 19:54:59 +0500 Subject: [PATCH] fix: Install pip and pip-toolsin upgrade script --- Makefile | 13 +- pylintrc | 390 ++++++++---------- requirements/base.txt | 89 ++-- requirements/ci.txt | 262 ++++++++++-- requirements/common_constraints.txt | 25 ++ requirements/constraints.txt | 2 + requirements/pip.in | 6 + requirements/pip.txt | 16 + requirements/pip_tools.txt | 16 +- requirements/quality.txt | 87 +++- requirements/test.txt | 132 +++++- setup.cfg | 3 + tests/android/pages/android_elements.py | 2 +- tests/android/pages/android_login.py | 4 +- tests/android/pages/android_register.py | 10 +- .../tests/test_android_video_subsection.py | 2 +- .../tests/test_android_videos_dashboard.py | 2 +- tests/common/globals.py | 16 +- tests/ios/tests/test_ios_course_all_posts.py | 2 +- tests/ios/tests/test_ios_create_new_post.py | 4 +- .../ios/tests/test_ios_discussion_details.py | 4 +- .../tests/test_ios_discussions_dashboard.py | 10 +- tests/ios/tests/test_ios_whats_new.py | 2 +- 23 files changed, 750 insertions(+), 349 deletions(-) create mode 100644 requirements/common_constraints.txt create mode 100644 requirements/pip.in create mode 100644 requirements/pip.txt diff --git a/Makefile b/Makefile index ad84453e..840d9b83 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,16 @@ +COMMON_CONSTRAINTS_TXT=requirements/common_constraints.txt +.PHONY: $(COMMON_CONSTRAINTS_TXT) +$(COMMON_CONSTRAINTS_TXT): + wget -O "$(@)" https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt || touch "$(@)" + upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade -upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in - pip install -q -r requirements/pip_tools.txt +upgrade: $(COMMON_CONSTRAINTS_TXT) + ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in + pip install -qr requirements/pip_tools.txt + pip-compile --allow-unsafe --rebuild --upgrade -o requirements/pip.txt requirements/pip.in pip-compile --upgrade -o requirements/pip_tools.txt requirements/pip_tools.in + pip install -qr requirements/pip.txt + pip install -qr requirements/pip_tools.txt pip-compile --upgrade -o requirements/base.txt requirements/base.in pip-compile --upgrade -o requirements/quality.txt requirements/quality.in pip-compile --upgrade -o requirements/test.txt requirements/test.in diff --git a/pylintrc b/pylintrc index ca1de966..f14d40de 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 @@ -26,17 +30,25 @@ # 1. Edit the pylintrc file in the edx-lint repo at # https://github.com/edx/edx-lint/blob/master/edx_lint/files/pylintrc # -# 2. Make a new version of edx_lint, which involves the usual steps of -# incrementing the version number, submitting and reviewing a pull -# request, and updating the edx-lint version reference in this repo. +# 2. install the updated version of edx-lint (in edx-lint): +# +# $ pip install . +# +# 3. Run (in edx-lint): +# +# $ 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 and +# publish the new version. # -# 3. Install the newer version of edx-lint. +# 5. In your local repo, install the newer version of edx-lint. # -# 4. Run: +# 6. Run: # # $ edx_lint write pylintrc # -# 5. This will modify the local file. Submit a pull request to get it +# 7. This will modify the local file. Submit a pull request to get it # checked in so that others will benefit. # # @@ -52,6 +64,8 @@ # SERIOUSLY. # # ------------------------------ +# Generated by edx-lint version: 5.2.4 +# ------------------------------ [MASTER] ignore = persistent = yes @@ -59,276 +73,200 @@ load-plugins = edx_lint.pylint [MESSAGES CONTROL] enable = - # These are controlled by explicit choices in the pylintrc files blacklisted-name, line-too-long, - # These affect the correctness of the code - 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, + dangerous-default-value, + duplicate-argument-name, duplicate-bases, - non-iterator-returned, - unexpected-special-method-signature, - invalid-length-returned, + duplicate-except, + duplicate-key, + expression-not-assigned, + 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, + 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-format-index, + invalid-length-returned, invalid-sequence-index, invalid-slice-index, - assignment-from-none, - not-context-manager, + invalid-slots-object, + invalid-slots, 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, + 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, - 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, + 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, + raising-bad-type, + raising-non-exception, + redefined-builtin, + redefined-outer-name, + redundant-keyword-arg, + repeated-keyword, + return-arg-in-generator, + return-in-init, + return-outside-function, 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, + super-method-not-called, + syntax-error, + test-inherits-tests, + too-few-format-args, + too-many-format-args, + too-many-function-args, + translation-of-non-string, + truncated-format-string, + 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, - # Checking failed for some reason - fatal, + unused-format-string-key, + used-before-assignment, + using-constant-test, + yield-outside-function, + astroid-error, - parse-error, + fatal, method-check-failed, - django-not-available, + parse-error, raw-checker-failed, - django-not-available-placeholder, - # Documentation is important + empty-docstring, invalid-characters-in-docstring, missing-docstring, wrong-spelling-in-comment, wrong-spelling-in-docstring, - # Unused code should be deleted + + unused-argument, unused-import, unused-variable, - unused-argument, - # These are dangerous! - exec-used, + eval-used, - # These represent idiomatic python. Not adhering to them - # will raise red flags with future readers. + 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, multiple-imports, multiple-statements, - old-style-class, + no-classmethod-decorator, + no-staticmethod-decorator, + 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, - # Don't use things that are deprecated - deprecated-module, + unneeded-not, + useless-else-on-loop, + wrong-assert-type, + deprecated-method, - # These help manage code complexity + deprecated-module, + + too-many-boolean-expressions, too-many-nested-blocks, too-many-statements, - too-many-boolean-expressions, - # Consistent import order makes finding where code is - # imported from easier - ungrouped-imports, + + wildcard-import, wrong-import-order, wrong-import-position, - wildcard-import, - # These should be auto-fixed by any competent editor + missing-final-newline, mixed-line-endings, trailing-newlines, trailing-whitespace, unexpected-line-ending-format, - mixed-indentation, - # These attempt to limit pylint line-noise + + bad-inline-option, bad-option-value, + deprecated-pragma, unrecognized-inline-option, useless-suppression, - bad-inline-option, - deprecated-pragma, disable = - # These should be left to the discretion of the reviewer - bad-continuation, - invalid-name, - misplaced-comparison-constant, - file-ignored, bad-indentation, - lowercase-l-suffix, - unused-wildcard-import, - global-statement, - no-else-return, - # These are disabled by pylint by default - apply-builtin, - backtick, - basestring-builtin, - buffer-builtin, - cmp-builtin, - cmp-method, - coerce-builtin, - coerce-method, - delslice-method, - dict-iter-method, - dict-view-method, + consider-using-f-string, duplicate-code, - execfile-builtin, - file-builtin, - filter-builtin-not-iterating, + file-ignored, fixme, - getslice-method, - hex-method, - import-star-module-level, - indexing-exception, - input-builtin, - intern-builtin, + global-statement, + invalid-name, 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, + no-else-return, suppressed-message, too-few-public-methods, too-many-ancestors, @@ -339,21 +277,22 @@ disable = too-many-locals, too-many-public-methods, too-many-return-statements, - unichr-builtin, - unicode-builtin, - unpacking-in-except, - using-cmp-argument, - xrange-builtin, - zip-builtin-not-iterating, + ungrouped-imports, + unspecified-encoding, + unused-wildcard-import, + use-maxsplit-arg, + + feature-toggle-needs-doc, + illegal-waffle-usage, + + logging-fstring-interpolation, [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 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]+$ @@ -371,9 +310,8 @@ docstring-min-length = 5 [FORMAT] max-line-length = 120 -ignore-long-lines = ^\s*(# )??$ +ignore-long-lines = ^\s*(# )?((?)|(\.\. \w+: .*))$ single-line-if-stmt = no -no-space-check = trailing-comma,dict-separator max-module-lines = 1000 indent-string = ' ' @@ -444,4 +382,4 @@ int-import-graph = [EXCEPTIONS] overgeneral-exceptions = Exception -# 82f442405e296cd1771177d00c025f0c45f5846b +# fb15235a5cdc66e66749167b8597994d8791b6fa diff --git a/requirements/base.txt b/requirements/base.txt index 2a47a759..c5663273 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,41 +1,80 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade # -appium-python-client==1.0.1 - # via -r base.in -attrs==19.3.0 - # via pytest -more-itertools==8.3.0 +appium-python-client==2.4.0 + # via -r requirements/base.in +async-generator==1.10 + # via + # trio + # trio-websocket +attrs==21.4.0 + # via + # outcome + # pytest + # trio +certifi==2022.6.15 + # via urllib3 +cffi==1.15.0 + # via cryptography +cryptography==37.0.2 + # via + # pyopenssl + # urllib3 +h11==0.13.0 + # via wsproto +idna==3.3 + # via + # trio + # urllib3 +iniconfig==1.1.1 # via pytest -packaging==20.4 +outcome==1.2.0 + # via trio +packaging==21.3 # via pytest -pluggy==0.13.1 +pluggy==1.0.0 # via pytest -py==1.10.0 +py==1.11.0 # via pytest -pyparsing==2.4.7 +pycparser==2.21 + # via cffi +pyopenssl==22.0.0 + # via urllib3 +pyparsing==3.0.9 # via packaging -pytest-html==2.1.1 - # via -r base.in -pytest-metadata==1.9.0 - # via pytest-html -pytest==5.4.3 +pysocks==1.7.1 + # via urllib3 +pytest==7.1.2 # via - # -r base.in + # -r requirements/base.in # pytest-html # pytest-metadata -pyyaml==5.4 - # via -r base.in -selenium==3.141.0 +pytest-html==3.1.1 + # via -r requirements/base.in +pytest-metadata==2.0.1 + # via pytest-html +pyyaml==6.0 + # via -r requirements/base.in +selenium==4.3.0 # via - # -r base.in + # -r requirements/base.in # appium-python-client -six==1.15.0 - # via packaging -urllib3==1.26.5 - # via selenium -wcwidth==0.2.3 +sniffio==1.2.0 + # via trio +sortedcontainers==2.4.0 + # via trio +tomli==2.0.1 # via pytest +trio==0.21.0 + # via + # selenium + # trio-websocket +trio-websocket==0.9.2 + # via selenium +urllib3[secure,socks]==1.26.9 + # via selenium +wsproto==1.1.0 + # via trio-websocket diff --git a/requirements/ci.txt b/requirements/ci.txt index 76e43572..4c059cac 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -1,35 +1,235 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # -# pip-compile requirements/ci.in +# make upgrade # -appium-python-client==1.0.1 # via -r requirements/base.txt -astroid==2.3.3 # via -r requirements/test.txt, pylint, pylint-celery -attrs==19.3.0 # via -r requirements/base.txt, pytest -click-log==0.3.2 # via -r requirements/test.txt, edx-lint -click==7.1.2 # via -r requirements/test.txt, click-log, edx-lint -edx-lint==1.4.1 # via -r requirements/test.txt -isort==4.3.21 # via -r requirements/test.txt, pylint -lazy-object-proxy==1.4.3 # via -r requirements/test.txt, astroid -mccabe==0.6.1 # via -r requirements/test.txt, pylint -more-itertools==8.3.0 # via -r requirements/base.txt, pytest -packaging==20.4 # via -r requirements/base.txt, pytest -pluggy==0.13.1 # via -r requirements/base.txt, pytest -py==1.10.0 # via -r requirements/base.txt, pytest -pycodestyle==2.6.0 # via -r requirements/test.txt -pylint-celery==0.3 # via -r requirements/test.txt, edx-lint -pylint-django==2.0.11 # via -r requirements/test.txt, edx-lint -pylint-plugin-utils==0.6 # via -r requirements/test.txt, pylint-celery, pylint-django -pylint==2.4.2 # via -r requirements/test.txt, edx-lint, pylint-celery, pylint-django, pylint-plugin-utils -pyparsing==2.4.7 # via -r requirements/base.txt, packaging -pytest-html==2.1.1 # via -r requirements/base.txt -pytest-metadata==1.9.0 # via -r requirements/base.txt, pytest-html -pytest==5.4.3 # via -r requirements/base.txt, pytest-html, pytest-metadata -pyyaml==5.4 # via -r requirements/base.txt -selenium==3.141.0 # via -r requirements/base.txt, appium-python-client -six==1.15.0 # via -r requirements/base.txt, -r requirements/test.txt, astroid, edx-lint, packaging -typed-ast==1.4.1 # via -r requirements/test.txt -urllib3==1.26.5 # via -r requirements/base.txt, selenium -wcwidth==0.2.3 # via -r requirements/base.txt, pytest -wrapt==1.11.2 # via -r requirements/test.txt, astroid +appium-python-client==2.4.0 + # via -r requirements/base.txt +astroid==2.11.6 + # via + # -r requirements/test.txt + # pylint + # pylint-celery +async-generator==1.10 + # via + # -r requirements/base.txt + # trio + # trio-websocket +attrs==21.4.0 + # via + # -r requirements/base.txt + # outcome + # pytest + # trio +certifi==2022.6.15 + # via + # -r requirements/base.txt + # urllib3 +cffi==1.15.0 + # via + # -r requirements/base.txt + # cryptography +click==8.1.3 + # via + # -r requirements/test.txt + # click-log + # code-annotations + # edx-lint +click-log==0.4.0 + # via + # -r requirements/test.txt + # edx-lint +code-annotations==1.3.0 + # via + # -r requirements/test.txt + # edx-lint +cryptography==37.0.2 + # via + # -r requirements/base.txt + # pyopenssl + # urllib3 +dill==0.3.5.1 + # via + # -r requirements/test.txt + # pylint +edx-lint==5.2.4 + # via -r requirements/test.txt +h11==0.13.0 + # via + # -r requirements/base.txt + # wsproto +idna==3.3 + # via + # -r requirements/base.txt + # trio + # urllib3 +iniconfig==1.1.1 + # via + # -r requirements/base.txt + # pytest +isort==5.10.1 + # via + # -r requirements/test.txt + # pylint +jinja2==3.1.2 + # via + # -r requirements/test.txt + # code-annotations +lazy-object-proxy==1.7.1 + # via + # -r requirements/test.txt + # astroid +markupsafe==2.1.1 + # via + # -r requirements/test.txt + # jinja2 +mccabe==0.7.0 + # via + # -r requirements/test.txt + # pylint +outcome==1.2.0 + # via + # -r requirements/base.txt + # trio +packaging==21.3 + # via + # -r requirements/base.txt + # pytest +pbr==5.9.0 + # via + # -r requirements/test.txt + # stevedore +platformdirs==2.5.2 + # via + # -r requirements/test.txt + # pylint +pluggy==1.0.0 + # via + # -r requirements/base.txt + # pytest +py==1.11.0 + # via + # -r requirements/base.txt + # pytest +pycodestyle==2.8.0 + # via -r requirements/test.txt +pycparser==2.21 + # via + # -r requirements/base.txt + # cffi +pylint==2.14.3 + # via + # -r requirements/test.txt + # edx-lint + # pylint-celery + # pylint-django + # pylint-plugin-utils +pylint-celery==0.3 + # via + # -r requirements/test.txt + # edx-lint +pylint-django==2.5.3 + # via + # -r requirements/test.txt + # edx-lint +pylint-plugin-utils==0.7 + # via + # -r requirements/test.txt + # pylint-celery + # pylint-django +pyopenssl==22.0.0 + # via + # -r requirements/base.txt + # urllib3 +pyparsing==3.0.9 + # via + # -r requirements/base.txt + # packaging +pysocks==1.7.1 + # via + # -r requirements/base.txt + # urllib3 +pytest==7.1.2 + # via + # -r requirements/base.txt + # pytest-html + # pytest-metadata +pytest-html==3.1.1 + # via -r requirements/base.txt +pytest-metadata==2.0.1 + # via + # -r requirements/base.txt + # pytest-html +python-slugify==6.1.2 + # via + # -r requirements/test.txt + # code-annotations +pyyaml==6.0 + # via + # -r requirements/base.txt + # -r requirements/test.txt + # code-annotations +selenium==4.3.0 + # via + # -r requirements/base.txt + # appium-python-client +six==1.16.0 + # via + # -r requirements/test.txt + # edx-lint +sniffio==1.2.0 + # via + # -r requirements/base.txt + # trio +sortedcontainers==2.4.0 + # via + # -r requirements/base.txt + # trio +stevedore==3.5.0 + # via + # -r requirements/test.txt + # code-annotations +text-unidecode==1.3 + # via + # -r requirements/test.txt + # python-slugify +tomli==2.0.1 + # via + # -r requirements/base.txt + # -r requirements/test.txt + # pylint + # pytest +tomlkit==0.11.0 + # via + # -r requirements/test.txt + # pylint +trio==0.21.0 + # via + # -r requirements/base.txt + # selenium + # trio-websocket +trio-websocket==0.9.2 + # via + # -r requirements/base.txt + # selenium +typing-extensions==4.2.0 + # via + # -r requirements/test.txt + # astroid + # pylint +urllib3[secure,socks]==1.26.9 + # via + # -r requirements/base.txt + # selenium +wrapt==1.14.1 + # via + # -r requirements/test.txt + # astroid +wsproto==1.1.0 + # via + # -r requirements/base.txt + # trio-websocket + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt new file mode 100644 index 00000000..cca3ccd3 --- /dev/null +++ b/requirements/common_constraints.txt @@ -0,0 +1,25 @@ +# A central location for most common version constraints +# (across edx repos) for pip-installation. +# +# Similar to other constraint files this file doesn't install any packages. +# It specifies version constraints that will be applied if a package is needed. +# When pinning something here, please provide an explanation of why it is a good +# idea to pin this package across all edx repos, Ideally, link to other information +# that will help people in the future to remove the pin when possible. +# Writing an issue against the offending project and linking to it here is good. +# +# Note: Changes to this file will automatically be used by other repos, referencing +# this file from Github directly. It does not require packaging in edx-lint. + + +# using LTS django version +Django<4.0 + +# elasticsearch>=7.14.0 includes breaking changes in it which caused issues in discovery upgrade process. +# elastic search changelog: https://www.elastic.co/guide/en/enterprise-search/master/release-notes-7.14.0.html +elasticsearch<7.14.0 + +setuptools<60 + +# django-simple-history>3.0.0 adds indexing and causes a lot of migrations to be affected +django-simple-history==3.0.0 diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 8a2cc2b0..7972ea10 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -8,6 +8,8 @@ # pin when possible. Writing an issue against the offending project and # linking to it here is good. +-c common_constraints.txt + # TODO: Many pinned dependencies should be unpinned and/or moved to this constraints file. # Use latest Django LTS version diff --git a/requirements/pip.in b/requirements/pip.in new file mode 100644 index 00000000..b419ce6d --- /dev/null +++ b/requirements/pip.in @@ -0,0 +1,6 @@ +-c constraints.txt +# Core dependencies for installing other packages + +pip +setuptools +wheel diff --git a/requirements/pip.txt b/requirements/pip.txt new file mode 100644 index 00000000..8a667c4a --- /dev/null +++ b/requirements/pip.txt @@ -0,0 +1,16 @@ +# +# This file is autogenerated by pip-compile with python 3.8 +# To update, run: +# +# make upgrade +# +wheel==0.37.1 + # via -r requirements/pip.in + +# The following packages are considered to be unsafe in a requirements file: +pip==22.1.2 + # via -r requirements/pip.in +setuptools==59.8.0 + # via + # -c requirements/common_constraints.txt + # -r requirements/pip.in diff --git a/requirements/pip_tools.txt b/requirements/pip_tools.txt index 269588e4..4a6f82d5 100644 --- a/requirements/pip_tools.txt +++ b/requirements/pip_tools.txt @@ -1,12 +1,20 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade # -click==7.1.2 # via pip-tools -pip-tools==5.2.0 # via -r requirements/pip_tools.in -six==1.15.0 # via pip-tools +click==8.1.3 + # via pip-tools +pep517==0.12.0 + # via pip-tools +pip-tools==6.6.2 + # via -r requirements/pip_tools.in +tomli==2.0.1 + # via pep517 +wheel==0.37.1 + # via pip-tools # The following packages are considered to be unsafe in a requirements file: # pip +# setuptools diff --git a/requirements/quality.txt b/requirements/quality.txt index 993e9c2f..6e3ea623 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -1,21 +1,76 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade # -astroid==2.3.3 # via pylint, pylint-celery -click-log==0.3.2 # via edx-lint -click==7.1.2 # via click-log, edx-lint -edx-lint==1.4.1 # via -r requirements/quality.in -isort==4.3.21 # via pylint -lazy-object-proxy==1.4.3 # via astroid -mccabe==0.6.1 # via pylint -pycodestyle==2.6.0 # via -r requirements/quality.in -pylint-celery==0.3 # via edx-lint -pylint-django==2.0.11 # via edx-lint -pylint-plugin-utils==0.6 # via pylint-celery, pylint-django -pylint==2.4.2 # via edx-lint, pylint-celery, pylint-django, pylint-plugin-utils -six==1.15.0 # via astroid, edx-lint -typed-ast==1.4.1 # via astroid -wrapt==1.11.2 # via astroid +astroid==2.11.6 + # via + # pylint + # pylint-celery +click==8.1.3 + # via + # click-log + # code-annotations + # edx-lint +click-log==0.4.0 + # via edx-lint +code-annotations==1.3.0 + # via edx-lint +dill==0.3.5.1 + # via pylint +edx-lint==5.2.4 + # via -r requirements/quality.in +isort==5.10.1 + # via pylint +jinja2==3.1.2 + # via code-annotations +lazy-object-proxy==1.7.1 + # via astroid +markupsafe==2.1.1 + # via jinja2 +mccabe==0.7.0 + # via pylint +pbr==5.9.0 + # via stevedore +platformdirs==2.5.2 + # via pylint +pycodestyle==2.8.0 + # via -r requirements/quality.in +pylint==2.14.3 + # via + # edx-lint + # pylint-celery + # pylint-django + # pylint-plugin-utils +pylint-celery==0.3 + # via edx-lint +pylint-django==2.5.3 + # via edx-lint +pylint-plugin-utils==0.7 + # via + # pylint-celery + # pylint-django +python-slugify==6.1.2 + # via code-annotations +pyyaml==6.0 + # via code-annotations +six==1.16.0 + # via edx-lint +stevedore==3.5.0 + # via code-annotations +text-unidecode==1.3 + # via python-slugify +tomli==2.0.1 + # via pylint +tomlkit==0.11.0 + # via pylint +typing-extensions==4.2.0 + # via + # astroid + # pylint +wrapt==1.14.1 + # via astroid + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/requirements/test.txt b/requirements/test.txt index 83c75a6b..0c350e78 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,21 +1,121 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade # -astroid==2.3.3 # via -r requirements/quality.txt, pylint, pylint-celery -click-log==0.3.2 # via -r requirements/quality.txt, edx-lint -click==7.1.2 # via -r requirements/quality.txt, click-log, edx-lint -edx-lint==1.4.1 # via -r requirements/quality.txt -isort==4.3.21 # via -r requirements/quality.txt, pylint -lazy-object-proxy==1.4.3 # via -r requirements/quality.txt, astroid -mccabe==0.6.1 # via -r requirements/quality.txt, pylint -pycodestyle==2.6.0 # via -r requirements/quality.txt -pylint-celery==0.3 # via -r requirements/quality.txt, edx-lint -pylint-django==2.0.11 # via -r requirements/quality.txt, edx-lint -pylint-plugin-utils==0.6 # via -r requirements/quality.txt, pylint-celery, pylint-django -pylint==2.4.2 # via -r requirements/quality.txt, edx-lint, pylint-celery, pylint-django, pylint-plugin-utils -six==1.15.0 # via -r requirements/quality.txt, astroid, edx-lint -typed-ast==1.4.1 # via -r requirements/quality.txt, astroid -wrapt==1.11.2 # via -r requirements/quality.txt, astroid +astroid==2.11.6 + # via + # -r requirements/quality.txt + # pylint + # pylint-celery +click==8.1.3 + # via + # -r requirements/quality.txt + # click-log + # code-annotations + # edx-lint +click-log==0.4.0 + # via + # -r requirements/quality.txt + # edx-lint +code-annotations==1.3.0 + # via + # -r requirements/quality.txt + # edx-lint +dill==0.3.5.1 + # via + # -r requirements/quality.txt + # pylint +edx-lint==5.2.4 + # via -r requirements/quality.txt +isort==5.10.1 + # via + # -r requirements/quality.txt + # pylint +jinja2==3.1.2 + # via + # -r requirements/quality.txt + # code-annotations +lazy-object-proxy==1.7.1 + # via + # -r requirements/quality.txt + # astroid +markupsafe==2.1.1 + # via + # -r requirements/quality.txt + # jinja2 +mccabe==0.7.0 + # via + # -r requirements/quality.txt + # pylint +pbr==5.9.0 + # via + # -r requirements/quality.txt + # stevedore +platformdirs==2.5.2 + # via + # -r requirements/quality.txt + # pylint +pycodestyle==2.8.0 + # via -r requirements/quality.txt +pylint==2.14.3 + # via + # -r requirements/quality.txt + # edx-lint + # pylint-celery + # pylint-django + # pylint-plugin-utils +pylint-celery==0.3 + # via + # -r requirements/quality.txt + # edx-lint +pylint-django==2.5.3 + # via + # -r requirements/quality.txt + # edx-lint +pylint-plugin-utils==0.7 + # via + # -r requirements/quality.txt + # pylint-celery + # pylint-django +python-slugify==6.1.2 + # via + # -r requirements/quality.txt + # code-annotations +pyyaml==6.0 + # via + # -r requirements/quality.txt + # code-annotations +six==1.16.0 + # via + # -r requirements/quality.txt + # edx-lint +stevedore==3.5.0 + # via + # -r requirements/quality.txt + # code-annotations +text-unidecode==1.3 + # via + # -r requirements/quality.txt + # python-slugify +tomli==2.0.1 + # via + # -r requirements/quality.txt + # pylint +tomlkit==0.11.0 + # via + # -r requirements/quality.txt + # pylint +typing-extensions==4.2.0 + # via + # -r requirements/quality.txt + # astroid + # pylint +wrapt==1.14.1 + # via + # -r requirements/quality.txt + # astroid + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/setup.cfg b/setup.cfg index 559dee26..26776246 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,5 @@ [pep8] max_line_length=119 + +[pycodestyle] +ignore = R1710, E501, W503 diff --git a/tests/android/pages/android_elements.py b/tests/android/pages/android_elements.py index 96ef0e02..aef12445 100644 --- a/tests/android/pages/android_elements.py +++ b/tests/android/pages/android_elements.py @@ -98,7 +98,7 @@ register_error_alert_button = 'android:id/button1' register_validate_editfield_error_textview = 'org.edx.mobile:id/input_error' register_validate_auto_complete_error_textview = 'org.edx.mobile:id/' \ - 'input_auto_complete_error' + 'input_auto_complete_error' # MY COURSES LIST my_courses_list = 'org.edx.mobile:id/my_course_list' diff --git a/tests/android/pages/android_login.py b/tests/android/pages/android_login.py index c62d7398..e849dcd5 100644 --- a/tests/android/pages/android_login.py +++ b/tests/android/pages/android_login.py @@ -333,8 +333,8 @@ def back_and_forth_login(self): if self.driver.current_activity == Globals.LOGIN_ACTIVITY_NAME: self.get_back_icon().click() - if (self.driver.current_activity == Globals.DISCOVERY_LAUNCH_ACTIVITY_NAME and - android_new_landing_page.load_login_screen() == Globals.LOGIN_ACTIVITY_NAME): + if (self.driver.current_activity == Globals.DISCOVERY_LAUNCH_ACTIVITY_NAME + and android_new_landing_page.load_login_screen() == Globals.LOGIN_ACTIVITY_NAME): self.global_contents.flag = True else: self.log.error('New Landing screen is not loaded') diff --git a/tests/android/pages/android_register.py b/tests/android/pages/android_register.py index 3ccd2af0..94cfc4eb 100644 --- a/tests/android/pages/android_register.py +++ b/tests/android/pages/android_register.py @@ -429,8 +429,8 @@ def back_and_forth_register(self): if self.driver.current_activity == Globals.REGISTER_ACTIVITY_NAME: self.driver.back() - if (self.driver.current_activity == Globals.DISCOVERY_LAUNCH_ACTIVITY_NAME and - android_new_landing_page.load_register_screen() == Globals.REGISTER_ACTIVITY_NAME): + if (self.driver.current_activity == Globals.DISCOVERY_LAUNCH_ACTIVITY_NAME + and android_new_landing_page.load_register_screen() == Globals.REGISTER_ACTIVITY_NAME): self.log.info('Register screen is successfully loaded') self.global_contents.flag = True else: @@ -499,7 +499,7 @@ def select_country(self, value): x = 0 self.global_contents.flag = True - for scroll in range(int(total_expected_countries/countries_per_page)): + for scroll in range(int(total_expected_countries / countries_per_page)): countries_list_values = self.get_all_textviews_in_listview() self.log.info('countries list - {}'.format((countries_list_values))) @@ -626,7 +626,7 @@ def get_email_validation_textview(self): return self.global_contents.get_all_views_on_screen_by_id( self.driver, android_elements.register_validate_editfield_error_textview - )[self.global_contents.third_existence] + )[self.global_contents.third_existence] def get_full_name_validation_textview(self): """ @@ -702,4 +702,4 @@ def get_email_format_validation_textview(self): return self.global_contents.get_all_views_on_screen_by_id( self.driver, android_elements.register_validate_editfield_error_textview - )[self.global_contents.first_existence] + )[self.global_contents.first_existence] diff --git a/tests/android/tests/test_android_video_subsection.py b/tests/android/tests/test_android_video_subsection.py index d902a2fd..619e8cfb 100644 --- a/tests/android/tests/test_android_video_subsection.py +++ b/tests/android/tests/test_android_video_subsection.py @@ -168,7 +168,7 @@ def test_download_to_device_smoke(self, set_capabilities, setup_logging): assert global_contents.get_by_class_from_elements( set_capabilities, android_elements.video_download_permission_buttons, global_contents.first_existence).text \ - == strings.VIDEO_DOWNLOAD_PERMISSION_ALLOW_BUTTON + == strings.VIDEO_DOWNLOAD_PERMISSION_ALLOW_BUTTON assert global_contents.get_by_class_from_elements( set_capabilities, android_elements.video_download_permission_message, diff --git a/tests/android/tests/test_android_videos_dashboard.py b/tests/android/tests/test_android_videos_dashboard.py index 1d0b34b7..9da8857c 100644 --- a/tests/android/tests/test_android_videos_dashboard.py +++ b/tests/android/tests/test_android_videos_dashboard.py @@ -165,7 +165,7 @@ def test_download_to_device_smoke(self, set_capabilities, setup_logging): assert global_contents.get_by_class_from_elements( set_capabilities, android_elements.video_download_permission_buttons, global_contents.first_existence).text \ - == strings.VIDEO_DOWNLOAD_PERMISSION_ALLOW_BUTTON + == strings.VIDEO_DOWNLOAD_PERMISSION_ALLOW_BUTTON assert global_contents.get_by_class_from_elements( set_capabilities, android_elements.video_download_permission_message, diff --git a/tests/common/globals.py b/tests/common/globals.py index 11967f9f..ce37a191 100644 --- a/tests/common/globals.py +++ b/tests/common/globals.py @@ -117,7 +117,7 @@ def setup_global_environment(self): self.login_user_name = os.environ['USER_NAME'] self.login_password = os.environ['USER_PASSWORD'] - def wait_and_get_element(self, driver, element_locator, optional_time=None): + def wait_and_get_element(self, driver, element_locator, optional_time=None): # pylint: disable=inconsistent-return-statements """ Block until the element present on screen, then returns the element @@ -164,7 +164,7 @@ def wait_and_get_element(self, driver, element_locator, optional_time=None): web_driver_exception, sys.exc_info()[0])) - def get_all_views_on_screen(self, driver, target_elements): + def get_all_views_on_screen(self, driver, target_elements): # pylint: disable=inconsistent-return-statements """ Get list of Views on screen @@ -215,7 +215,7 @@ def get_all_views_on_screen(self, driver, target_elements): sys.exc_info()[0] )) - def get_all_views_on_ios_screen(self, driver, target_elements): + def get_all_views_on_ios_screen(self, driver, target_elements): # pylint: disable=inconsistent-return-statements """ Get list of all visible Views on ios screen @@ -261,7 +261,7 @@ def get_all_views_on_ios_screen(self, driver, target_elements): sys.exc_info()[0] )) - def get_all_views_on_screen_by_id(self, driver, target_elements): + def get_all_views_on_screen_by_id(self, driver, target_elements): # pylint: disable=inconsistent-return-statements """ Get list of Views on screen @@ -302,7 +302,7 @@ def get_all_views_on_screen_by_id(self, driver, target_elements): sys.exc_info()[0] )) - def get_elements_from_list(self, driver, target_list, target_elements): + def get_elements_from_list(self, driver, target_list, target_elements): # pylint: disable=inconsistent-return-statements """ Get elements from given list @@ -348,7 +348,7 @@ def get_elements_from_list(self, driver, target_list, target_elements): sys.exc_info()[0] )) - def wait_for_element_visibility(self, driver, target_elements): + def wait_for_element_visibility(self, driver, target_elements): # pylint: disable=inconsistent-return-statements """ Block until the element visibility on screen, then returns True @@ -395,7 +395,7 @@ def wait_for_element_visibility(self, driver, target_elements): return False - def wait_for_element_invisibility(self, driver, target_elements): + def wait_for_element_invisibility(self, driver, target_elements): # pylint: disable=inconsistent-return-statements """ Block until the element invisibility on screen, then returns True @@ -695,7 +695,7 @@ def get_by_id_from_elements(self, driver, element_to_wait_for, screen_index): screen_index_element = self.get_all_elements_by_id( driver, element_to_wait_for - )[screen_index] + )[screen_index] return screen_index_element diff --git a/tests/ios/tests/test_ios_course_all_posts.py b/tests/ios/tests/test_ios_course_all_posts.py index 67c32242..5c33de20 100644 --- a/tests/ios/tests/test_ios_course_all_posts.py +++ b/tests/ios/tests/test_ios_course_all_posts.py @@ -72,7 +72,7 @@ def test_ui_elements_smoke(self, set_capabilities, setup_logging): set_capabilities, ios_elements.discussions_topic_title_cell, global_contents.first_existence - ) + ) all_posts_element.click() assert ios_discussions_page.get_subsection_title().text == strings.DISCUSSION_ALL_POSTS diff --git a/tests/ios/tests/test_ios_create_new_post.py b/tests/ios/tests/test_ios_create_new_post.py index 435b564b..2f3e9603 100644 --- a/tests/ios/tests/test_ios_create_new_post.py +++ b/tests/ios/tests/test_ios_create_new_post.py @@ -57,7 +57,7 @@ def test_navigate_to_all_posts_smoke(self, set_capabilities, setup_logging): set_capabilities, ios_elements.discussions_topic_title_cell, global_contents.first_existence - ) + ) assert all_posts_element.text == strings.DISCUSSION_ALL_POSTS all_posts_element.click() assert ios_discussions_page.get_subsection_title().text == strings.DISCUSSION_ALL_POSTS @@ -80,7 +80,7 @@ def test_ui_elements_smoke(self, set_capabilities, setup_logging): create_new_post_button = global_contents.get_element_by_id( set_capabilities, ios_elements.create_new_post_button - ) + ) assert create_new_post_button.text == strings.CREATE_NEW_POST_BUTTON_IOS create_new_post_button.click() create_post_title = ios_discussions_page.get_all_text_views()[1] diff --git a/tests/ios/tests/test_ios_discussion_details.py b/tests/ios/tests/test_ios_discussion_details.py index 58f010f7..9dd81449 100644 --- a/tests/ios/tests/test_ios_discussion_details.py +++ b/tests/ios/tests/test_ios_discussion_details.py @@ -66,7 +66,7 @@ def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging): set_capabilities, ios_elements.discussions_topic_title_cell, global_contents.first_existence - ) + ) assert all_posts_element.text == strings.DISCUSSION_ALL_POSTS all_posts_element.click() @@ -85,7 +85,7 @@ def test_create_new_post_smoke(self, set_capabilities, setup_logging): create_new_post_button = global_contents.get_element_by_id( set_capabilities, ios_elements.create_new_post_button - ) + ) assert create_new_post_button.text == strings.CREATE_NEW_POST_BUTTON_IOS create_new_post_button.click() create_post_title = ios_discussions_page.get_all_text_views()[1] diff --git a/tests/ios/tests/test_ios_discussions_dashboard.py b/tests/ios/tests/test_ios_discussions_dashboard.py index a3c4941c..a3315377 100644 --- a/tests/ios/tests/test_ios_discussions_dashboard.py +++ b/tests/ios/tests/test_ios_discussions_dashboard.py @@ -66,21 +66,21 @@ def test_validate_ui_elements_smoke(self, set_capabilities, setup_logging): set_capabilities, ios_elements.discussions_topic_title_cell, global_contents.first_existence - ) + ) assert all_posts_element.text == strings.DISCUSSION_ALL_POSTS following_posts_element = global_contents.get_by_class_from_elements( set_capabilities, ios_elements.discussions_topic_title_cell, global_contents.second_existence - ) + ) assert following_posts_element.text == " Posts I'm Following" course_feedback_element = global_contents.get_by_class_from_elements( set_capabilities, ios_elements.discussions_topic_title_cell, global_contents.third_existence - ) + ) assert course_feedback_element.text == strings.DISCUSSION_COURSE_QnA def test_load_contents_smoke(self, set_capabilities, setup_logging): @@ -104,7 +104,7 @@ def test_load_contents_smoke(self, set_capabilities, setup_logging): set_capabilities, ios_elements.discussions_topic_title_cell, global_contents.first_existence - ) + ) all_posts_element.click() assert ios_discussions_page.get_subsection_title().text == strings.DISCUSSION_ALL_POSTS ios_discussions_page.get_navigation_icon().click() @@ -114,7 +114,7 @@ def test_load_contents_smoke(self, set_capabilities, setup_logging): set_capabilities, ios_elements.discussions_topic_title_cell, global_contents.second_existence - ) + ) following_posts_element.click() assert ios_discussions_page.get_subsection_title().text == strings.DISCUSSION_MY_FOLLOWING_POSTS_IOS ios_discussions_page.get_navigation_icon().click() diff --git a/tests/ios/tests/test_ios_whats_new.py b/tests/ios/tests/test_ios_whats_new.py index 5318804a..a00d04c5 100644 --- a/tests/ios/tests/test_ios_whats_new.py +++ b/tests/ios/tests/test_ios_whats_new.py @@ -101,7 +101,7 @@ def test_re_login_smoke(self, setup_logging, set_capabilities): ios_login_page.login( global_contents.login_user_name, global_contents.login_password - ) + ) setup_logging.info('{} is successfully logged in'.format(global_contents.target_environment))