Welcome to jaraco.packaging documentation!

This module is a Sphinx plugin. Add jaraco.packaging.sphinx to conf.py, and the setup hook does the rest.

>>> 'setup' in globals()
True
class jaraco.packaging.sphinx.SidebarLinksDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)

Bases: SphinxDirective

Directive which adds a toctree to the sidebar containing links to the project home and PyPI repo.

has_content: ClassVar[bool] = True

May the directive have content?

option_spec = {'caption': <function unchanged_required>, 'home': <function flag>, 'pypi': <function flag>}

Mapping of option names to validator functions.

run()

Create the installation node.

jaraco.packaging.sphinx.add_package_url(app, pagename, templatename, context, doctree)
jaraco.packaging.sphinx.configure_substitutions(app, config)
jaraco.packaging.sphinx.extract_author(meta)

Given project metadata, figure out who the author is.

The metadata is so irregular, just make some inferences and refine.

This form comes from a setup.cfg file or setup.py.

>>> meta = {'Author': 'Jason R. Coombs'}
>>> extract_author(meta)
'Jason R. Coombs'
>>> meta = {'Author': 'Foo Bar, Bing Baz'}
>>> extract_author(meta)
'Foo Bar, Bing Baz'

This form comes from pyproject.toml converted from the above config.

>>> meta = {'Author-email': '"Jason R. Coombs" <jaraco@contoso.com>', 'Author': None}
>>> extract_author(meta)
'Jason R. Coombs'
>>> meta = {'Author-email': 'Foo Bar <foo@bar.name>, Bing Baz <bing@baz.name>', 'Author': None}
>>> extract_author(meta)
'Foo Bar, Bing Baz'
jaraco.packaging.sphinx.get_best(project_urls)
jaraco.packaging.sphinx.hunt_down_url(meta)

Given project metadata, figure out what the package URL is.

jaraco.packaging.sphinx.load_config_from_setup(app, config)

Replace values in app.config from package metadata

jaraco.packaging.sphinx.setup(app)

Indices and tables