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
Fix tests for django-filter 1.0.0 #122
Conversation
@@ -2,5 +2,5 @@ psycopg2 | |||
djangorestframework>=3.3 | |||
coverage==3.7.1 # rq.filter: >=3,<4 | |||
coveralls | |||
django-filter>=0.15,<1.0 | |||
django-filter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with experience I've learnt that restricting the versions in use is good, especially when the dependencies introduce backward incompatible changes.
This line doesn't affect the library during installation but only in travis builds, this will avoid our builds to break if a new (unsupported yet) version of django-filter intrdocues backward incompatible changes.
Therefore I would put django-filter>=0.15,<1.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's good to be notified in case of issues with new upstream versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
immagine the case in which we receive a bug free pull request and the build fails because of a new incompatible version of django-filter: that's annoying, because the pull request works and can be merged but the CI build would fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I know.. but it helps with being notified.
I can see your point though, so feel free to pin it.
(As for myself as a PR submitter, in case I notice that it fails because of something minor, I often just create another PR to fix it, too)
As for pytest-django we also test against Django master, but that job is allowed to fail: when there are several jobs you can see what the cause of the failure is more easily.
So an option might also be to test against pinned and unpinned versions of django-filter (possibly via #123).
@@ -132,10 +132,12 @@ class GeojsonLocationNoIdDetails(generics.RetrieveUpdateDestroyAPIView): | |||
|
|||
|
|||
class LocationFilter(GeoFilterSet): | |||
contains_properly = GeometryFilter(name='geometry', lookup_type='contains_properly') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure removing lookup_type='contains_properly
doesn't break compatibility with older django-filter versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is only for the test.
So as long as you do not want test against older django-filter versions this should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right
@@ -429,10 +429,6 @@ Example result response (cut to one element only instead of 10): | |||
Filters | |||
------- | |||
|
|||
**note**: this feature is compatible with django-filter up to version 0.15. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would leave something like: "this feature has been tested up to django-filter 1.0".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not mention that explicitly: it needs updating later etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The library (documentation, tests, changelog) needs to be updated anyway at each release. If django-filter becomes stable and won't introduce backward incompatible changes I wouldn't mind deleting the note, but this dependency has caused quite a few issues recently and I prefer to do it this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh.. the reason for 1.0.0 is exactly to become stable - all the deprecations have been dropped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right, in theory. Let's see if it also translates into practice.
thx @blueyed, I left some inline comments to lines I think may be improved. Let me know what you think. |
Avoid build breakage by eventual backward incompatible changes introduced in django-filter future versions.
@@ -429,10 +429,6 @@ Example result response (cut to one element only instead of 10): | |||
Filters | |||
------- | |||
|
|||
**note**: this feature is compatible with django-filter up to version 0.15. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The library (documentation, tests, changelog) needs to be updated anyway at each release. If django-filter becomes stable and won't introduce backward incompatible changes I wouldn't mind deleting the note, but this dependency has caused quite a few issues recently and I prefer to do it this way.
4 similar comments
Merged, thx @blueyed! |
@nemesisdesign |
Fixes #120.