Skip to content

Commit 5abc198

Browse files
ad-mcoddingtonbear
andauthored
Add tests docs to CI and fix docs warning (#238)
* Add tests docs to CI and fix docs warning * Switch to storing environment variables in travis outside of secure vars. * Force a rebuild. * Force a rebuild. * Run integration tests just once per test run. * Minor updates. * Nevermind; this test class covers more than just integration tests. * Attempting to fix docs build via https://stackoverflow.com/questions/61711710/runtimeerror-class-not-set-defining-abstractbaseuser-as-class-django-co\#comment112739057_63045563 * Minor docs fix. Co-authored-by: Adam Coddington <[email protected]>
1 parent 225da21 commit 5abc198

File tree

8 files changed

+27
-23
lines changed

8 files changed

+27
-23
lines changed

.travis.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ os: linux
33
language: python
44

55
jobs:
6+
- env: TOX_ENV=docs
7+
python: 3.8
68
# sort by django version, next to by python version
79
# Django 1.11 support all supported Python interpreter
810
- env: TOX_ENV=django111-py35
@@ -34,16 +36,9 @@ jobs:
3436
python: 3.6
3537
- env: TOX_ENV=django30-py37
3638
python: 3.7
37-
- env: TOX_ENV=django30-py38
39+
- env: TOX_ENV=django30-py38 INTEGRATION=1
3840
python: 3.8
3941

40-
env:
41-
global:
42-
- secure: aswHU7pQroGM+GHoYlhXzzk2FYfqxXJORjqXPsbgoHAIu4Bssaj8+YAzIcdy3j9kSt4I8VBpjnn8H/wzQXki75JBZOosQrIeMK018+uR+ZMONBLqDYW/N7EJHLgZt9QXxQNKeZygrD4GN/Dc4gLHGvPQC/RfPuuHcnF0Liaahoo=
43-
- secure: RZ6M6984P885GRoyx9n/WCCWGoFAzYpS8sZkXu3e/HK9oPXfaM2IEHjkq03jIC/FcWn/QMtFjOUBqQU94rnqdivFdFkeZHk1WUQgC0hztH3Qhh9zu2PNIrYUDpVD5dJqBpprWbSwFP8yNsJlP9A2RUubTlZblKHuaBhhiuNN+kU=
44-
- secure: gsAAl/RaTodLJDHWOuHZWtooa9/psyXBONF7ElZOTki3WvH+KugtjuXn3pXBGbUhvGqd5qfgPqX7WQOFP9KTdkXBbkU20rCHLh3SV8V2vRkGFAFiGPBTFfSA83zFNMvmgEnTww4OzYsfs4wHTEyxBeQkggnB5bXEvqkFVrHBjuQ=
45-
- secure: mMa7UUt+CQDB52fGM1T3oRL67OzQzRIc+BQCOqUEUhBV7p5g7Y1Hv6NTdVZTvK16x3DsP+5kFNd1v7rsTFw2qzP3hOxIv2BtMPuSzZdnN85Zd/nGwnztxzj/rqw7TMBaYvIdEZZbpRF/K0p0Xr6LJK2s9UkPXPUaLqly7kNi360=
46-
4742
install:
4843
- pip install tox
4944

django_mailbox/models.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -701,11 +701,11 @@ def set_body(self, body):
701701
self.body = base64.b64encode(body.encode('utf-8')).decode('ascii')
702702

703703
def get_email_object(self):
704-
"""Returns an `email.message.Message` instance representing the
704+
"""Returns an `email.message.EmailMessage` instance representing the
705705
contents of this message and all attachments.
706706
707-
See [email.Message.Message]_ for more information as to what methods
708-
and properties are available on `email.message.Message` instances.
707+
See [email.message.EmailMessage]_ for more information as to what methods
708+
and properties are available on `email.message.EmailMessage` instances.
709709
710710
.. note::
711711
@@ -715,8 +715,8 @@ def get_email_object(self):
715715
using stored attachments, or read the message contents stored
716716
on-disk.
717717
718-
.. [email.Message.Message]: Python's `email.message.Message` docs
719-
(https://docs.python.org/2/library/email.message.html)
718+
.. [email.message.EmailMessage] Python's `email.message.EmailMessage` docs
719+
(https://docs.python.org/3/library/email.message.html)
720720
721721
"""
722722
if not hasattr(self, '_email_object'): # Cache fill

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
# General information about the project.
4242
project = 'django-mailbox'
43-
copyright = '2014, Adam Coddington'
43+
copyright = '2020, Adam Coddington'
4444

4545
# The version info for the project you're documenting, acts as replacement for
4646
# |version| and |release|, also used in various other places throughout the
@@ -119,7 +119,7 @@
119119
# Add any paths that contain custom static files (such as style sheets) here,
120120
# relative to this directory. They are copied after the builtin static files,
121121
# so a file named "default.css" will overwrite the builtin "default.css".
122-
html_static_path = ['_static']
122+
# html_static_path = ['_static']
123123

124124
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
125125
# using the given strftime format.
@@ -282,7 +282,7 @@ def process_docstring(app, what, name, obj, options, lines):
282282

283283
# Add the field's type to the docstring
284284
if isinstance(field, models.ForeignKey):
285-
to = field.rel.to
285+
to = field.related_model
286286
lines.append(':type {}: {} to :class:`~{}.{}`'.format(field.attname, type(field).__name__, to.__module__, to.__name__))
287287
else:
288288
lines.append(':type {}: {}'.format(field.attname, type(field).__name__))

docs/topics/appendix/message-storage.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Message Storage Details
55
First, it may be helpful to know a little bit about how e-mail messages
66
are actually sent across the wire:
77

8-
.. code-block:: http
8+
.. code-block::
99
1010
MIME-Version: 1.0
1111
Received: by 10.221.0.211 with HTTP; Sun, 20 Jan 2013 12:07:07 -0800 (PST)
@@ -52,7 +52,7 @@ and alter the message body removing the original payload component, but writing
5252
a custom header providing the library enough information to re-build the
5353
message in the event that one needs a python ``email.message.Message`` object.
5454

55-
.. code-block:: http
55+
.. code-block::
5656
5757
MIME-Version: 1.0
5858
Received: by 10.221.0.211 with HTTP; Sun, 20 Jan 2013 12:07:07 -0800 (PST)
@@ -113,7 +113,7 @@ in the place of the original attachment, the attachment was stored in a
113113
And were one to run the ``django_mailbox.Message`` instance's
114114
``get_email_object`` method, the following message will be returned:
115115

116-
.. code-block:: http
116+
.. code-block::
117117
118118
MIME-Version: 1.0
119119
Received: by 10.221.0.211 with HTTP; Sun, 20 Jan 2013 12:07:07 -0800 (PST)

docs/topics/development.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ To enroll a new release you should perform the following task:
4444
* Push a new release to PyPI - ``python setup.py sdist bdist_wheel upload``.
4545

4646
How to add support for a new Django version?
47-
------------------------------------------
47+
--------------------------------------------
4848

4949
Changes are only necessary for new minor or major Django versions.
5050

docs/topics/mailbox_types.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ to the end of your URI::
7676

7777
imap+ssl://youremailaddress%40gmail.com:[email protected]?folder=MyFolder
7878

79+
.. _gmail-oauth:
80+
7981
Specifying an archive folder
8082
++++++++++++++++++++++++++++
8183

@@ -91,8 +93,6 @@ after processing, add ``?archive=myarchivefolder`` to the end of the URI::
9193

9294
imap+ssl://youremailaddress%40gmail.com:[email protected]?archive=myarchivefolder
9395

94-
.. _gmail-oauth:
95-
9696
If you want to specifying both folder use ``&``::
9797

9898
imap+ssl://youremailaddress%40gmail.com:[email protected]?archive=myarchivefolder&folder=MyFolder

rtd_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
django>=1.9,<1.10
1+
django>=3.1.1,<3.2
22
six

tox.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ commands=
2222
python {toxinidir}/manage.py makemigrations --check --dry-run
2323
python -Wd manage.py test -v2 {posargs}
2424

25+
[testenv:docs]
26+
deps=
27+
sphinx
28+
-r{toxinidir}/rtd_requirements.txt
29+
.
30+
commands=make html clean SPHINXOPTS="-W --keep-going"
31+
changedir={toxinidir}/docs
32+
allowlist_externals=make
33+
2534
[testenv:flake8]
2635
deps=flake8
2736
commands=flake8 django_mailbox

0 commit comments

Comments
 (0)