Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
b82c864
put install and import test into its own workflow
rocco8773 Apr 25, 2025
6714052
add tests on py 3.6 and 3.13
rocco8773 Apr 25, 2025
23adafd
cache tests and set fetch-depth to 1
rocco8773 Apr 25, 2025
8d8de86
restrict workflow permissions
rocco8773 Apr 25, 2025
d87054f
no not explicitly install plasmapy
rocco8773 Apr 25, 2025
e5f8fff
set upper sphinx limit to < 8.2
rocco8773 Apr 25, 2025
c3a30c3
set upper sphinx limit to < 7.4
rocco8773 Apr 28, 2025
26c68c3
add plasmapy dependency to the documentation requirements
rocco8773 Apr 28, 2025
ed6999f
set min python version to 3.8
rocco8773 Apr 28, 2025
8d67b76
set min setuptools version to 61
rocco8773 Apr 28, 2025
d422eaf
remove fail on warnings and add 3x verbosity
rocco8773 May 1, 2025
b734e7d
remove the 3x verbosity
rocco8773 May 1, 2025
bfaa8fa
add dependency "packaging"
rocco8773 May 1, 2025
ff6dc37
adopt a kwarg passing scheme so we can be flexible in passing args to…
rocco8773 May 1, 2025
f2f6c0f
put sphinx upper limit to 8.2
rocco8773 May 1, 2025
4d52c0f
add sphinx_limits workflow
rocco8773 May 1, 2025
b1763a7
repair sphinx_limits workflow
rocco8773 May 1, 2025
91423d5
repair sphinx_limits workflow
rocco8773 May 1, 2025
3aac14c
replace double quotes with single quotes
rocco8773 May 1, 2025
06ced10
put ${{ matrix.sphinx }} between quotes
rocco8773 May 1, 2025
b6ec0a2
put fail on warning for the sphinx_limit workflow
rocco8773 May 1, 2025
7f62dda
put fail on warning for the documentation workflow
rocco8773 May 1, 2025
c183fac
explicitly pass prefixes to import_by_name
rocco8773 May 1, 2025
43cf720
explicitly remove prefixes before passing to parent method
rocco8773 May 1, 2025
c5f0ac0
add a nitpick exception for SphinxDirective.parse_inline
rocco8773 May 1, 2025
6b8b256
remove the quiet tag from sphinx builds workflow
rocco8773 May 1, 2025
2bcdb24
add to nitpick exceptions
rocco8773 May 2, 2025
0ee898b
remove the string prefix in a python agnostic way
rocco8773 May 2, 2025
9318c5f
correct the prefix removal +1
rocco8773 May 2, 2025
a9280db
add nitpick ignore for ObjectMembers type annotation
rocco8773 May 2, 2025
ef81b35
make nitpick ignore rules a little more generic
rocco8773 May 2, 2025
73fa812
add ObjectMember to nitpick ignore rules
rocco8773 May 2, 2025
eeb904d
remove upper dependency limit on sphinx
rocco8773 May 2, 2025
e218d1c
add a build on py3.11
rocco8773 May 2, 2025
ed07b59
add kwargs for generate_autosummary_content() that are specific to sp…
rocco8773 May 2, 2025
c1b7c1d
remove trailing whitespace
rocco8773 May 2, 2025
57350cd
add check on py3.11
rocco8773 May 2, 2025
c1c963a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 2, 2025
952ee2c
modify docstring of plasmapy_sphinx.autodoc to it reads better when i…
rocco8773 May 2, 2025
338dd7e
add docstring to plasmapy_sphinx.ext.autodoc
rocco8773 May 2, 2025
a526737
wrangle option :no-index: to :index: for sphinx < 7.2
rocco8773 May 3, 2025
0064fc2
PEP 8 line length
rocco8773 May 3, 2025
ef9c7df
remove unused import
rocco8773 May 3, 2025
33ec9c1
remove wrongly placed handling of the no-index option for sphinx < 7.2
rocco8773 May 3, 2025
adcd985
add the 'no-index' option to option_spec if ModuleDocumenter.option_s…
rocco8773 May 3, 2025
4701c10
wrangle option :no-index: to :index: for sphinx < 7.2
rocco8773 May 3, 2025
b2a19e3
remove unused import
rocco8773 May 3, 2025
01645db
fix typo
rocco8773 May 5, 2025
6a3439b
remove unused import
rocco8773 May 5, 2025
673aaa9
update docstrings for automodsumm
rocco8773 May 5, 2025
5e90ed9
update docstrings for css and directives
rocco8773 May 6, 2025
3a9f76c
add docstring for plasmapy_sphinx.theme
rocco8773 May 6, 2025
14d9f9c
plasmapy_sphinx.theme to the sidebar Extensions section
rocco8773 May 6, 2025
4912121
remove admonition note about not being released on PyPI
rocco8773 May 6, 2025
e4bd842
delete docs/first_steps/configure.rst
rocco8773 May 6, 2025
10899b7
rename Installing to Installation
rocco8773 May 6, 2025
0052dd5
add noqa
rocco8773 May 6, 2025
7b2fc1e
copy and modify installation instructions from plasmapy docs
rocco8773 May 6, 2025
353a51c
remove noqa
rocco8773 May 6, 2025
b5171d7
add permissions statement
rocco8773 May 6, 2025
1fef6c9
remove if-clause for importing importlib.metadata
rocco8773 May 6, 2025
20bed2f
Merge branch 'main' into overhaul_workflows
rocco8773 May 7, 2025
0b2ca04
Apply suggestions from code review
rocco8773 May 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions docs/first_steps/configure.rst

