Skip to content

Commit cd1dc85

Browse files
authored
Merge pull request #164 from shtalinberg/feature/148
#148 - Update readthedocs.io and started prepare version 4.0.0
2 parents 3dfc5ae + 404514e commit cd1dc85

Some content is hidden

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

48 files changed

+372
-311
lines changed

.github/workflows/tox.yml

+51-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
name: tox
1+
name: Tox
2+
23
on: [push, pull_request]
4+
35
jobs:
46
tox-lint:
57
runs-on: ubuntu-latest
@@ -34,23 +36,51 @@ jobs:
3436
- run: pip install tox
3537
- run: tox -e docs-linkcheck || true # Fix error and remove "|| true"!
3638

37-
# tox:
38-
# strategy:
39-
# fail-fast: false
40-
# matrix:
41-
# os: [ubuntu-latest] # [macos-latest, ubuntu-latest, windows-latest]
42-
# python: ['3.10'] # ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
43-
# django-version: ["==3.1.*", "==3.2.*", "==4.0.*"]
44-
# exclude:
45-
# # Django 4.0 no longer supports python 3.7
46-
# - python-version: 3.7
47-
# django-version: "==4.0.*"
48-
# runs-on: ${{ matrix.os }}
49-
# steps:
50-
# - uses: actions/checkout@v3
51-
# - uses: actions/setup-python@v4
52-
# with:
53-
# python-version: ${{ matrix.python }}
54-
# - run: pip install --upgrade pip
55-
# - run: pip install tox
56-
# - run: tox -e py
39+
build:
40+
strategy:
41+
fail-fast: false
42+
max-parallel: 5
43+
matrix:
44+
os: [ubuntu-latest] # [macos-latest, ubuntu-latest, windows-latest]
45+
python-version: ['3.8', '3.9', '3.10']
46+
django-version: ["==3.2.*", "==4.0.*", "==4.1.*"]
47+
# exclude:
48+
# # Django 4.0 no longer supports python 3.7
49+
# - python-version: 3.7
50+
# django-version: "==4.0.*"
51+
52+
runs-on: ${{ matrix.os }}
53+
54+
steps:
55+
- uses: actions/checkout@v3
56+
- uses: actions/setup-python@v4
57+
with:
58+
python-version: ${{ matrix.python }}
59+
60+
- name: Get pip cache dir
61+
id: pip-cache
62+
run: |
63+
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
64+
65+
- name: Cache
66+
uses: actions/cache@v3
67+
with:
68+
path: ${{ steps.pip-cache.outputs.dir }}
69+
key:
70+
-${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}
71+
restore-keys: |
72+
-${{ matrix.python-version }}-v1-
73+
74+
- name: Install dependencies
75+
run: |
76+
python -m pip install --upgrade pip
77+
python -m pip install --upgrade tox tox-gh-actions
78+
79+
- name: Tox tests
80+
run: |
81+
tox -v
82+
83+
- name: Upload coverage
84+
uses: codecov/codecov-action@v3
85+
with:
86+
name: Python ${{ matrix.python-version }}

.hgignore

-10
This file was deleted.

.travis.yml

-43
This file was deleted.

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.formatting.provider": "black"
3+
}

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Copyright (c) 2009-2013 Francesco Banconi
2-
Copyright (c) 2015-2017 Oleksandr Shtalinberg
2+
Copyright (c) 2015-2023 Oleksandr Shtalinberg
33

44
Permission is hereby granted, free of charge, to any person obtaining a copy of
55
this software and associated documentation files (the "Software"), to deal in

PKG-INFO

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 1.2
22
Name: django-el-pagination
3-
Version: 3.3.0
3+
Version: 4.0.0
44
Summary: Django pagination tools supporting Ajax, multiple and lazy pagination, Twitter-style and Digg-style pagination.
55
Home-page: https://github.com/shtalinberg/django-el-pagination
66
Author: Oleksandr Shtalinberg

README.rst

+7-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Django EL(Endless) Pagination
33
=============================
44

55
| |pypi-pkg-version| |python-versions| |django-versions| |pypi-status| |docs|
6-
| |travis-ci-status| |codecov|
6+
| |build-ci-status| |codecov|
77
88
Django EL(Endless) Pagination can be used to provide Twitter-style or
99
Digg-style pagination, with optional Ajax support and other features
@@ -15,6 +15,7 @@ From version 3.0.0 drop support Django<1.8. For support Django<1.8 use django-en
1515

