Skip to content

Commit 1193c41

Browse files
authored
Fix documentation generation (#1222)
👍
1 parent 181b311 commit 1193c41

File tree

7 files changed

+26
-130
lines changed

7 files changed

+26
-130
lines changed

.github/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rtd:
2+
project: virtualenv

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repos:
1515
rev: master
1616
hooks:
1717
- id: seed-isort-config
18-
args: [--application-directories, "src:tests:virtualenv_embedded"]
18+
args: [--application-directories, "src:tests:virtualenv_embedded:docs:bin"]
1919
- repo: https://github.com/pre-commit/mirrors-isort
2020
rev: v4.3.4
2121
hooks:

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ A tool for creating isolated 'virtual' python environments.
99
.. image:: https://img.shields.io/pypi/pyversions/virtualenv.svg
1010
:target: https://pypi.org/project/virtualenv/
1111
:alt: Supported Python versions
12-
.. image:: https://dev.azure.com/pypa/virtualenv/_apis/build/status/pypa.virtualenv
13-
:target: https://dev.azure.com/pypa/virtualenv/_apis/build/status/pypa.virtualenv?branchName=master
12+
.. image:: https://dev.azure.com/pypa/virtualenv/_apis/build/status/pypa.virtualenv?branchName=master
13+
:target: https://dev.azure.com/pypa/virtualenv/_build/latest?definitionId=11&branchName=master
1414
:alt: Azure Pipelines build status
1515
.. image:: https://readthedocs.org/projects/virtualenv/badge/?version=latest&style=flat-square
1616
:target: https://virtualenv.readthedocs.io/en/latest/?badge=latest

docs/conf.py

Lines changed: 2 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,14 @@
11
# -*- coding: utf-8 -*-
2-
#
3-
# Paste documentation build configuration file, created by
4-
# sphinx-quickstart on Tue Apr 22 22:08:49 2008.
5-
#
6-
# This file is execfile()d with the current directory set to its containing dir.
7-
#
8-
# The contents of this file are pickled, so don't put values in the namespace
9-
# that aren't pickleable (module imports are okay, they're removed automatically).
10-
#
11-
# All configuration values have a default value; values that are commented out
12-
# serve to show the default value.
13-
142
import os
15-
import sys
163

174
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
18-
19-
# If your extensions are in another directory, add it here.
20-
sys.path.insert(0, os.path.abspath(os.pardir))
21-
22-
# General configuration
23-
# ---------------------
24-
25-
# Add any Sphinx extension module names here, as strings. They can be extensions
26-
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
275
extensions = ["sphinx.ext.autodoc", "sphinx.ext.extlinks"]
28-
29-
# Add any paths that contain templates here, relative to this directory.
30-
# templates_path = ['_templates']
31-
32-
# The suffix of source filenames.
336
source_suffix = ".rst"
34-
35-
# The master toctree document.
367
master_doc = "index"
37-
38-
# General substitutions.
398
project = "virtualenv"
40-
copyright = "2007-2014, Ian Bicking, The Open Planning Project, PyPA"
9+
copyright = "2007-2018, Ian Bicking, The Open Planning Project, PyPA"
10+
4111

42-
# The default replacements for |version| and |release|, also used in various
43-
# other places throughout the built documents.
4412
try:
4513
from virtualenv import __version__
4614

@@ -51,43 +19,15 @@
5119
except ImportError:
5220
version = release = "dev"
5321

54-
# There are two options for replacing |today|: either, you set today to some
55-
# non-false value, then it is used:
56-
# today = ''
57-
# Else, today_fmt is used as the format for a strftime call.
5822
today_fmt = "%B %d, %Y"
59-
60-
# List of documents that shouldn't be included in the build.
6123
unused_docs = []
62-
63-
# If true, '()' will be appended to :func: etc. cross-reference text.
64-
# add_function_parentheses = True
65-
66-
# If true, the current module name will be prepended to all description
67-
# unit titles (such as .. function::).
68-
# add_module_names = True
69-
70-
# If true, sectionauthor and moduleauthor directives will be shown in the
71-
# output. They are ignored by default.
72-
# show_authors = False
73-
74-
# The name of the Pygments (syntax highlighting) style to use.
7524
pygments_style = "sphinx"
7625

7726
extlinks = {
7827
"issue": ("https://github.com/pypa/virtualenv/issues/%s", "#"),
7928
"pull": ("https://github.com/pypa/virtualenv/pull/%s", "PR #"),
8029
}
8130

82-
83-
# Options for HTML output
84-
# -----------------------
85-
86-
# The style sheet to use for HTML and HTML Help pages. A file of that name
87-
# must exist either in Sphinx' static/ path, or in one of the custom paths
88-
# given in html_static_path.
89-
# html_style = 'default.css'
90-
9131
html_theme = "default"
9232
if not on_rtd:
9333
try:
@@ -97,59 +37,5 @@
9737
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
9838
except ImportError:
9939
pass
100-
101-
102-
# Add any paths that contain custom static files (such as style sheets) here,
103-
# relative to this directory. They are copied after the builtin static files,
104-
# so a file named "default.css" will overwrite the builtin "default.css".
105-
# html_static_path = ['_static']
106-
107-
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
108-
# using the given strftime format.
10940
html_last_updated_fmt = "%b %d, %Y"
110-
111-
# If true, SmartyPants will be used to convert quotes and dashes to
112-
# typographically correct entities.
113-
# html_use_smartypants = True
114-
115-
# Content template for the index page.
116-
# html_index = ''
117-
118-
# Custom sidebar templates, maps document names to template names.
119-
# html_sidebars = {}
120-
121-
# Additional templates that should be rendered to pages, maps page names to
122-
# template names.
123-
# html_additional_pages = {}
124-
125-
# If false, no module index is generated.
126-
# html_use_modindex = True
127-
128-
# If true, the reST sources are included in the HTML build as _sources/<name>.
129-
# html_copy_source = True
130-
131-
# Output file base name for HTML help builder.
13241
htmlhelp_basename = "Pastedoc"
133-
134-
135-
# Options for LaTeX output
136-
# ------------------------
137-
138-
# The paper size ('letter' or 'a4').
139-
# latex_paper_size = 'letter'
140-
141-
# The font size ('10pt', '11pt' or '12pt').
142-
# latex_font_size = '10pt'
143-
144-
# Grouping the document tree into LaTeX files. List of tuples
145-
# (source start file, target name, title, author, document class [howto/manual]).
146-
# latex_documents = []
147-
148-
# Additional stuff for the LaTeX preamble.
149-
# latex_preamble = ''
150-
151-
# Documents to append as an appendix to all manuals.
152-
# latex_appendices = []
153-
154-
# If false, no module index is generated.
155-
# latex_use_modindex = True

readthedocs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
build:
2+
image: latest
3+
python:
4+
version: 3.6
5+
pip_install: true
6+
extra_requirements:
7+
- docs
8+
formats: []

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,9 @@ def get_version():
119119
packages=find_packages("src"),
120120
package_data={"virtualenv_support": ["*.whl"]},
121121
python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
122+
extras_require={
123+
"testing": ["mock", "pytest >= 3.0.0, <4", "pytest-cov >= 2.5.1, <3", "pytest-timeout >= 1.3.0, <2"],
124+
"docs": ["sphinx >= 1.8.0, < 2"],
125+
},
122126
**setup_params
123127
)

