Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

List Django as a dependency. Fix #96#132

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
atodorov merged 1 commit intomasterfrommake_django_requirement
Mar 7, 2018

Conversation

atodorov
Copy link
Contributor

also add a big warning statement about possible side effects and to deter people from reporting issues about Django version mismatches. Updates README formatting a bit as well.

@jakirkham this shouldfix#96.

@carlio I've read your reasoning about not listing this as a dependency and the side effects it may have. Let's see if the warning text I've added has any effect. If we start seeing consistent reports about Django version mismatches I'm all for dropping the Django dependency fromsetup.py and adjusting the warning so that folks are aware they have to install Django explicitly.

jakirkham reacted with thumbs up emoji
also add a big warning statement about possible side effects andto deter people from reporting issues about Django versionmismatches. Updates README formatting a bit as well.
@atodorovatodorov requested a review fromcarlioMarch 5, 2018 21:38
@coveralls
Copy link

Pull Request Test Coverage Report forBuild 293

  • 0 of0(NaN%) changed or added relevant lines in0 files are covered.
  • 1 unchanged line in1 file lost coverage.
  • Overall coverage remained the same at84.826%

Files with Coverage ReductionNew Missed Lines%
pylint_django/transforms/fields.py198.11%
TotalsCoverage Status
Change from baseBuild 291:0.0%
Covered Lines:464
Relevant Lines:547

💛 -Coveralls

3 similar comments
@coveralls
Copy link

Pull Request Test Coverage Report forBuild 293

  • 0 of0(NaN%) changed or added relevant lines in0 files are covered.
  • 1 unchanged line in1 file lost coverage.
  • Overall coverage remained the same at84.826%

Files with Coverage ReductionNew Missed Lines%
pylint_django/transforms/fields.py198.11%
TotalsCoverage Status
Change from baseBuild 291:0.0%
Covered Lines:464
Relevant Lines:547

💛 -Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report forBuild 293

  • 0 of0(NaN%) changed or added relevant lines in0 files are covered.
  • 1 unchanged line in1 file lost coverage.
  • Overall coverage remained the same at84.826%

Files with Coverage ReductionNew Missed Lines%
pylint_django/transforms/fields.py198.11%
TotalsCoverage Status
Change from baseBuild 291:0.0%
Covered Lines:464
Relevant Lines:547

💛 -Coveralls

@coveralls
Copy link

coveralls commentedMar 5, 2018
edited
Loading

Pull Request Test Coverage Report forBuild 293

  • 0 of0(NaN%) changed or added relevant lines in0 files are covered.
  • 1 unchanged line in1 file lost coverage.
  • Overall coverage remained the same at84.826%

Files with Coverage ReductionNew Missed Lines%
pylint_django/transforms/fields.py198.11%
TotalsCoverage Status
Change from baseBuild 291:0.0%
Covered Lines:464
Relevant Lines:547

💛 -Coveralls

@atodorovatodorov merged commit9b520e9 intomasterMar 7, 2018
@atodorovatodorov deleted the make_django_requirement branchMarch 7, 2018 09:44
@JensTimmerman
Copy link

JensTimmerman commentedMar 8, 2018
edited
Loading

I don't really like this change.
I use prospector for a bunch of python projects that are not at all django related.
Since I use prospector pylint-django get's installed automatically, this was not an issue, until now, because pylint-django now tries to install Django as well. (version 2.x, which doesn't even work on python 2.7)
So all my tests now try to install django, and fail.

Not sure if pylint-django is to blame, or prospector, but it seems at least the pylint-django developers are aweae that pylint-django is auto installed with prospector...

The readme changes warns me not to open issues about this, but my project doesn't involve django at all, so am I still required to fix my testing setup and install a django, even when nothing in my project needs it?

@jakirkham
Copy link
Contributor

This sounds like a poor separation of concerns,@JensTimmerman. Really prospector should soften the pylint-django requirement if it is not always needed. Have you brought this up with the prospector devs?

@JensTimmerman
Copy link

@carlio
Copy link
Member

It's not a poor separation of concerns until recently - the point of prospector was to be a super easy "run one command" static analysis tool so it made sense to include pylint-django because automatically tuning checks for whatever framework you were using was the initial focus.

I realise now that the propagation of requirements was another reason I didn't want to include django as a requirement of pyling-django. By removing pylint-django as a default install for prospector, it undermines the whole point which was "install, point it at code, get results with as little effort as possible".

I still maintain that not including Django as a dependency of pylint-django is a good idea, people who don't set up their test environment properly need to deal with that and including as many warnings and clues as possible in pylint-django is the best idea - hence the DjangoNotInstalledChecker. Make it easy to diagnose but don't try to second guess every environment it will be installed into because that's too many permutations.

@carlio
Copy link
Member

(Also I should point out that the "prospector devs" is me and just me, and until recently that was true of pylint-django too, so... I am the main one to blame for faults in both 🤕 )