This file was deleted.

130 changes: 128 additions & 2 deletions docs/first_steps/install.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,130 @@
.. _plasmapy-install:

.. |minpython| replace:: 3.8

.. _git: https://git-scm.com/
.. |git| replace:: git_

.. _pip: https://pip.pypa.io
.. |pip| replace:: pip_

.. _Python: https://www.python.org/
.. |Python| replace:: Python_

.. _PyPI: https://pypi.org/
.. |PyPI| replace:: PyPI_

.. _`Github repository`: https://github.com/PlasmaPy/plasmapy_sphinx
.. |Github repository| replace:: `Github repository`_

.. role:: py(code)
:language: python

.. role:: bash(code)
:language: bash

****************************
Installing `plasmapy_sphinx`
============================
****************************

`plasmapy_sphinx` requires a minimum |Python| version of |minpython|. If
you do not have |Python| installed already, here are the instructions
to `download Python`_ and install it. 🐍

.. contents:: Contents
:local:

.. _install-pip:

Installing with pip
===================

To install the most recent release of `plasmapy_sphinx` on |PyPI| with
|pip| into an existing |Python| |minpython|\ + environment on macOS or
Linux, open a terminal and run:

.. code-block:: bash

python -m pip install plasmapy

On some systems, it might be necessary to specify the |Python| version
number by using ``python3``, ``python3.8``, ``python3.9``,
``python3.10``, or ``python3.11`` instead of ``python``.

To install PlasmaPy on Windows, run:

.. code-block:: bash

py -3.11 -m pip install plasmapy

The version of |Python| may be changed from ``3.11`` to another supported
Python |minpython|\ + release that has been installed on your computer.

For more detailed information, please refer to this tutorial on
`installing packages`_.

Installing from source code
===========================

Obtaining official releases
---------------------------

A ZIP_ file containing the source code for official releases of
`plasmapy_sphinx` can be obtained `from PyPI`_.

Alternatively, official releases can be downloaded from the releases_
page on the |GitHub repository|.

Obtaining source code from GitHub
---------------------------------

If you have |git| installed on your computer, you may clone the
|Github repository| and access the source code from the most
recent development version by running:

.. code-block:: bash

git clone https://github.com/PlasmaPy/plasmapy_sphinx.git

The repository will be cloned inside a new subdirectory called
:file:`plasmapy_sphinx`.