1616
From version 3.3.0 drop support Django<1.11. For support Django<1.11 use django-endless-pagination<3.3.x
1717

18+
From version 4.0.0 drop support Django<3.2. For support Django<3.2 use django-endless-pagination<4.0.x
1819

1920
The initial idea, which has guided the development of this application,
2021
is to allow pagination of web contents in `very few steps
@@ -34,15 +35,15 @@ Pull requests are welcome. See `Contributing Guide
3435
<http://django-el-pagination.readthedocs.io/en/latest/contributing.html>`_.
3536

3637

37-
.. |travis-ci-status| image:: https://travis-ci.org/shtalinberg/django-el-pagination.svg?branch=develop
38-
:target: https://travis-ci.org/shtalinberg/django-el-pagination
38+
.. |build-ci-status| image:: https://github.com/jazzband/shtalinberg/django-el-pagination/Test/badge.svg
39+
:target: https://github.com/shtalinberg/django-el-pagination/actions
3940
.. |docs| image:: https://readthedocs.org/projects/django-el-pagination/badge/?version=latest&style=flat
4041
:target: https://django-el-pagination.readthedocs.io/
4142
.. |pypi-pkg-version| image:: https://img.shields.io/pypi/v/django-el-pagination.svg
4243
:target: https://pypi.python.org/pypi/django-el-pagination/
4344
.. |pypi-status| image:: https://img.shields.io/pypi/status/coverage.svg
4445
:target: https://pypi.python.org/pypi/django-el-pagination/
4546
.. |python-versions| image:: https://img.shields.io/pypi/pyversions/django-el-pagination.svg
46-
.. |django-versions| image:: https://img.shields.io/badge/django-1.8%20or%20newer-green.svg
47-
.. |codecov| image:: https://codecov.io/gh/shtalinberg/django-el-pagination/branch/develop/graph/badge.svg
48-
:target: https://codecov.io/gh/shtalinberg/django-el-pagination
47+
.. |django-versions| image:: https://img.shields.io/pypi/djversions/django-el-pagination.svg
48+
.. |codecov| image:: https://codecov.io/gh/shtalinberg/django-el-pagination/branch/master/graph/badge.svg
49+
:target: https://codecov.io/gh/shtalinberg/django-el-pagination

doc/changelog.rst

+13-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@ Changelog
22
=========
33

44

5+
Version 4.0.0
6+
~~~~~~~~~~~~~
7+
8+
**New feature**: Django 4.1.x support.
9+
Django EL(Endless) Pagination now supports Django from 3.2.x to 4.1.x
10+
supports Python 3.8, 3.9, 3.10
11+
12+
513
Version 3.3.0
614
~~~~~~~~~~~~~
715

816
**New feature**: Django 3.0.x support.
917
Django EL(Endless) Pagination now supports Django from 1.11.x to 3.0.x
10-
Dropped support for Python 2.x
18+
Dropped support for Python 2.x
19+
1120

1221
Version 3.2.4
1322
~~~~~~~~~~~~~
@@ -22,12 +31,14 @@ Bug-fix release
2231
**Fix**: cycle in show_pages with django 2.0
2332
fix tests for PageList.get_rendered()
2433

34+
2535
Version 3.2.2
2636
~~~~~~~~~~~~~
2737
Bug-fix release
2838

2939
**Fix**: fix UnicodeEncodeError with translate in templates
3040

41+
3142
Version 3.2.0
3243
~~~~~~~~~~~~~
3344
**New feature**: Django 2.0.x support.
@@ -57,6 +68,7 @@ Version 3.2.0
5768
utils.UnicodeMixin
5869
utils.text
5970

71+
6072
Version 3.1.0
6173
~~~~~~~~~~~~~
6274
**Template changes**:

doc/conf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""Django EL(Endless) Pagination documentation build configuration file."""
22

3-
from __future__ import unicode_literals
3+
44

55
AUTHOR = 'Oleksandr Shtalinberg and Francesco Banconi'
66
APP = 'Django EL(Endless) Pagination'
77
TITLE = APP + ' Documentation'
8-
VERSION = '3.3.0'
8+
VERSION = '4.0.0'
99

1010

1111
# Add any Sphinx extension module names here, as strings. They can be
@@ -23,7 +23,7 @@
2323

2424
# General information about the project.
2525
project = APP
26-
copyright = '2009-2020, ' + AUTHOR
26+
copyright = '2009-2023, ' + AUTHOR
2727

2828
# The short X.Y version.
2929
version = release = VERSION

doc/contributing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ tests, define the environment variable SKIP_SELENIUM, e.g.::
5252
$ make test SKIP_SELENIUM=1
5353

5454
Integration tests are excluded by default when using Python 3. The test suite
55-
requires Python >= 2.6.1.
55+
requires Python >= 3.8.x.
5656

5757
Run the tests and lint/pep8 checks::
5858

doc/start.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Requirements
55
~~~~~~~~~~~~
66

77
====== ====================
8-
Python >= 3.5
9-
Django >= 1.11
10-
jQuery >= 1.7
8+
Python >= 3.8
9+
Django >= 3.2
10+
jQuery >= 1.11.1
1111
====== ====================
1212

1313
Installation

el_pagination/__init__.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
Twitter-style and Digg-style pagination.
33
"""
44

5-
from __future__ import unicode_literals
65

7-
VERSION = (3, 3, 0)
6+
VERSION = (4, 0, 0)
87

98

109
def get_version():
1110
"""Return the Django EL Pagination version as a string."""
12-
return '.'.join(map(str, VERSION))
11+
return ".".join(map(str, VERSION))

el_pagination/decorators.py

+20-13
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
"""View decorators for Ajax powered pagination."""
22

3-
from __future__ import unicode_literals
4-
53
from functools import wraps
64

75
from el_pagination.settings import PAGE_LABEL, TEMPLATE_VARNAME
86

9-
QS_KEY = 'querystring_key'
7+
QS_KEY = "querystring_key"
108

119

1210
def page_template(template, key=PAGE_LABEL):
@@ -20,19 +18,25 @@ def page_template(template, key=PAGE_LABEL):
2018
The name of the page template is given as *page_template* in the
2119
extra context.
2220
"""
21+
2322
def decorator(view):
2423
@wraps(view)
2524
def decorated(request, *args, **kwargs):
2625
# Trust the developer: he wrote ``context.update(extra_context)``
2726
# in his view.
28-
extra_context = kwargs.setdefault('extra_context', {})
29-
extra_context['page_template'] = template
27+
extra_context = kwargs.setdefault("extra_context", {})
28+
extra_context["page_template"] = template
3029
# Switch the template when the request is Ajax.
31-
querystring_key = request.GET.get(QS_KEY,
32-
request.POST.get(QS_KEY, PAGE_LABEL))
33-
if request.headers.get('x-requested-with') == 'XMLHttpRequest' and querystring_key == key:
30+
querystring_key = request.GET.get(
31+
QS_KEY, request.POST.get(QS_KEY, PAGE_LABEL)
32+
)
33+
if (
34+
request.headers.get("x-requested-with") == "XMLHttpRequest"
35+
and querystring_key == key
36+
):
3437
kwargs[TEMPLATE_VARNAME] = template
3538
return view(request, *args, **kwargs)
39+
3640
return decorated
3741

3842
return decorator
@@ -71,20 +75,23 @@ def myview(request):
7175
(defined in settings) is used. You can use this decorator instead of
7276
chaining multiple *page_template* calls.
7377
"""
78+
7479
def decorator(view):
7580
@wraps(view)
7681
def decorated(request, *args, **kwargs):
7782
# Trust the developer: he wrote ``context.update(extra_context)``
7883
# in his view.
79-
extra_context = kwargs.setdefault('extra_context', {})
80-
querystring_key = request.GET.get(QS_KEY,
81-
request.POST.get(QS_KEY, PAGE_LABEL))
84+
extra_context = kwargs.setdefault("extra_context", {})
85+
querystring_key = request.GET.get(
86+
QS_KEY, request.POST.get(QS_KEY, PAGE_LABEL)
87+
)
8288
template = _get_template(querystring_key, mapping)
83-
extra_context['page_template'] = template
89+
extra_context["page_template"] = template
8490
# Switch the template when the request is Ajax.
85-
if request.headers.get('x-requested-with') == 'XMLHttpRequest' and template:
91+
if request.headers.get("x-requested-with") == "XMLHttpRequest" and template:
8692
kwargs[TEMPLATE_VARNAME] = template
8793
return view(request, *args, **kwargs)
94+
8895
return decorated
8996

9097
return decorator

el_pagination/exceptions.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""Pagination exceptions."""
22

3-
from __future__ import unicode_literals
4-
53

64
class PaginationError(Exception):
75
"""Error in the pagination process."""

0 commit comments

Comments
 (0)