Skip to content

Commit 4577bbc

Browse files
committed
flake8 sphinx conf, bootstrap stuff
1 parent 94e33f2 commit 4577bbc

File tree

2 files changed

+20
-231
lines changed

2 files changed

+20
-231
lines changed

bootstrap_env.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python
22

3-
from __future__ import (absolute_import, division, print_function,
4-
unicode_literals, with_statement)
3+
from __future__ import absolute_import, print_function, unicode_literals
54

65
import os
76
import subprocess
@@ -16,9 +15,6 @@ def fail(message):
1615
sys.exit("Error: {message}".format(message=message))
1716

1817

19-
PY2 = sys.version_info[0] == 2
20-
21-
2218
def has_module(module_name):
2319
try:
2420
import imp
@@ -77,6 +73,8 @@ def which(exe=None, throw=True):
7773
sphinx_requirements_filepath = os.path.join(
7874
project_dir, 'requirements', 'doc.txt'
7975
)
76+
test_requirements_filepath = os.path.join(
77+
project_dir, 'requirements', 'test.txt')
8078

8179

8280
try:
@@ -121,6 +119,11 @@ def main():
121119
[pip_bin, 'install', '-e', project_dir]
122120
)
123121

122+
if not has_module('pytest'):
123+
subprocess.check_call(
124+
[pip_bin, 'install', '-r', test_requirements_filepath]
125+
)
126+
124127
if not os.path.isfile(os.path.join(env_dir, 'bin', 'sphinx-quickstart')):
125128
subprocess.check_call(
126129
[pip_bin, 'install', '-r', sphinx_requirements_filepath]

doc/conf.py

Lines changed: 12 additions & 226 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,49 @@
11
# -*- coding: utf-8 -*-
2-
#
3-
# libtmux documentation build configuration file, created by
4-
# sphinx-quickstart on Sun Sep 8 17:59:29 2013.
5-
#
6-
# This file is execfile()d with the current directory set to its containing dir.
7-
#
8-
# Note that not all possible configuration values are present in this
9-
# autogenerated file.
10-
#
11-
# All configuration values have a default; values that are commented out
12-
# serve to show the default.
132

143
import os
154
import sys
165

17-
from libtmux import __version__, test
18-
196
# Get the project root dir, which is the parent dir of this
207
cwd = os.getcwd()
218
project_root = os.path.dirname(cwd)
229

23-
# Insert the project root dir as the first element in the PYTHONPATH.
24-
# This lets us ensure that the source package is imported, and that its
25-
# version is used.
2610
sys.path.insert(0, project_root)
27-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext")))
11+
12+
from libtmux import test # NOQA
2813

2914
# package data
3015
about = {}
3116
with open("../libtmux/__about__.py") as fp:
3217
exec(fp.read(), about)
3318

3419

35-
# -- General configuration -----------------------------------------------------
36-
37-
38-
# If your documentation needs a minimal Sphinx version, state it here.
39-
#needs_sphinx = '1.0'
40-
41-
# Add any Sphinx extension module names here, as strings. They can be extensions
42-
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
4320
extensions = ['sphinx.ext.autodoc',
4421
'sphinx.ext.intersphinx',
4522
'sphinx.ext.todo',
4623
'releases',
4724
]
4825

49-
# 'releases' (changelog) settings
5026
releases_unstable_prehistory = True
5127
releases_document_name = "history"
5228
releases_issue_uri = "https://github.com/tony/libtmux/issues/%s"
5329
releases_release_uri = "https://github.com/tony/libtmux/tree/%s"
5430

55-
# Add any paths that contain templates here, relative to this directory.
5631
templates_path = ['_templates']
5732

58-
# The suffix of source filenames.
5933
source_suffix = '.rst'
6034

61-
# The encoding of source files.
62-
#source_encoding = 'utf-8-sig'
63-
64-
# The master toctree document.
6535
master_doc = 'index'
6636

67-
# General information about the project.
6837
project = about['__title__']
6938
copyright = about['__copyright__']
7039

71-
# The version info for the project you're documenting, acts as replacement for
72-
# |version| and |release|, also used in various other places throughout the
73-
# built documents.
74-
#
75-
# The short X.Y version.
7640
version = '%s' % ('.'.join(about['__version__'].split('.'))[:2])
77-
# The full version, including alpha/beta/rc tags.
7841
release = '%s' % (about['__version__'])
7942

80-
# The language for content autogenerated by Sphinx. Refer to documentation
81-
# for a list of supported languages.
82-
#language = None
83-
84-
# There are two options for replacing |today|: either, you set today to some
85-
# non-false value, then it is used:
86-
#today = ''
87-
# Else, today_fmt is used as the format for a strftime call.
88-
#today_fmt = '%B %d, %Y'
89-
90-
# List of patterns, relative to source directory, that match files and
91-
# directories to ignore when looking for source files.
9243
exclude_patterns = ['_build']
9344

94-
# The reST default role (used for this markup: `text`) to use for all documents.
95-
#default_role = None
96-
97-
# If true, '()' will be appended to :func: etc. cross-reference text.
98-
#add_function_parentheses = True
99-
100-
# If true, the current module name will be prepended to all description
101-
# unit titles (such as .. function::).
102-
#add_module_names = True
103-
104-
# If true, sectionauthor and moduleauthor directives will be shown in the
105-
# output. They are ignored by default.
106-
#show_authors = False
107-
108-
# The name of the Pygments (syntax highlighting) style to use.
10945
pygments_style = 'sphinx'
11046

111-
# A list of ignored prefixes for module index sorting.
112-
#modindex_common_prefix = []
113-
114-
115-
# -- Options for HTML output ---------------------------------------------------
116-
117-
# The theme to use for HTML and HTML Help pages. See the documentation for
118-
# a list of builtin themes.
11947
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
12048
if on_rtd:
12149
html_theme = 'default'
@@ -127,169 +55,27 @@
12755
except ImportError:
12856
html_theme = 'pyramid'
12957

130-
#html_theme = 'sphinx_rtd_theme'
131-
132-
# Theme options are theme-specific and customize the look and feel of a theme
133-
# further. For a list of options available for each theme, see the
134-
# documentation.
135-
#html_theme_options = {}
136-
137-
# Add any paths that contain custom themes here, relative to this directory.
13858
html_theme_path = ['_themes']
139-
#html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
140-
141-
# from pyramid_sphinx_themes import get_html_themes_path
142-
# html_theme_path = get_html_themes_path()
143-
144-
# The name for this set of Sphinx documents. If None, it defaults to
145-
# "<project> v<release> documentation".
146-
#html_title = None
147-
148-
# A shorter title for the navigation bar. Default is the same as html_title.
149-
#html_short_title = None
150-
151-
# The name of an image file (relative to this directory) to place at the top
152-
# of the sidebar.
153-
#html_logo = None
154-
155-
# The name of an image file (within the static path) to use as favicon of the
156-
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
157-
# pixels large.
158-
#html_favicon = None
159-
160-
# Add any paths that contain custom static files (such as style sheets) here,
161-
# relative to this directory. They are copied after the builtin static files,
162-
# so a file named "default.css" will overwrite the builtin "default.css".
163-
# html_static_path = ['_static']
164-
165-
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
166-
# using the given strftime format.
167-
#html_last_updated_fmt = '%b %d, %Y'
168-
169-
# If true, SmartyPants will be used to convert quotes and dashes to
170-
# typographically correct entities.
171-
#html_use_smartypants = True
172-
173-
# Custom sidebar templates, maps document names to template names.
174-
#html_sidebars = {}
175-
176-
# Additional templates that should be rendered to pages, maps page names to
177-
# template names.
178-
#html_additional_pages = {}
179-
180-
# If false, no module index is generated.
181-
#html_domain_indices = True
18259

183-
# If false, no index is generated.
184-
#html_use_index = True
185-
186-
# If true, the index is split into individual pages for each letter.
187-
#html_split_index = False
188-
189-
# If true, links to the reST sources are added to the pages.
190-
#html_show_sourcelink = True
191-
192-
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
193-
#html_show_sphinx = True
194-
195-
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
196-
#html_show_copyright = True
197-
198-
# If true, an OpenSearch description file will be output, and all pages will
199-
# contain a <link> tag referring to it. The value of this option must be the
200-
# base URL from which the finished HTML is served.
201-
#html_use_opensearch = ''
202-
203-
# This is the file name suffix for HTML files (e.g. ".xhtml").
204-
#html_file_suffix = None
205-
206-
# Output file base name for HTML help builder.
20760
htmlhelp_basename = '%sdoc' % about['__title__']
20861

209-
# -- Options for LaTeX output --------------------------------------------------
210-
211-
latex_elements = {
212-
# The paper size ('letterpaper' or 'a4paper').
213-
#'papersize': 'letterpaper',
214-
215-
# The font size ('10pt', '11pt' or '12pt').
216-
#'pointsize': '10pt',
217-
218-
# Additional stuff for the LaTeX preamble.
219-
#'preamble': '',
220-
}
221-
222-
# Grouping the document tree into LaTeX files. List of tuples
223-
# (source start file, target name, title, author, documentclass [howto/manual]).
22462
latex_documents = [
225-
('index', '{0}.tex'.format(about['__package_name__']), '{0} Documentation'.format(about['__title__']),
226-
about['__author__'], 'manual'),
63+
('index', '{0}.tex'.format(about['__package_name__']),
64+
'{0} Documentation'.format(about['__title__']),
65+
about['__author__'], 'manual'),
22766
]
22867

229-
# The name of an image file (relative to this directory) to place at the top of
230-
# the title page.
231-
#latex_logo = None
232-
233-
# For "manual" documents, if this is true, then toplevel headings are parts,
234-
# not chapters.
235-
#latex_use_parts = False
236-
237-
# If true, show page references after internal links.
238-
#latex_show_pagerefs = False
239-
240-
# If true, show URL addresses after external links.
241-
#latex_show_urls = False
242-
243-
# Documents to append as an appendix to all manuals.
244-
#latex_appendices = []
245-
246-
# If false, no module index is generated.
247-
#latex_domain_indices = True
248-
249-
250-
# -- Options for manual page output --------------------------------------------
251-
252-
# One entry per manual page. List of tuples
253-
# (source start file, name, description, authors, manual section).
25468
man_pages = [
255-
('index', about['__package_name__'], '{0} Documentation'.format(about['__title__']),
256-
about['__author__'], 1),
69+
('index', about['__package_name__'],
70+
'{0} Documentation'.format(about['__title__']),
71+
about['__author__'], 1),
25772
]
25873

259-
# If true, show URL addresses after external links.
260-
#man_show_urls = False
261-
262-
263-
# -- Options for Texinfo output ------------------------------------------------
264-
265-
# Grouping the document tree into Texinfo files. List of tuples
266-
# (source start file, target name, title, author,
267-
# dir menu entry, description, category)
26874
texinfo_documents = [
269-
('index', '{0}'.format(about['__package_name__']), '{0} Documentation'.format(about['__title__']),
270-
about['__author__'], about['__package_name__'], about['__description__'], 'Miscellaneous'),
75+
('index', '{0}'.format(about['__package_name__']),
76+
'{0} Documentation'.format(about['__title__']),
77+
about['__author__'], about['__package_name__'],
78+
about['__description__'], 'Miscellaneous'),
27179
]
27280

273-
# Documents to append as an appendix to all manuals.
274-
#texinfo_appendices = []
275-
276-
# If false, no module index is generated.
277-
#texinfo_domain_indices = True
278-
279-
# How to display URL addresses: 'footnote', 'no', or 'inline'.
280-
#texinfo_show_urls = 'footnote'
281-
282-
# If true, do not generate a @detailmenu in the "Top" node's menu.
283-
#texinfo_no_detailmenu = False
284-
285-
# Example configuration for intersphinx: refer to the Python standard library.
28681
intersphinx_mapping = {'http://docs.python.org/': None}
287-
288-
# aafig format, try to get working with pdf
289-
aafig_format = dict(latex='pdf', html='gif')
290-
291-
aafig_default_options = dict(
292-
scale=.75,
293-
aspect=0.5,
294-
proportional=True,
295-
)

0 commit comments

Comments
 (0)