Commit Graph

19 Commits

Author SHA1 Message Date
David Smith
4aea8dd65a
Change semantic of OR of two permission classes (#7522)
* Change semantic of OR of two permission classes

The original semantic of OR is defined as: the request pass either of the two has_permission() check, and pass either of the two has_object_permission() check, which could lead to situations that a request passes has_permission() but fails on has_object_permission() of Permission Class A, fails has_permission() but passes has_object_permission() of Permission Class B, passes the OR permission check. This should not be the desired permission check semantic in applications, because such a request should fail on either Permission Class (on Django object permission) alone, but passes the OR or the two.

My code fix this by changing the semantic so that the request has to pass either class's has_permission() and has_object_permission() to get the Django object permission of the OR check.

* Update rest_framework/permissions.py

* Update setup.cfg

Co-authored-by: Mark Yu <markyu98@outlook.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-09-21 12:19:33 +01:00
Adam Johnson
35a6d65e22
Fix setuptools warning about license_files (#8595) 2022-08-10 13:47:39 +01:00
Adam Johnson
67b5093ca5
Fix pytest warnings (#7928)
* Use `--strict-markers` instead of `--strict`, as per this warning:

  ```
  /.../_pytest/config/__init__.py:1183: PytestDeprecationWarning: The --strict option is deprecated, use --strict-markers instead.
  ```

* Remove config option 'testspath' - pytest is logging a warning about this being unknown:

  ```
  /.../_pytest/config/__init__.py:1233: PytestConfigWarning: Unknown config option: testspath
  ```

  I can't find any reference to it in the pytest docs or changelog.
2021-04-16 17:47:21 +01:00
David Smith
355afcf64b
isort v5 (#7484) 2020-08-17 13:26:56 -07:00
Ryan P Kilby
a8c86be660
Update linter requirements (#7010) 2019-10-22 11:18:51 -07:00
Jon Dufresne
1e519486e1 Fixup isort command/config (#6639) 2019-05-01 17:42:10 -07:00
Carlton Gibson
0407a0df8a
Dropped Python 2 compatibility. (#6615)
Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com>
2019-04-30 17:53:44 +02:00
Ryan P Kilby
a628a2dbce Drop Django 1.10 support (#5657)
* Remove Django 1.10 from CI

* Remove Django 1.10 compat code
2018-07-06 12:14:31 +02:00
Daniel Hahler
b23cdaff4c tox/pytest: move posargs, use -ra (#6039)
- tox: move {posargs} to the end, so that it can override previous
  entries, e.g. `-ra` when `-rw` was used.
- pytest: add `-ra` to addopts: it is good to see a summary of skipped
  and failed tests at the end.
2018-07-06 10:34:11 +02:00
Ryan P Kilby
0e10d32fb1
Add NotImplementedError to coverage exclusion (#6057) 2018-06-24 17:56:31 -04:00
Daniel Hahler
499533d219 Use [tool:pytest] header in setup.cfg (#6045) 2018-06-22 18:14:26 -04:00
Daniel Hahler
c17b4ad0d0 Include coverage for tests (#5970)
It is useful to see if tests itself are covered after all - missing
coverage there typically indicates dead/missed code paths.

This also uses `source=.` and includes (with run and report), to help
Codecov with reporting.
Ref: https://github.com/encode/django-rest-framework/pull/5956
2018-05-08 14:02:45 +01:00
Daniel Hahler
4527a753cd Move pytest config to setup.cfg (#5979)
Also adds `testspath` to improve test collection performance.
2018-05-08 13:28:16 +01:00
Daniel Hahler
2854679f56 Upgrade isort (#5817)
* Fix isort

* runtests: add --diff to ISORT_ARGS

* requirements-codestyle: bump isort to 4.3.3

* isort: move config to setup.cfg
2018-02-14 20:12:14 +00:00
Jon Dufresne
da266fb864 Rename [wheel] section to [bdist_wheel] as the former is legacy
For additional details, see:

54ddbcc9ce/wheel/bdist_wheel.py (bdist_wheel.py-119):125

http://pythonwheels.com/
2017-11-03 17:40:14 -07:00
Ryan P Kilby
901657e7e8 Add banned imports to prevent standard json import 2017-09-25 09:08:20 +02:00
Daniel Hahler
89276e6cfc Move flake8 config to setup.cfg
This allows for flake8 to pick it up when running it by itself.
2017-05-16 12:18:33 +02:00
Philippe Ombredanne
e476c222f9 Add LICENSE.md to the built wheel (#4270)
The wheel released on Pypi does not include the license file .
The way to do this is by updating the setup.cfg accordingly
2016-07-18 16:08:44 +01:00
George Hickman
4807e00bff Set up wheel distribution support 2013-11-15 15:49:53 +00:00