If you do not have |git| installed on your computer, then you may
download the most recent source code from |Github repository|
by going to :guilabel:`Code` and selecting :guilabel:`Download ZIP`.
`Unzipping <https://www.wikihow.com/Unzip-a-File>`__ the file will
create a subdirectory called :file:`plasmapy_sphinx` that contains the
source code.

Building and installing
-----------------------

To install the downloaded version of `plasmapy_sphinx`, enter the
:file:`plasmapy_sphinx` directory and run:

.. code-block:: bash

pip install .

If you expect to occasionally edit the source code, instead run:

.. code-block:: bash

pip install -e .

The ``-e`` flag makes the installation editable.

.. note::

If you noticed any places where the installation instructions could
be improved or have become out of date, please `create an issue`_ on
|Github repository|. It would really help!

blah
.. _clone a repository using SSH: https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-ssh-urls
.. _create an issue: https://github.com/PlasmaPy/plasmapy_sphinx/issues/new
.. _download Python: https://www.python.org/downloads
.. _from PyPI: https://pypi.org/project/plasmapy_sphinx
.. _installing packages: https://packaging.python.org/en/latest/tutorials/installing-packages/#installing-from-vcs
.. _releases: https://github.com/PlasmaPy/plasmapy_sphinx/releases
.. _virtual environment: https://realpython.com/python-virtual-environments-a-primer
.. _ZIP: https://en.wikipedia.org/wiki/ZIP_(file_format)
12 changes: 3 additions & 9 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,15 @@ just a selection of desired ones.

.. note::

`plasmapy_sphinx` is not currently released in any form and can
only be installed directly from its `GitHub repository
<https://github.com/plasmapy/plasmapy_sphinx>`__. We do plan to
release it to https://pypi.org but there is no scheduled release
date at this time.

Additionally, this package currently has no tests covering its
This package currently has no tests covering its
functionality.


.. toctree::
:caption: First Steps
:maxdepth: 1

Installing <first_steps/install>
Configuring <first_steps/configure>
Installation <first_steps/install>

.. toctree::
:caption: Extensions
Expand All @@ -40,6 +33,7 @@ just a selection of desired ones.
api_static/plasmapy_sphinx.ext.automodsumm
api_static/plasmapy_sphinx.ext.css
api_static/plasmapy_sphinx.ext.directives
api_static/plasmapy_sphinx.theme

.. toctree::
:caption: Contributor Guide
Expand Down
3 changes: 2 additions & 1 deletion plasmapy_sphinx/autodoc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
This sub-package contains functionality that extends `sphinx.ext.autodoc`.
`plasmapy_sphinx.autodoc` contains functionality that extends
`sphinx.ext.autodoc`.

*This functionality was highly influenced by and adapted from*
`sphinx.ext.autodoc` *and* `sphinx_automodapi.automodapi`.
Expand Down
6 changes: 3 additions & 3 deletions plasmapy_sphinx/automodsumm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""
This sub-package contains functionality that defines the :rst:dir:`automodsumm`
directive and the
`plasmapy_sphinx.automodsumm` contains functionality that defines the
:rst:dir:`automodsumm` directive, and the associated automatic
`stub file generation
<https://www.sphinx-doc.org/en/master/usage/extensions/autosummary.html
#sphinx-autogen-generate-autodoc-stub-pages>`_
for items listed in :rst:dir:`automodsumm` tables.
for the documented items in the generated :rst:dir:`automodsumm` tables.

