Python - How NOT to sort Sphinx output in alphabetical order

From the sphinx.ext.autodoc documentation:

autodoc_member_order

This value selects if automatically documented members are sorted alphabetical (value 'alphabetical'), by member type (value 'groupwise') or by source order (value 'bysource'). The default is alphabetical.

Note that for source order, the module must be a Python module with the source code available.

So somewhere in your conf.py file, put:

autodoc_member_order = 'bysource'

For a single .rst file (watch the last string):

foo.bar module
=========================

.. automodule:: foo.bar
   :members:
   :undoc-members:
   :show-inheritance:
   :member-order: bysource