Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit fb8c2f8

Browse files
author
staticdev
committed
nox-mypy
1 parent ba08567 commit fb8c2f8

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

README.rst

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
===========================
2-
django-pagination-bootstrap
1+
Django Pagination Bootstrap
32
===========================
43

54
.. badges-begin
@@ -27,7 +26,7 @@ Django-pagination-bootstrap is an app to easy add pagination in Django_, using `
2726
Note: This library currently works with Python 3.6+, Django 2.0+ and Bootstrap 3+. For older versions, please use version 1.3.0.
2827

2928
Installation
30-
============
29+
------------
3130

3231
To install ``django-pagination-bootstrap`` simply run:
3332

@@ -36,7 +35,7 @@ To install ``django-pagination-bootstrap`` simply run:
3635
pip install django-pagination-bootstrap
3736
3837
Configuration
39-
=============
38+
-------------
4039

4140
We need to hook ``django-pagination-bootstrap`` into our project.
4241

@@ -107,7 +106,7 @@ This does not take any arguments, but does assume that you have already called a
107106
That's it! You have now paginated object_list and given users of the site a way to navigate between the different pages--all without touching your views.
108107

109108
Side effects
110-
============
109+
------------
111110

112111
A django-paginator_ instance will be injected in the template context as ``paginator``. You can access it as usual:
113112

@@ -116,7 +115,7 @@ A django-paginator_ instance will be injected in the template context as ``pagin
116115
page {{ page }} of {{ paginator.num_pages }}
117116
118117
Optional Settings
119-
=================
118+
-----------------
120119

121120
In django-pagination, there are no required settings. There are, however, a small set of optional settings useful for changing the default behavior of the pagination tags. Here's an overview:
122121

@@ -139,7 +138,7 @@ The number of orphans allowed. According to the Django documentation, orphans ar
139138
Determines whether an invalid page raises an Http404 or just sets the invalid_page context variable. True does the former and False does the latter.
140139

141140
Credits
142-
=======
141+
-------
143142

144143
This is based on Eric Florenzano's django-pagination 1.0.7 and is an updated version of https://github.com/tgdn/django-bootstrap-pagination for Django 1.7 or higher.
145144

docs/conf.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Sphinx configuration."""
2+
from datetime import datetime
3+
4+
5+
project = "Django Pagination Bootstrap"
6+
author = "Thiago Carvalho D'Ávila"
7+
copyright = f"{datetime.now().year}, {author}"
8+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon"]
9+
autodoc_typehints = "description"

mypy.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[mypy]
22

3-
[mypy-nox.*,django.*]
3+
[mypy-django.*]
44
ignore_missing_imports = True

noxfile.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Nox sessions."""
22
import contextlib
3+
import sys
34
import tempfile
45
from pathlib import Path
56
from typing import cast
@@ -12,7 +13,6 @@
1213
package = "django_pagination_bootstrap"
1314
python_versions = ["3.8", "3.7", "3.6"]
1415
nox.options.sessions = "pre-commit", "safety", "mypy", "tests"
15-
locations = "src", "tests", "noxfile.py"
1616

1717

1818
class Poetry:
@@ -129,10 +129,12 @@ def safety(session: Session) -> None:
129129
@nox.session(python=python_versions)
130130
def mypy(session: Session) -> None:
131131
"""Type-check using mypy."""
132-
args = session.posargs or locations
132+
args = session.posargs or ["src", "tests", "docs/conf.py"]
133133
install_package(session)
134134
install(session, "mypy")
135135
session.run("mypy", *args)
136+
if not session.posargs:
137+
session.run("mypy", f"--python-executable={sys.executable}", "noxfile.py")
136138

137139

138140
@nox.session(python=python_versions)

0 commit comments

Comments
 (0)