Skip to content

Commit 9184e8c

Browse files
Upgrade (#6)
1 parent 49b6d39 commit 9184e8c

File tree

111 files changed

+3224
-2144
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+3224
-2144
lines changed

.coveralls.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
service_name: github-actions

.coverals.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ are used for versioning (schema follows below):
1515
0.3.4 to 0.4).
1616
- All backwards incompatible changes are mentioned in this document.
1717

18+
0.2.12
19+
------
20+
2021-11-25
21+
22+
- Tested against Django 3.1 and 3.2.
23+
- Tested against Python 3.9 and 3.10.
24+
- Tested against Django REST Framework 3.12.
25+
- Drop Python 2.x support.
26+
- Drop Python 3.5 support.
27+
- Drop Django < 2.2 support.
28+
- Drop Django REST Framework < 3.9.x support.
29+
1830
0.2.11
1931
------
2032
2019-12-27

README.rst

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ Collection of various tricks for
2727
Prerequisites
2828
=============
2929

30-
- Django 1.8, 1.9, 1.10, 1.11, 2.0, 2.1, 2.2 and 3.0.
31-
- Python 2.7, 3.5, 3.6, 3.7, 3.8
30+
- Django 2.2, 3.0, 3.1 and 3.2.
31+
- Python 3.6, 3.7, 3.8, 3.9 and 3.10.
3232

3333
Dependencies
3434
============
3535

36-
- djangorestframework: Written with 3.6.3, tested with >=3.5.0,<=3.11.0. May
37-
work on earlier versions, although not guaranteed.
36+
- djangorestframework: Initially written with 3.6.3, but nowadays tested
37+
with >=3.9.2,<=3.11.0. May (still) work on earlier- or (even) support
38+
later- versions, although not guaranteed.
3839

3940
Installation
4041
============
@@ -45,17 +46,11 @@ Installation
4546
4647
pip install django-rest-framework-tricks
4748
48-
or latest stable version from GitHub:
49+
or latest development version from GitHub:
4950

5051
.. code-block:: sh
5152
52-
pip install https://github.com/barseghyanartur/django-rest-framework-tricks/archive/stable.tar.gz
53-
54-
or latest stable version from BitBucket:
55-
56-
.. code-block:: sh
57-
58-
pip install https://bitbucket.org/barseghyanartur/django-rest-framework-tricks/get/stable.tar.gz
53+
pip install https://github.com/barseghyanartur/django-rest-framework-tricks/archive/master.tar.gz
5954
6055
(2) Add ``rest_framework`` and ``rest_framework_tricks`` to ``INSTALLED_APPS``:
6156

@@ -705,28 +700,19 @@ To test against specific environment, type:
705700

706701
.. code-block:: sh
707702
708-
tox -e py38-django30
703+
tox -e py39-django32
709704
710705
To test just your working environment type:
711706

712707
.. code-block:: sh
713708
714-
./runtests.py
709+
pytest -vvv
715710
716711
To run a single test in your working environment type:
717712

718713
.. code-block:: sh
719714
720-
./runtests.py src/rest_framework_tricks/tests/test_nested_proxy_field.py
721-
722-
Or:
723-
724-
.. code-block:: sh
725-
726-
./manage.py test rest_framework_tricks.tests.test_nested_proxy_field
727-
728-
It's assumed that you have all the requirements installed. If not, first
729-
install the test requirements:
715+
pytest -vvv src/rest_framework_tricks/tests/test_nested_proxy_field.py
730716
731717
.. code-block:: sh
732718

docs/conf.py

Lines changed: 62 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,24 @@
1515
import os
1616
import sys
1717

18-
from nine import versions
19-
2018
# If extensions (or modules to document with autodoc) are in another directory,
2119
# add these directories to sys.path here. If the directory is relative to the
2220
# documentation root, use os.path.abspath to make it absolute, like shown here.
2321
# sys.path.insert(0, os.path.abspath('.'))
24-
sys.path.insert(0, os.path.abspath(os.path.join('..', 'src')))
25-
sys.path.insert(0, os.path.abspath(os.path.join('..', 'examples')))
26-
sys.path.insert(0, os.path.abspath(os.path.join('..', 'examples', 'simple')))
22+
sys.path.insert(0, os.path.abspath(os.path.join("..", "src")))
23+
sys.path.insert(0, os.path.abspath(os.path.join("..", "examples")))
24+
sys.path.insert(0, os.path.abspath(os.path.join("..", "examples", "simple")))
2725
try:
2826
import rest_framework_tricks
2927
from simple import settings as example_settings
28+
3029
version = rest_framework_tricks.__version__
3130
project = rest_framework_tricks.__title__
3231
copyright = rest_framework_tricks.__copyright__
3332
except Exception as e:
34-
version = '0.1'
35-
project = u'django-rest-framework-tricks'
36-
copyright = u'2017, Artur Barseghyan <artur.barseghyan@gmail.com>'
33+
version = "0.1"
34+
project = u"django-rest-framework-tricks"
35+
copyright = u"2017, Artur Barseghyan <artur.barseghyan@gmail.com>"
3736

