Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codacy issue Django was not configured keeps popping up in pull requests #1703

Closed
schlunma opened this issue Aug 18, 2022 · 9 comments
Closed
Labels
bear at a dinner party Something very unexpected

Comments

@schlunma
Copy link
Contributor

schlunma commented Aug 18, 2022

Recently, we saw the Codacy issue

Django was not configured. For more information run pylint --load-plugins=pylint_django --help-msg=django-not-configured 

popping up in some PRs (e.g., here).

@ESMValGroup/esmvaltool-coreteam do we use Django anywhere in the code? I couldn't find a reference to it. Running the suggested command above gives

$ pylint --load-plugins=pylint_django --help-msg=django-not-configured
:django-not-configured (E5110): *Django was not configured. For more information run pylint --load-plugins=pylint_django --help-msg=django-not-configured*
  Finding foreign-key relationships from strings in pylint-django requires
  configuring Django. This can be done via the DJANGO_SETTINGS_MODULE
  environment variable or the pylint option django-settings-module, eg: `pylint
  --load-plugins=pylint_django --django-settings-module=myproject.settings` .
  This can also be set as an option in a .pylintrc configuration file. Some
  basic default settings were used, however this will lead to less accurate
  linting. Consider passing in an explicit Django configuration file to match
  your project to improve accuracy. This message belongs to the django foreign
  keys referenced by strings checker.

So I guess we are using the pylint-django plugin? Could we disable this?

@schlunma schlunma added the bear at a dinner party Something very unexpected label Aug 18, 2022
@bouweandela
Copy link
Member

We are not using Django as far as I'm aware, but maybe the Codacy installation of pylint is?

@valeriupredoi
Copy link
Contributor

django=4.1 is inside the Core environment via pylint-django=2.0.11 - I scanned the issues at PyCQA/pylint here https://github.com/PyCQA/pylint/issues but couldn't see anything obvious, and given that I had a rather nasty back and forth with one of the PyCQA/flake8 devs last time around (an absolute gammon), I'd rather not go and open another issue where that individual might snoop around 😁

@zklaus
Copy link

zklaus commented Sep 8, 2022

Curious indeed. The Codacy configuration says it uses our config file, which does not contain the Django plugin, so I think it should not be run. Does this happen for all PRs? Can we keep an eye on it to see if it was a fluke?

@zklaus
Copy link

zklaus commented Sep 8, 2022

One last comment: python-django seems to be pulled in by prospector. Of course, just because it's installed shouldn't mean that it gets run, but I am not quite sure why it should be installed in the first place, particularly if it pulls in a heavy package like Django itself.

@valeriupredoi
Copy link
Contributor

and in ESMValTool django tags along from the get-going from esmvalcore

@schlunma
Copy link
Contributor Author

schlunma commented Sep 8, 2022

Curious indeed. The Codacy configuration says it uses our config file, which does not contain the Django plugin, so I think it should not be run. Does this happen for all PRs? Can we keep an eye on it to see if it was a fluke?

I saw it in multiple PRs

@bouweandela
Copy link
Member

Maybe this could be a solution? https://prospector.landscape.io/en/master/profiles.html#libraries-used-and-autodetect

I'll make a pull request.

@schlunma
Copy link
Contributor Author

schlunma commented Sep 9, 2022

@schlunma
Copy link
Contributor Author

I haven't see this is an a long time, closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bear at a dinner party Something very unexpected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants