When it was located at the root of the project, it was sometimes not
getting loaded correctly since the root of the project is not a python
module, and producing the following error:
```
Command line or configuration file:1:0: E0013: Plugin 'pylint_django_settings' is impossible to load, is it installed ? ('No module named 'pylint_django_settings'') (bad-plugin-value)
```
This led all the pylint tests to fail.
This started happening more as we updated other dependencies via make
upgrade for some reason and led to inconsistent builds. The move should
hopefully make the loading reliable and consistent.
version 5.3.0
Commands:
write FILENAME
Write a local copy of FILENAME using FILENAME_tweaks for local tweaks.
check [FILENAME ...]
Check that FILENAME has not been edited since writing.
If FILENAME is omitted, all existing files are checked.
list
List the files that edx_lint can provide.
update
Re-write any edx_lint-written files that exists on disk.
update with the current version of the repo.
Updated constraints of following packages:
inflect,geoip2,maxmindb,path,isort (isort>5.0.0 introduced wrong-import-order warnings so disabled the warning)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
The old folder name is somewhat confusing, because the
folder contains shims to _compensate for the removal
of sys.path hacks_, but does not contain the sys.path
hacks themselves.
Furthermore, this import_shims/ system could also be
used for other import path changes, such as turning
the locally-installed packages in common/lib/
into regular, importable modules
(e.g. `from common.lib.xmodule import abc` instead of
`from xmodule import abc`). So, a name that is not
specific to the sys.path hacks may be better
in the medium-to-long term.
Along the same lines, we also rename SysPathHackWarning
to DeprecatedEdxPlatformImportWarning.
The last time we tried this upgrade we encountered timeouts on the quality job, which it now appears were due to the worker running pylint common running out of memory and killing the Jenkins process. Switching to a different worker type with double the RAM (8 GB vs. 4 GB) seems to have fixed this; about 5.5 GB was used. Upstream is aware of the high memory usage on large projects, it's apparently due primarily to a cache of parsed modules: https://github.com/PyCQA/pylint/issues/1495 .
Even after disabling some of the new checks that have been added, the new version of pylint found about twice as much to complain about. Just bumping the threshold for now to unblock the Django upgrade, we can try automated utilities like pyupgrade to fix some of these later.