3837
# -- Django configuration -----------------------------------------------------
3938
import django
@@ -43,30 +42,21 @@
4342
INSTALLED_APPS = list(example_settings.INSTALLED_APPS)
4443

4544
configure_kwargs = {
46-
'DATABASES': example_settings.DATABASES,
47-
'INSTALLED_APPS': INSTALLED_APPS,
48-
'MEDIA_ROOT': example_settings.MEDIA_ROOT,
49-
'MEDIA_URL': example_settings.MEDIA_URL,
50-
'MIDDLEWARE_CLASSES': example_settings.MIDDLEWARE_CLASSES,
51-
'ROOT_URLCONF': example_settings.ROOT_URLCONF,
52-
'SECRET_KEY': example_settings.SECRET_KEY,
53-
'SITE_ID': example_settings.SITE_ID,
54-
'STATICFILES_DIRS': example_settings.STATICFILES_DIRS,
55-
'STATICFILES_FINDERS': example_settings.STATICFILES_FINDERS,
56-
'STATIC_URL': example_settings.STATIC_URL,
57-
'STATIC_ROOT': example_settings.STATIC_ROOT,
45+
"DATABASES": example_settings.DATABASES,
46+
"INSTALLED_APPS": INSTALLED_APPS,
47+
"MEDIA_ROOT": example_settings.MEDIA_ROOT,
48+
"MEDIA_URL": example_settings.MEDIA_URL,
49+
"MIDDLEWARE_CLASSES": example_settings.MIDDLEWARE_CLASSES,
50+
"ROOT_URLCONF": example_settings.ROOT_URLCONF,
51+
"SECRET_KEY": example_settings.SECRET_KEY,
52+
"SITE_ID": example_settings.SITE_ID,
53+
"STATICFILES_DIRS": example_settings.STATICFILES_DIRS,
54+
"STATICFILES_FINDERS": example_settings.STATICFILES_FINDERS,
55+
"STATIC_URL": example_settings.STATIC_URL,
56+
"STATIC_ROOT": example_settings.STATIC_ROOT,
5857
}
5958

60-
if versions.DJANGO_GTE_1_8:
61-
configure_kwargs.update({'TEMPLATES':example_settings.TEMPLATES})
62-
else:
63-
configure_kwargs.update({
64-
'TEMPLATE_CONTEXT_PROCESSORS':
65-
example_settings.TEMPLATE_CONTEXT_PROCESSORS,
66-
'TEMPLATE_DIRS': example_settings.TEMPLATE_DIRS,
67-
'TEMPLATE_LOADERS': example_settings.TEMPLATE_LOADERS,
68-
})
69-
59+
configure_kwargs.update({"TEMPLATES": example_settings.TEMPLATES})
7060

7161
settings.configure(**configure_kwargs)
7262

@@ -79,19 +69,19 @@
7969

8070
# Add any Sphinx extension module names here, as strings. They can be
8171
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
82-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
72+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"]
8373

8474
# Add any paths that contain templates here, relative to this directory.
85-
templates_path = ['_templates']
75+
templates_path = ["_templates"]
8676

8777
# The suffix of source filenames.
88-
source_suffix = '.rst'
78+
source_suffix = ".rst"
8979

9080
# The encoding of source files.
9181
# source_encoding = 'utf-8-sig'
9282

9383
# The master toctree document.
94-
master_doc = 'index'
84+
master_doc = "index"
9585

9686
# General information about the project.
9787
# project = u'django-rest-framework-tricks'
@@ -119,7 +109,7 @@
119109

120110
# List of patterns, relative to source directory, that match files and
121111
# directories to ignore when looking for source files.
122-
exclude_patterns = ['_build']
112+
exclude_patterns = ["_build"]
123113

124114
# The reST default role (used for this markup: `text`) to use for all
125115
# documents.
@@ -137,7 +127,7 @@
137127
# show_authors = False
138128

139129
# The name of the Pygments (syntax highlighting) style to use.
140-
pygments_style = 'sphinx'
130+
pygments_style = "sphinx"
141131

142132
# A list of ignored prefixes for module index sorting.
143133
# modindex_common_prefix = []
@@ -147,7 +137,7 @@
147137

148138
# The theme to use for HTML and HTML Help pages. See the documentation for
149139
# a list of builtin themes.
150-
html_theme = 'default'
140+
html_theme = "default"
151141

152142
# Theme options are theme-specific and customize the look and feel of a theme
153143
# further. For a list of options available for each theme, see the
@@ -176,7 +166,7 @@
176166
# Add any paths that contain custom static files (such as style sheets) here,
177167
# relative to this directory. They are copied after the builtin static files,
178168
# so a file named "default.css" will overwrite the builtin "default.css".
179-
html_static_path = ['_static']
169+
html_static_path = ["_static"]
180170

181171
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
182172
# using the given strftime format.
@@ -220,31 +210,31 @@
220210
# html_file_suffix = None
221211

222212
# Output file base name for HTML help builder.
223-
htmlhelp_basename = 'django-rest-framework-tricksdoc'
213+
htmlhelp_basename = "django-rest-framework-tricksdoc"
224214