*This functionality was highly influenced by and adapted from*
`sphinx.ext.autosummary` *and* `sphinx_automodapi.automodsumm`.
Expand Down
18 changes: 10 additions & 8 deletions plasmapy_sphinx/automodsumm/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,17 @@ def __init__(
Instance of the sphinx application.

modname : `str`
Name of the module given in the :rst:dir:`automodsumm` directive. This
is the module to be inspected and have it's objects grouped.
Name of the module given in the :rst:dir:`automodsumm`
directive. This is the module to be inspected and have
its objects grouped.

options : Dict[str, Any]
Dictionary of options given for the :rst:dir:`automodsumm` directive
declaration.
Dictionary of options given for the :rst:dir:`automodsumm`
directive declaration.

docname : str
Name of the document/file where the :rst:dir:`automodsumm` direction
was declared.
Name of the document/file where the :rst:dir:`automodsumm`
direction was declared.
"""

self._app = app
Expand Down Expand Up @@ -609,8 +610,9 @@ def run(self):

def option_processor(self):
"""
Instance of `~plasmapy_sphinx.automodsumm.core.Automodsumm` so further processing
(beyond :attr:`option_spec`) of directive options can be performed.
Instance of `~plasmapy_sphinx.automodsumm.core.Automodsumm` so
further processing (beyond :attr:`option_spec`) of directive
options can be performed.
"""
processor = AutomodsummOptions(
app=self.env.app,
Expand Down
2 changes: 1 addition & 1 deletion plasmapy_sphinx/directives/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
This sub-package defines
`plasmapy_sphinx.directives` defines
`directives
<https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html>`_
and
Expand Down
13 changes: 12 additions & 1 deletion plasmapy_sphinx/ext/autodoc.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
"""
This module is a `Sphinx extension
<https://www.sphinx-doc.org/en/master/usage/extensions/index.html>`_
that exposes the functionality of `plasmapy_sphinx.autodoc`.

.. automodapi:: plasmapy_sphinx.autodoc
:no-index:
:no-groups:

"""
__all__ = ["automodapi", "setup"]
from sphinx.application import Sphinx

from plasmapy_sphinx.autodoc import automodapi


def setup(app: Sphinx):
"""
Sphinx ``setup()`` function for setting up all of the
Sphinx ``setup()`` function for setting up all the
`plasmapy_sphinx.autodoc` functionality, this includes
`plasmapy_sphinx.automodsumm` functionality.
"""
Expand Down
10 changes: 10 additions & 0 deletions plasmapy_sphinx/ext/automodsumm.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
"""
This module is a `Sphinx extension
<https://www.sphinx-doc.org/en/master/usage/extensions/index.html>`_
that exposes the functionality of `plasmapy_sphinx.automodsumm`.

.. automodapi:: plasmapy_sphinx.automodsumm
:no-index:
:no-groups:

"""
from sphinx.application import Sphinx

from plasmapy_sphinx.automodsumm import core
Expand Down
9 changes: 9 additions & 0 deletions plasmapy_sphinx/ext/css.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
"""
This module is a `Sphinx extension
<https://www.sphinx-doc.org/en/master/usage/extensions/index.html>`_
that adds the PlasmaPy CSS style sheet to the `sphinx` build
environment. The :file:`plasmapy.css` is loaded into the build system
using `~sphinx.application.Sphinx.add_css_file` with a priority of
``501``.
"""

from sphinx.application import Sphinx

from plasmapy_sphinx.utils import static_dir, css_dir
Expand Down
10 changes: 10 additions & 0 deletions plasmapy_sphinx/ext/directives.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
"""
This module is a `Sphinx extension
<https://www.sphinx-doc.org/en/master/usage/extensions/index.html>`_
that exposes the functionality of `plasmapy_sphinx.directives`.

.. automodapi:: plasmapy_sphinx.directives
:no-index:
:no-groups:

"""
from sphinx.application import Sphinx

from plasmapy_sphinx.directives import confval, event
Expand Down
15 changes: 15 additions & 0 deletions plasmapy_sphinx/theme/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Sphinx Guide to Theme Development
# https://www.sphinx-doc.org/en/master/development/theming.html
"""
The PlasmaPy theme is a `Sphinx theme
<https://www.sphinx-doc.org/en/master/usage/theming.html>`_ that
inherits from the `sphinx_rtd_theme`. As such, it shares all the same
`configuration values supported by sphinx_rtd_theme
<https://sphinx-rtd-theme.readthedocs.io/en/stable/configuring.html#theme-options>`_\ .

To use the PlasmaPy theme one needs to the :file:`conf.py`:

.. code-block:: python

extensions = ["plasmapy_sphinx.theme"]
html_theme = "plasmapy_theme"

"""
__all__ = ["setup"]
from sphinx.application import Sphinx

Expand Down