Skip to content

Commit d2e538e

Browse files
author
Jon Wayne Parrott
authored
Re-organize existing documentation into new structure. (#318)
1 parent a0583f1 commit d2e538e

35 files changed

+313
-129
lines changed

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
sphinx==1.5.6
2+
sphinx_rtd_theme

scripts/linkmonitor/ignored.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
- url: plugin_discovery.html#plugin-creation-and-discovery
2+
reason: named link to first header
3+
- url: single_source_version.html#single-sourcing-the-project-version
4+
reason: named link to first header
5+
- url: deployment.html#application-deployment
6+
reason: named link to first header
7+
- url: patching.html
8+
reason: dropped incomplete topic
9+
- url: plugin_discovery.html#plugin-creation-and-discovery
10+
reason: named link to first header
11+
- url: deployment.html#application-deployment
12+
reason: named link to first header
13+
- url: additional.html#additional-topics
14+
reason: named link to first header
15+
- url: quickstart.html#quickstart
16+
reason: named link to first header
17+
- url: additional.html#additional-topics
18+
reason: named link to first header
19+
- url: platforms.html#platform-integtation
20+
reason: named link to first header

scripts/linkmonitor/inventory.yaml

Lines changed: 136 additions & 24 deletions
Large diffs are not rendered by default.

scripts/linkmonitor/linkmonitor.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
HERE = os.path.abspath(os.path.dirname(__file__))
1616
INVENTORY_FILENAME = os.path.join(HERE, 'inventory.yaml')
1717
REDIRECTS_FILENAME = os.path.join(HERE, 'redirects.yaml')
18+
IGNORED_FILENAME = os.path.join(HERE, 'ignored.yaml')
1819
ROOT = os.path.abspath(os.path.join(HERE, '..', '..'))
1920
HTML_DIR = os.path.join(ROOT, 'build', 'html')
2021
IGNORED_FILES = [
@@ -50,6 +51,9 @@ def find_all_named_anchors_in_files(files):
5051
links = set()
5152

5253
for filename in files:
54+
if filename in ('search.html',):
55+
continue
56+
5357
links.add(filename)
5458
anchors = find_all_named_anchors(filename)
5559
links.update(anchors)
@@ -80,7 +84,13 @@ def load_redirects():
8084
return yaml.load(redirects_file)
8185

8286

83-
def expand_redirects(redirects, inventory):
87+
def load_ignored():
88+
with io.open(IGNORED_FILENAME, 'r') as ignored_file:
89+
raw = yaml.load(ignored_file)
90+
return set([entry['url'] for entry in raw])
91+
92+
93+
def expand_redirects(redirects, inventory, ignored):
8494
valid_redirects = set()
8595
missing_redirects = set()
8696

@@ -99,6 +109,9 @@ def expand_redirects(redirects, inventory):
99109
# destination page. For the example above, new.html needs to have #1
100110
# #2 and #3 as well.
101111
for source_link in source_links:
112+
if source_link in ignored:
113+
continue
114+
102115
dest_link = source_link.replace(from_, redirect['to'])
103116
if dest_link in inventory:
104117
valid_redirects.add(source_link)
@@ -139,9 +152,11 @@ def check_command(args):
139152
# TODO: Add another file to list currently defined redirects.
140153
inventory = load_inventory()
141154
redirects = load_redirects()
155+
ignored = load_ignored()
142156
links = find_links()
143157

144-
valid_redirects, missing_redirects = expand_redirects(redirects, inventory)
158+
valid_redirects, missing_redirects = expand_redirects(
159+
redirects, inventory, ignored)
145160
if missing_redirects:
146161
print(
147162
'The following redirects are missing deep link anchors in the '
@@ -152,6 +167,14 @@ def check_command(args):
152167
missing_links = inventory.difference(links)
153168
missing_links -= valid_redirects
154169

170+
ignored_links = set()
171+
for link in missing_links:
172+
for source_url in ignored:
173+
if link.startswith(source_url):
174+
ignored_links.add(link)
175+
176+
missing_links -= ignored_links
177+
155178
if missing_links:
156179
print('Missing the following deep links:')
157180
for link in missing_links:

scripts/linkmonitor/redirects.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,57 @@
55

66
- from: old.html
77
to: new.html
8+
9+
- from: additional.html
10+
to: guides/index.html
11+
- from: quickstart.html
12+
to: tutorials/index.html
13+
- from: platforms.html
14+
to: guides/installing-scientific-packages.html
15+
- from: tutorial.html
16+
to: tutorials/index.html
17+
18+
- from: installing.html
19+
to: tutorials/installing-packages.html
20+
- from: deployment.html
21+
to: discussions/deploying-python-applications.html
22+
- from: requirements.html
23+
to: discussions/install-requires-vs-requirements.html
24+
- from: pip_easy_install.html
25+
to: discussions/pip-vs-easy-install.html
26+
- from: wheel_egg.html
27+
to: discussions/wheel-vs-egg.html
28+
29+
- from: plugin_discovery.html
30+
to: guides/creating-and-discovering-plugins.html
31+
- from: self_hosted_repository.html
32+
to: guides/hosting-your-own-index.html
33+
- from: mirrors.html
34+
to: guides/index-mirrors-and-caches.html
35+
- from: science.html
36+
to: guides/installing-scientific-packages.html
37+
- from: install_requirements_linux.html
38+
to: guides/installing-using-linux-tools.html
39+
- from: multi_version_install.html
40+
to: guides/multi-version-installs.html
41+
- from: extensions.html
42+
to: guides/packaging-binary-extensions.html
43+
- from: namespace_packages.html
44+
to: guides/packaging-namespace-packages.html
45+
- from: single_source_version.html
46+
to: guides/single-sourcing-package-version.html
47+
- from: multiple_python_versions.html
48+
to: guides/supporting-multiple-python-versions.html
49+
- from: appveyor.html
50+
to: guides/supporting-windows-using-appveyor.html
51+
- from: current.html
52+
to: guides/tool-recommendations.html
53+
54+
- from: specifications.html
55+
to: specifications/index.html
56+
57+
- from: distributing.html
58+
to: tutorials/distributing-packages.html
59+
- from: installing.html
60+
to: tutorials/installing-packages.html
61+

source/additional.rst

Lines changed: 0 additions & 29 deletions
This file was deleted.

source/deployment.rst renamed to source/discussions/deploying-python-applications.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

2-
======================
3-
Application Deployment
4-
======================
2+
=============================
3+
Deploying Python applications
4+
=============================
55

66
:Page Status: Incomplete
77
:Last Reviewed: 2014-11-11

source/discussions/index.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Discussions
2+
###########
3+
4+
**Discussions** are focused on providing comprehensive information about a
5+
specific topic. If you're just trying to get stuff done, see
6+
:doc:`/guides/index`.
7+
8+
.. toctree::
9+
:maxdepth: 1
10+
11+
deploying-python-applications
12+
pip-vs-easy-install
13+
install-requires-vs-requirements
14+
wheel-vs-egg
File renamed without changes.
File renamed without changes.
File renamed without changes.

source/plugin_discovery.rst renamed to source/guides/creating-and-discovering-plugins.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
=============================
2-
Plugin creation and discovery
3-
=============================
1+
================================
2+
Creating and discovering plugins
3+
================================
44

55
:Page Status: Complete
66
:Last Reviewed: 2017-04-10
@@ -61,8 +61,8 @@ naming convention.
6161
Using namespace packages
6262
========================
6363

64-
:doc:`Namespace packages <namespace_packages>` can be used to provide a
65-
convention for where to place plugins and also provides a way to perform
64+
:doc:`Namespace packages <packaging-namespace-packages>` can be used to provide
65+
a convention for where to place plugins and also provides a way to perform
6666
discovery. For example, if you make the sub-package ``myapp.plugins`` a
6767
namespace package then other :term:`distributions <Distribution Package>` can
6868
provide modules and packages to that namespace. Once installed, you can use
@@ -117,8 +117,8 @@ to :func:`setup`'s ``packages`` argument instead of using
117117

118118
.. warning:: Namespace packages are a complex feature and there are several
119119
different ways to create them. It's highly recommended to read the
120-
:doc:`namespace_packages` documentation and clearly document which
121-
approach is preferred for plugins to your project.
120+
:doc:`packaging-namespace-packages` documentation and clearly document
121+
which approach is preferred for plugins to your project.
122122

123123
Using package metadata
124124
======================

source/self_hosted_repository.rst renamed to source/guides/hosting-your-own-index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _`Hosting your Own Simple Repository`:
22

33
==================================
4-
Hosting your Own Simple Repository
4+
Hosting your own simple repository
55
==================================
66

77
:Page Status: Complete

source/mirrors.rst renamed to source/guides/index-mirrors-and-caches.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _`PyPI mirrors and caches`:
22

3-
=======================
4-
PyPI mirrors and caches
5-
=======================
3+
================================
4+
Package index mirrors and caches
5+
================================
66

77
:Page Status: Incomplete
88
:Last Reviewed: 2014-12-24

source/guides/index.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Guides
2+
######
3+
4+
**Guides** are focused on accomplishing a specific task and assume that you are
5+
already familiar with the basics of Python packaging. If you're looking for an
6+
introduction to packaging, see :doc:`/tutorials/index`.
7+
8+
.. toctree::
9+
:maxdepth: 1
10+
11+
tool-recommendations
12+
installing-using-linux-tools
13+
installing-scientific-packages
14+
multi-version-installs
15+
single-sourcing-package-version
16+
supporting-multiple-python-versions
17+
packaging-binary-extensions
18+
supporting-windows-using-appveyor
19+
packaging-namespace-packages
20+
creating-and-discovering-plugins
21+
index-mirrors-and-caches
22+
hosting-your-own-index
File renamed without changes.

source/extensions.rst renamed to source/guides/packaging-binary-extensions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _`Binary Extensions`:
22

3-
=================
4-
Binary Extensions
5-
=================
3+
===========================
4+
Packaging binary extensions
5+
===========================
66

77
:Page Status: Incomplete
88
:Last Reviewed: 2013-12-08

source/single_source_version.rst renamed to source/guides/single-sourcing-package-version.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _`Single sourcing the version`:
22

33
===================================
4-
Single-sourcing the Project Version
4+
Single-sourcing the package version
55
===================================
66

77
:Page Status: Complete

source/appveyor.rst renamed to source/guides/supporting-windows-using-appveyor.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ Visual Studio used includes 64-bit compilers with no additional setup).
6868
appveyor.yml
6969
------------
7070

71-
.. literalinclude:: code/appveyor.yml
71+
.. literalinclude:: appveyor-sample/appveyor.yml
7272
:language: yaml
7373
:linenos:
7474

75-
This file can be downloaded from `here <https://raw.githubusercontent.com/pypa/python-packaging-user-guide/master/source/code/appveyor.yml>`__.
75+
This file can be downloaded from `here <https://raw.githubusercontent.com/pypa/python-packaging-user-guide/master/source/guides/appveyor-sample/appveyor.yml>`__.
7676

7777
The ``appveyor.yml`` file must be located in the root directory of your
7878
project. It is in ``YAML`` format, and consists of a number of sections.
@@ -123,7 +123,7 @@ environment to use the SDK compiler for 64-bit builds on Python 3.3 and 3.4.
123123
For projects which do not need a compiler, or which don't support 3.3 or 3.4 on
124124
64-bit Windows, only the ``appveyor.yml`` file is needed.
125125

126-
`build.cmd <https://raw.githubusercontent.com/pypa/python-packaging-user-guide/master/source/code/build.cmd>`__
126+
`build.cmd <https://raw.githubusercontent.com/pypa/python-packaging-user-guide/master/source/guides/ppveyor-sample/build.cmd>`__
127127
is a Windows batch script that runs a single command in an environment with the
128128
appropriate compiler for the selected Python version. All you need to do is to
129129
set the single environment variable ``DISTUTILS_USE_SDK`` to a value of ``1``
@@ -228,9 +228,9 @@ Support scripts
228228

229229
For reference, the SDK setup support script is listed here:
230230

231-
``code/build.cmd``
231+
``appveyor-sample/build.cmd``
232232

233-
.. literalinclude:: code/build.cmd
233+
.. literalinclude:: appveyor-sample/build.cmd
234234
:language: bat
235235
:linenos:
236236

source/current.rst renamed to source/guides/tool-recommendations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _`Tool Recommendations`:
22

33
====================
4-
Tool Recommendations
4+
Tool recommendations
55
====================
66

77
:Page Status: Complete

source/index.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ This guide is maintained on `github
1616
.. toctree::
1717
:maxdepth: 1
1818

19-
current
20-
installing
21-
distributing
22-
additional
23-
specifications
19+
tutorials/index
20+
guides/index
21+
discussions/index
22+
specifications/index
2423
key_projects
2524
glossary
2625
support

source/patching.rst

Lines changed: 0 additions & 22 deletions
This file was deleted.

source/platforms.rst

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)