Skip to content

Commit

Permalink
Merge pull request #16 from anexia/master
Browse files Browse the repository at this point in the history
Django 4.2 LTS compatibility
  • Loading branch information
dirkmoors authored Oct 13, 2023
2 parents c72bffb + d674f8c commit 9580f84
Show file tree
Hide file tree
Showing 53 changed files with 792 additions and 644 deletions.
18 changes: 13 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{py,rst,ini}]
indent_style = space
indent_size = 4

[*.{html,css,scss,json,yml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
21 changes: 3 additions & 18 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
[flake8]
; We use a line length of 120 instead of pep8's default 79
ignore = E203, E266, E501, W503, F403, F401, F405
max-line-length = 120
; Files not checked:
; - venv: inline virtual env location
; - src: editable pip dependencies
; - wheel: pip wheels
; - migrations: most of these are autogenerated and don't need a check
; - settings: due to the way these are structured, they use undefined variables etc.
; - manage: these are autogenerated and don't need a check
; - docs: contains autogenerated code that doesn't need a check
; - node_modules: contains autogenerated code that doesn't need a check
; - statemachines: django-states2 doesn't respect classname conventions
exclude = venv,*migrations,deployment,scripts,.git,.cache,pip,*settings,node_modules,manage.py,*apps.py
; Cyclomatic complexity check with mccabe. Should be pushed down further.
ignore = F403,E127
; Ignoring the following cases:
; - F403: unable to detect undefined names (from X import *)
; - E127: continuation line over-indented for visual indent
max-complexity = 30
select = B,C,E,F,W,T4,B9
exclude = __pycache__
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ ENV/

.idea/

tests/uploaded/
tests/uploaded/
37 changes: 37 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: trailing-whitespace
args: ["--markdown-linebreak-ext=md"]

- repo: https://github.com/asottile/pyupgrade
rev: v3.8.0
hooks:
- id: pyupgrade
args: ["--py38-plus"]

- repo: https://github.com/asottile/add-trailing-comma
rev: v3.0.0
hooks:
- id: add-trailing-comma

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
3 changes: 2 additions & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ Development Lead
Contributors
------------

* Jef Geskens <[email protected] >
* Jef Geskens <[email protected]>
* Michael Pölzl <[email protected]>
8 changes: 4 additions & 4 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributing
============

Contributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.
little bit helps, and credit will always be given.

You can contribute in many ways:

Expand Down Expand Up @@ -36,7 +36,7 @@ is open to whoever wants to implement it.
Write Documentation
~~~~~~~~~~~~~~~~~~~

drf-tus could always use more documentation, whether as part of the
drf-tus could always use more documentation, whether as part of the
official drf-tus docs, in docstrings, or even on the web in blog posts,
articles, and such.

Expand Down Expand Up @@ -81,7 +81,7 @@ Ready to contribute? Here's how to set up `drf-tus` for local development.
$ python setup.py test
$ tox

To get flake8 and tox, just pip install them into your virtualenv.
To get flake8 and tox, just pip install them into your virtualenv.

6. Commit your changes and push your branch to GitHub::

Expand All @@ -100,7 +100,7 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 2.6, 2.7, and 3.3, and for PyPy. Check
3. The pull request should work for Python 3.8+, and for PyPy. Check
https://travis-ci.org/dirkmoors/drf-tus/pull_requests
and make sure that the tests pass for all supported Python versions.

Expand Down
49 changes: 27 additions & 22 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,44 @@
History
-------

2.0.0 (2023-07-06)
++++++++++++++++++

* Django 4.2 LTS compatibility.

1.21.2 (2018-09-04)
+++++++++++++++++++

* Fixed Django compatibility
* Fixed Django compatibility.

1.21.1 (2018-08-01)
+++++++++++++++++++

* Fixed failing travis build
* Fixed failing travis build.

1.21 (2018-08-01)
+++++++++++++++++

* Updated Django dependency and dropped support for Python 3.3.x (https://github.com/dirkmoors/drf-tus/pull/9)
* Updated Django dependency and dropped support for Python 3.3.x (https://github.com/dirkmoors/drf-tus/pull/9).

1.20 (2018-02-12)
+++++++++++++++++

* Implemented per-view max file size setting (https://github.com/dirkmoors/drf-tus/pull/8)
* Implemented per-view max file size setting (https://github.com/dirkmoors/drf-tus/pull/8).

1.19 (2018-02-08)
+++++++++++++++++

* Fixed bug that occured when pausing uploads (https://github.com/dirkmoors/drf-tus/pull/7)
* Fixed bug that occurred when pausing uploads (https://github.com/dirkmoors/drf-tus/pull/7).

1.18 (2018-02-08)
+++++++++++++++++

* Make the metadata 'filename' key a setting. (https://github.com/dirkmoors/drf-tus/pull/2)
* Switch from (Positive)IntegerField to BigIntegerField for the upload_length and upload_offset fields (https://github.com/dirkmoors/drf-tus/pull/3)
* Increase Django version support up to 1.11 (https://github.com/dirkmoors/drf-tus/pull/4)
* Fix unicode errors (https://github.com/dirkmoors/drf-tus/pull/5)
* Updated travis configuration
* Make the metadata 'filename' key a setting. (https://github.com/dirkmoors/drf-tus/pull/2).
* Switch from (Positive)IntegerField to BigIntegerField for the upload_length and upload_offset fields (https://github.com/dirkmoors/drf-tus/pull/3).
* Increase Django version support up to 1.11 (https://github.com/dirkmoors/drf-tus/pull/4).
* Fix unicode errors (https://github.com/dirkmoors/drf-tus/pull/5).
* Updated travis configuration.

1.17 (2017-05-10)
+++++++++++++++++
Expand All @@ -50,7 +55,7 @@ History
1.15 (2017-04-06)
+++++++++++++++++

* Added missing migration and changed max_length to 255 for model `Upload`'s attribute `uploaded_file`
* Added missing migration and changed max_length to 255 for model `Upload`'s attribute `uploaded_file`.

1.14 (2017-03-30)
+++++++++++++++++
Expand All @@ -65,53 +70,53 @@ History
1.12 (2017-03-10)
+++++++++++++++++

* Updated `validate_chunk` signature
* Updated `validate_chunk` signature.

1.11 (2017-03-10)
+++++++++++++++++

* Implemented `validate_chunk` handler method in TusPatchMixin
* Implemented `validate_success_headers` handler method in TusCreateMixin
* Implemented `validate_chunk` handler method in TusPatchMixin.
* Implemented `validate_success_headers` handler method in TusCreateMixin.

1.10 (2017-03-09)
+++++++++++++++++

* Disabled chunk writing to disk
* Disabled chunk writing to disk.

1.9 (2017-03-09)
++++++++++++++++

* Introduced TusUploadStreamParser
* Introduced TusUploadStreamParser.

1.8 (2017-03-09)
++++++++++++++++

* Introduced setting to include serializer data in respons body
* Introduced setting to include serializer data in response body.

1.7 (2017-03-09)
++++++++++++++++

* Bugfixes
* Bugfixes.

1.6 (2017-03-09)
++++++++++++++++

* Bugfixes
* Bugfixes.

1.5 (2017-03-09)
++++++++++++++++

* Updated middleware, removed required header (bug!)
* Updated middleware, removed required header (bug!).

1.4 (2017-03-09)
++++++++++++++++

* Initial migration
* Initial migration.

1.3 (2017-03-09)
++++++++++++++++

* Renamed some parameters / classes
* Renamed some parameters / classes.

1.2 (2017-03-09)
++++++++++++++++
Expand Down
4 changes: 0 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.




10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@ Add it to your `INSTALLED_APPS`:
INSTALLED_APPS = (
...
'rest_framework_tus',
"rest_framework_tus",
...
)
Add the middleware to `MIDDLEWARE` (or `MIDDLEWARE_CLASSES` for Django < 1.10)
Add the middleware to `MIDDLEWARE`:

.. code-block:: python
MIDDLEWARE = (
...
'rest_framework_tus.middleware.TusMiddleware',
"rest_framework_tus.middleware.TusMiddleware",
...
)
Add drf-tus's URL patterns:
Add URL patterns for drf-tus:

.. code-block:: python
urlpatterns = [
...
url(r'^', include('rest_framework_tus.urls', namespace='rest_framework_tus')),
path(r"^", include("rest_framework_tus.urls", namespace="rest_framework_tus")),
...
]
Expand Down
Loading

0 comments on commit 9580f84

Please sign in to comment.