Skip to content

Commit

Permalink
Add tests docs to CI and fix docs warning (#238)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
ad-m and coddingtonbear authored Dec 7, 2020
1 parent 225da21 commit 5abc198
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 23 deletions.
11 changes: 3 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ os: linux
language: python

jobs:
- env: TOX_ENV=docs
python: 3.8
# sort by django version, next to by python version
# Django 1.11 support all supported Python interpreter
- env: TOX_ENV=django111-py35
Expand Down Expand Up @@ -34,16 +36,9 @@ jobs:
python: 3.6
- env: TOX_ENV=django30-py37
python: 3.7
- env: TOX_ENV=django30-py38
- env: TOX_ENV=django30-py38 INTEGRATION=1
python: 3.8

env:
global:
- secure: aswHU7pQroGM+GHoYlhXzzk2FYfqxXJORjqXPsbgoHAIu4Bssaj8+YAzIcdy3j9kSt4I8VBpjnn8H/wzQXki75JBZOosQrIeMK018+uR+ZMONBLqDYW/N7EJHLgZt9QXxQNKeZygrD4GN/Dc4gLHGvPQC/RfPuuHcnF0Liaahoo=
- secure: RZ6M6984P885GRoyx9n/WCCWGoFAzYpS8sZkXu3e/HK9oPXfaM2IEHjkq03jIC/FcWn/QMtFjOUBqQU94rnqdivFdFkeZHk1WUQgC0hztH3Qhh9zu2PNIrYUDpVD5dJqBpprWbSwFP8yNsJlP9A2RUubTlZblKHuaBhhiuNN+kU=
- secure: gsAAl/RaTodLJDHWOuHZWtooa9/psyXBONF7ElZOTki3WvH+KugtjuXn3pXBGbUhvGqd5qfgPqX7WQOFP9KTdkXBbkU20rCHLh3SV8V2vRkGFAFiGPBTFfSA83zFNMvmgEnTww4OzYsfs4wHTEyxBeQkggnB5bXEvqkFVrHBjuQ=
- secure: mMa7UUt+CQDB52fGM1T3oRL67OzQzRIc+BQCOqUEUhBV7p5g7Y1Hv6NTdVZTvK16x3DsP+5kFNd1v7rsTFw2qzP3hOxIv2BtMPuSzZdnN85Zd/nGwnztxzj/rqw7TMBaYvIdEZZbpRF/K0p0Xr6LJK2s9UkPXPUaLqly7kNi360=

install:
- pip install tox

Expand Down
10 changes: 5 additions & 5 deletions django_mailbox/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,11 +701,11 @@ def set_body(self, body):
self.body = base64.b64encode(body.encode('utf-8')).decode('ascii')

def get_email_object(self):
"""Returns an `email.message.Message` instance representing the
"""Returns an `email.message.EmailMessage` instance representing the
contents of this message and all attachments.
See [email.Message.Message]_ for more information as to what methods
and properties are available on `email.message.Message` instances.
See [email.message.EmailMessage]_ for more information as to what methods
and properties are available on `email.message.EmailMessage` instances.
.. note::
Expand All @@ -715,8 +715,8 @@ def get_email_object(self):
using stored attachments, or read the message contents stored
on-disk.
.. [email.Message.Message]: Python's `email.message.Message` docs
(https://docs.python.org/2/library/email.message.html)
.. [email.message.EmailMessage] Python's `email.message.EmailMessage` docs
(https://docs.python.org/3/library/email.message.html)
"""
if not hasattr(self, '_email_object'): # Cache fill
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

# General information about the project.
project = 'django-mailbox'
copyright = '2014, Adam Coddington'
copyright = '2020, Adam Coddington'

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

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

# Add the field's type to the docstring
if isinstance(field, models.ForeignKey):
to = field.rel.to
to = field.related_model
lines.append(':type {}: {} to :class:`~{}.{}`'.format(field.attname, type(field).__name__, to.__module__, to.__name__))
else:
lines.append(':type {}: {}'.format(field.attname, type(field).__name__))
Expand Down
6 changes: 3 additions & 3 deletions docs/topics/appendix/message-storage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Message Storage Details
First, it may be helpful to know a little bit about how e-mail messages
are actually sent across the wire:

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

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

.. code-block:: http
.. code-block::
MIME-Version: 1.0
Received: by 10.221.0.211 with HTTP; Sun, 20 Jan 2013 12:07:07 -0800 (PST)
Expand Down
2 changes: 1 addition & 1 deletion docs/topics/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ To enroll a new release you should perform the following task:
* Push a new release to PyPI - ``python setup.py sdist bdist_wheel upload``.

How to add support for a new Django version?
------------------------------------------
--------------------------------------------

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

Expand Down
4 changes: 2 additions & 2 deletions docs/topics/mailbox_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ to the end of your URI::

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

.. _gmail-oauth:

Specifying an archive folder
++++++++++++++++++++++++++++

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

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

.. _gmail-oauth:

If you want to specifying both folder use ``&``::

imap+ssl://youremailaddress%40gmail.com:[email protected]?archive=myarchivefolder&folder=MyFolder
Expand Down
2 changes: 1 addition & 1 deletion rtd_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
django>=1.9,<1.10
django>=3.1.1,<3.2
six
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ commands=
python {toxinidir}/manage.py makemigrations --check --dry-run
python -Wd manage.py test -v2 {posargs}

[testenv:docs]
deps=
sphinx
-r{toxinidir}/rtd_requirements.txt
.
commands=make html clean SPHINXOPTS="-W --keep-going"
changedir={toxinidir}/docs
allowlist_externals=make

[testenv:flake8]
deps=flake8
commands=flake8 django_mailbox

0 comments on commit 5abc198

Please sign in to comment.