tox.ini

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ skip_missing_interpreters = true
88
description = run tests with {basepython}
99
setenv = PIP_DISABLE_VERSION_CHECK = 1
1010
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
11-
deps = mock
12-
pytest >= 3.0.0, <4
13-
pytest-cov >= 2.5.1, <3
14-
pytest-mock >= 1.10.0, <2
15-
pytest-timeout >= 1.3.0, <2
11+
extras = testing
1612
commands = pytest {posargs:\
1713
--cov=virtualenv \
1814
--cov-config="{toxinidir}/tox.ini" \
@@ -41,9 +37,9 @@ source = src
4137
[testenv:coverage]
4238
description = [run locally after tests]: combine coverage data and create report;
4339
generates a diff coverage against origin/master (can be changed by setting DIFF_AGAINST env var)
44-
deps = {[testenv]deps}
45-
coverage >= 4.4.1, < 5
40+
deps = coverage >= 4.4.1, < 5
4641
diff_cover
42+
extras =
4743
skip_install = True
4844
passenv = DIFF_AGAINST
4945
setenv = COVERAGE_FILE={toxworkdir}/.coverage
@@ -57,22 +53,22 @@ commands = coverage erase --rcfile="{toxinidir}/tox.ini"
5753
[testenv:cross_python2]
5854
description = test creating a python3 venv with a python2-based virtualenv
5955
basepython = python2
60-
deps =
56+
extras =
6157
commands = virtualenv -p python3 {envtmpdir}/{envname}
6258
{envtmpdir}/{envname}/bin/python -V 2>&1 | grep "Python 3"
6359

6460

6561
[testenv:cross_python3]
6662
description = test creating a python2 venv with a python3-based virtualenv
6763
basepython = python3
68-
deps =
64+
extras =
6965
commands = virtualenv -p python2 {envtmpdir}/{envname}
7066
{envtmpdir}/{envname}/bin/python -V 2>&1 | grep "Python 2"
7167

7268
[testenv:docs]
7369
basepython = python3
7470
description = build documentation
75-
deps = sphinx
71+
extras = docs
7672
commands = sphinx-build -d "{envtmpdir}/doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs}
7773
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
7874

@@ -88,7 +84,7 @@ commands = pip wheel -w {envtmpdir}/build --no-deps .
8884
[testenv:embed]
8985
description = embed dependencies into virtualenv.py
9086
skip_install = true
91-
deps =
87+
extras =
9288
commands = python {toxinidir}/bin/rebuild-script.py
9389

9490
[testenv:fix_lint]

0 commit comments

Comments
 (0)