225215

226216
# -- Options for LaTeX output -------------------------------------------------
227217

228218
latex_elements = {
229-
# The paper size ('letterpaper' or 'a4paper').
230-
# 'papersize': 'letterpaper',
231-
232-
# The font size ('10pt', '11pt' or '12pt').
233-
# 'pointsize': '10pt',
234-
235-
# Additional stuff for the LaTeX preamble.
236-
# 'preamble': '',
219+
# The paper size ('letterpaper' or 'a4paper').
220+
# 'papersize': 'letterpaper',
221+
# The font size ('10pt', '11pt' or '12pt').
222+
# 'pointsize': '10pt',
223+
# Additional stuff for the LaTeX preamble.
224+
# 'preamble': '',
237225
}
238226

239227
# Grouping the document tree into LaTeX files. List of tuples
240228
# (source start file, target name, title, author, documentclass
241229
# [howto/manual]).
242230
latex_documents = [
243-
('index',
244-
'django-rest-framework-tricks.tex',
245-
u'django-rest-framework-tricks Documentation',
246-
u'Artur Barseghyan \\textless{}artur.barseghyan@gmail.com\\textgreater{}',
247-
'manual'),
231+
(
232+
"index",
233+
"django-rest-framework-tricks.tex",
234+
u"django-rest-framework-tricks Documentation",
235+
u"Artur Barseghyan \\textless{}artur.barseghyan@gmail.com\\textgreater{}",
236+
"manual",
237+
),
248238
]
249239

250240
# The name of an image file (relative to this directory) to place at the top
@@ -273,11 +263,13 @@
273263
# One entry per manual page. List of tuples
274264
# (source start file, name, description, authors, manual section).
275265
man_pages = [
276-
('index',
277-
'django-rest-framework-tricks',
278-
u'django-rest-framework-tricks Documentation',
279-
[u'Artur Barseghyan <artur.barseghyan@gmail.com>'],
280-
1)
266+
(
267+
"index",
268+
"django-rest-framework-tricks",
269+
u"django-rest-framework-tricks Documentation",
270+
[u"Artur Barseghyan <artur.barseghyan@gmail.com>"],
271+
1,
272+
)
281273
]
282274

283275
# If true, show URL addresses after external links.
@@ -290,12 +282,15 @@
290282
# (source start file, target name, title, author,
291283
# dir menu entry, description, category)
292284
texinfo_documents = [
293-
('index', 'django-rest-framework-tricks',
294-
u'django-rest-framework-tricks Documentation',
295-
u'Artur Barseghyan <artur.barseghyan@gmail.com>',
296-
'django-rest-framework-tricks',
297-
"Integrate Elasticsearch DSL with Django REST framework.",
298-
'Miscellaneous'),
285+
(
286+
"index",
287+
"django-rest-framework-tricks",
288+
u"django-rest-framework-tricks Documentation",
289+
u"Artur Barseghyan <artur.barseghyan@gmail.com>",
290+
"django-rest-framework-tricks",
291+
"Integrate Elasticsearch DSL with Django REST framework.",
292+
"Miscellaneous",
293+
),
299294
]
300295

301296
# Documents to append as an appendix to all manuals.
@@ -311,10 +306,10 @@
311306
# -- Options for Epub output --------------------------------------------------
312307

313308
# Bibliographic Dublin Core info.
314-
epub_title = u'django-rest-framework-tricks'
315-
epub_author = u'Artur Barseghyan <artur.barseghyan@gmail.com>'
316-
epub_publisher = u'Artur Barseghyan <artur.barseghyan@gmail.com>'
317-
epub_copyright = u'2017, Artur Barseghyan <artur.barseghyan@gmail.com>'
309+
epub_title = u"django-rest-framework-tricks"
310+
epub_author = u"Artur Barseghyan <artur.barseghyan@gmail.com>"
311+
epub_publisher = u"Artur Barseghyan <artur.barseghyan@gmail.com>"
312+
epub_copyright = u"2017, Artur Barseghyan <artur.barseghyan@gmail.com>"
318313

319314
# The language of the text. It defaults to the language option
320315
# or en if the language is not set.

examples/requirements/base.in

Whitespace-only changes.

examples/requirements/base.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/requirements/common.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
python-memcached==1.58
2+
pytz
3+
six>=1.9
4+
Pillow

examples/requirements/common.txt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
#mysqlclient
2-
#psycopg2
1+
#
2+
# This file is autogenerated by pip-compile with python 3.8
3+
# To update, run:
4+
#
5+
# pip-compile common.in
6+
#
7+
pillow==8.4.0
8+
# via -r common.in
39
python-memcached==1.58
4-
pytz
5-
six>=1.9
6-
Pillow
10+
# via -r common.in
11+
pytz==2021.3
12+
# via -r common.in
13+
six==1.16.0
14+
# via
15+
# -r common.in
16+
# python-memcached

examples/requirements/debug.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ipython
2+
ipdb

0 commit comments

Comments
 (0)