JensTimmerman reacted with heart emoji

@atodorov
Copy link
ContributorAuthor

@carlio as a pylint-django developer and user I'm not really interested in prospector and I'm more in favor with@jakirkham that prospector needs to relax the pylint-django dependency.

OTOH I recognize there's a valid use-case for prospector to pull in pylint-django automatically but not pull Django because, well you should already have Django.

IMO both the fact that prospector has a dependency on pylint-django and the fact that I and maybe others were not aware of this lead to the conflict.@JensTimmerman brings up a valid use-case too, I don't argue about it.

Can we all agree to revert the Django dependency from pylint-django and improve README where the fat warning will say that Django must be installed manually ? I can also add a GitHub issues template to warn users not to report bugs against that.

@atodorov
Copy link
ContributorAuthor

How about an optional dependency on Django?

pip install pylint-django[with-Django]

plus the above suggestion for README ?

JensTimmerman reacted with thumbs up emoji

@jakirkham
Copy link
Contributor

Sorry the argument doesn't seem very persuasive to me.

One cannot even importpylint-django withoutdjango being installed. So it doesn't make sense to havepylint-django without this being a hard requirement. One could probably investigate softening thedjango requirement to the point thatpylint-django installs and is importable without it (perhaps with all or nearly all functionality disabled). Not sure this is worth the effort, but will happily letpylint-django developers make that decision.

My recommendation would be thatprospector soften thepylint-django dependency, but add it as extra requirement. That way one could do something likepip install prospector[all] and getpylint-django and any other cool, optional dependencies along with it. However if users want to installprospector withoutpylint-django that would be an option as well. Would think this added flexibility would makeprospector a more appealing tool to users not less, but could be wrong about that.

@atodorov
Copy link
ContributorAuthor

I think there's a bug in the existing code base and the django_installed checker does not work. IMO this is the source of@jakirkham's arguments and probably some confusion too.

Here's the output on a brand new virtualenv without Django (pylint-django 0.9.1):

$ pylint --load-plugins=pylint_django ~/Kiwi/tcmsTraceback (most recent call last):  File "/home/senko/.virtualenvs/testme/bin/pylint", line 11, in <module>    sys.exit(run_pylint())  File "/home/senko/.virtualenvs/testme/lib/python3.6/site-packages/pylint/__init__.py", line 16, in run_pylint    Run(sys.argv[1:])  File "/home/senko/.virtualenvs/testme/lib/python3.6/site-packages/pylint/lint.py", line 1268, in __init__    linter.load_plugin_modules(self._plugins)  File "/home/senko/.virtualenvs/testme/lib/python3.6/site-packages/pylint/lint.py", line 494, in load_plugin_modules    module = modutils.load_module_from_name(modname)  File "/home/senko/.virtualenvs/testme/lib/python3.6/site-packages/astroid/modutils.py", line 190, in load_module_from_name    return load_module_from_modpath(dotted_name.split('.'), path, use_sys)  File "/home/senko/.virtualenvs/testme/lib/python3.6/site-packages/astroid/modutils.py", line 233, in load_module_from_modpath    module = imp.load_module(curname, mp_file, mp_filename, mp_desc)  File "/home/senko/.virtualenvs/testme/lib64/python3.6/imp.py", line 245, in load_module    return load_package(name, filename)  File "/home/senko/.virtualenvs/testme/lib64/python3.6/imp.py", line 217, in load_package    return _load(spec)  File "<frozen importlib._bootstrap>", line 684, in _load  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked  File "<frozen importlib._bootstrap_external>", line 678, in exec_module  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed  File "/home/senko/.virtualenvs/testme/lib/python3.6/site-packages/pylint_django/__init__.py", line 7, in <module>    from pylint_django import plugin  File "/home/senko/.virtualenvs/testme/lib/python3.6/site-packages/pylint_django/plugin.py", line 5, in <module>    from pylint_django.augmentations import apply_augmentations  File "/home/senko/.virtualenvs/testme/lib/python3.6/site-packages/pylint_django/augmentations/__init__.py", line 19, in <module>    from django.views.generic.base import View, RedirectView, ContextMixinModuleNotFoundError: No module named 'django'

atodorov added a commit that referenced this pull requestMar 9, 2018
This reverts commit9b520e9.Apparently this is causing more problems than it solves, see:#132
@atodorovatodorov mentioned this pull requestMar 9, 2018
atodorov added a commit that referenced this pull requestMar 12, 2018
This reverts commit9b520e9.Apparently this is causing more problems than it solves, see:#132
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@carliocarlioAwaiting requested review from carlio

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

make django a requirement, or somehow let users know that it has to be installed
5 participants
@atodorov@coveralls@JensTimmerman@jakirkham@carlio

[8]ページ先頭

©2009-2025 Movatter.jp