Skip to content

Commit 26b7f5e

Browse files
committed
Updated the references to the snippets and subsections.
This is done to surpress warnings that the (previously .rst) files are not included in the TOCtree, as the :orphan: directive appears to be conflicting with Sphinx.
1 parent 5557b8d commit 26b7f5e

File tree

6 files changed

+48
-48
lines changed

6 files changed

+48
-48
lines changed

application-modules.rst

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Porting an application and a module in one package
22
==================================================
33

4-
.. include:: snippets/desc_application-modules.rst
4+
.. include:: snippets/desc_application-modules.inc
55

6-
.. include:: snippets/section_header.rst
6+
.. include:: snippets/section_header.inc
77

88

99
Porting the specfile to Python 3
@@ -25,30 +25,30 @@ Let's take an example spec file and port it to illustrate the process. We start
2525
:language: spec
2626

2727

28-
.. include:: subsections/h2-modifications.rst
28+
.. include:: subsections/h2-modifications.inc
2929

30-
.. include:: subsections/h3-subpackages.rst
30+
.. include:: subsections/h3-subpackages.inc
3131

32-
.. include:: subsections/h4-python_provide.rst
32+
.. include:: subsections/h4-python_provide.inc
3333

34-
.. include:: subsections/h4-description.rst
34+
.. include:: subsections/h4-description.inc
3535

3636

37-
.. include:: subsections/h3-build-requires.rst
37+
.. include:: subsections/h3-build-requires.inc
3838

3939
As we will be including the executable (application) only in the Python 3 subpackage, you may be also able to get rid of some runtime dependencies (listed using the ``Requires:`` tags) in the Python 2 subpackage that were previously used only by the executable and are therefore no longer needed in that subpackage. However, figuring out what runtime dependencies are no longer needed is a problematic task, therefore if you are unsure of which dependencies can be omitted, you can skip this task.
4040

41-
.. include:: subsections/h3-build.rst
41+
.. include:: subsections/h3-build.inc
4242

43-
.. include:: subsections/h3-install.rst
43+
.. include:: subsections/h3-install.inc
4444

45-
.. include:: subsections/h3-check.rst
45+
.. include:: subsections/h3-check.inc
4646

4747

4848
%files
4949
^^^^^^
5050

51-
.. include:: snippets/files_preamble.rst
51+
.. include:: snippets/files_preamble.inc
5252

5353
You can reuse the current ``%files`` section for the Python 2 submodule by giving it the appropriate package name. You can keep it almost the same as before, just make sure that, where appropriate, it uses the new macros ``%{python2_sitelib}``, ``%{python2_sitearch}``, ``%{python2_version}`` or perhaps ``%{python2_version_nodots}``.
5454

@@ -92,14 +92,14 @@ If you do think they want to depend on your application, and therefore the depen
9292
If you are unsure whether the package needs to depend on your application, open a BugZilla report for the package and ask the maintainer(s) to answer the question themselves.
9393

9494

95-
.. include:: subsections/h2-ported-specfile.rst
95+
.. include:: subsections/h2-ported-specfile.inc
9696

9797

9898
.. literalinclude:: specs/application-module.spec
9999
:language: spec
100100

101101

102-
.. include:: subsections/h2-diff.rst
102+
.. include:: subsections/h2-diff.inc
103103

104104

105105
.. literalinclude:: specs/application-module.spec

applications.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Porting applications that happen to be written in Python
22
========================================================
33

4-
.. include:: snippets/desc_applications.rst
4+
.. include:: snippets/desc_applications.inc
55

6-
.. include:: snippets/section_header.rst
6+
.. include:: snippets/section_header.inc
77

88
Porting the specfile to Python 3
99
--------------------------------
@@ -18,7 +18,7 @@ So let's take an example spec file and port it to illustrate the process. We sta
1818
:language: spec
1919

2020

21-
.. include:: subsections/h2-modifications.rst
21+
.. include:: subsections/h2-modifications.inc
2222

2323

2424
BuildRequires and Requires
@@ -56,7 +56,7 @@ Furthermore, as in the preceding `build-section`_ section, you will frequently f
5656

5757
In the install section, try substituting it with the new ``%py3_install`` macro, which should figure out what to do automatically. If that doesn't work, or if you're porting the ``%check`` section, just make sure that any custom scripts or commands are invoked by the new ``%{__python3}`` macro.
5858

59-
.. include:: snippets/install_non-python-script.rst
59+
.. include:: snippets/install_non-python-script.inc
6060

6161
%files
6262
^^^^^^
@@ -66,14 +66,14 @@ In the files section you can regularly find the following macros: ``%{python2_si
6666
The files section may also contain the versioned executable, usually ``%{_bindir}/sample-exec-2.7`` in which case it should be substituted by ``%{_bindir}/sample-exec-%{python3_version}``.
6767

6868

69-
.. include:: subsections/h2-ported-specfile.rst
69+
.. include:: subsections/h2-ported-specfile.inc
7070

7171

7272
.. literalinclude:: specs/application.spec
7373
:language: spec
7474

7575

76-
.. include:: subsections/h2-diff.rst
76+
.. include:: subsections/h2-diff.inc
7777

7878

7979
.. literalinclude:: specs/application.spec

index.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ In rare cases your package might not nicely fall into either of these categories
6161
1. Applications that happen to be written in Python
6262
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6363

64-
.. include:: snippets/desc_applications.rst
64+
.. include:: snippets/desc_applications.inc
6565

6666
*See:* :doc:`applications`
6767

@@ -75,13 +75,13 @@ If your package is being imported by third-party projects, but does not have any
7575
3. An application and a module in one package
7676
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7777

78-
.. include:: snippets/desc_application-modules.rst
78+
.. include:: snippets/desc_application-modules.inc
7979

8080
*See:* :doc:`application-modules`
8181

8282
4. Tools for programming in Python
8383
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8484

85-
.. include:: snippets/desc_tools.rst
85+
.. include:: snippets/desc_tools.inc
8686

8787
*See:* :doc:`tools`

modules.rst

+12-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Porting Python modules
33

44
This section is for Python **packages that do not have any executables**. Usually, these are normal Python modules that are being imported by third-party projects.
55

6-
.. include:: snippets/section_header.rst
6+
.. include:: snippets/section_header.inc
77

88

99
Porting the specfile to Python 3
@@ -21,27 +21,27 @@ Let's take an example spec file and port it to illustrate the process. We start
2121
:language: spec
2222

2323

24-
.. include:: subsections/h2-modifications.rst
24+
.. include:: subsections/h2-modifications.inc
2525

26-
.. include:: subsections/h3-subpackages.rst
26+
.. include:: subsections/h3-subpackages.inc
2727

28-
.. include:: subsections/h4-python_provide.rst
28+
.. include:: subsections/h4-python_provide.inc
2929

30-
.. include:: subsections/h4-description.rst
30+
.. include:: subsections/h4-description.inc
3131

32-
.. include:: subsections/h3-build-requires.rst
32+
.. include:: subsections/h3-build-requires.inc
3333

34-
.. include:: subsections/h3-build.rst
34+
.. include:: subsections/h3-build.inc
3535

36-
.. include:: subsections/h3-install.rst
36+
.. include:: subsections/h3-install.inc
3737

38-
.. include:: subsections/h3-check.rst
38+
.. include:: subsections/h3-check.inc
3939

4040

4141
%files
4242
^^^^^^
4343

44-
.. include:: snippets/files_preamble.rst
44+
.. include:: snippets/files_preamble.inc
4545

4646
You can reuse the current ``%files`` section for the Python 2 submodule by giving it the appropriate package name. You can keep it almost the same as before, just make sure that, where appropriate, it uses the new macros ``%{python2_sitelib}``, ``%{python2_sitearch}``, ``%{python2_version}`` or perhaps ``%{python2_version_nodots}``.
4747

@@ -62,13 +62,13 @@ Accordingly we'll also add a ``%files`` section for the Python 3 subpackage. You
6262
%{python3_sitelib}/*
6363
6464
65-
.. include:: subsections/h2-ported-specfile.rst
65+
.. include:: subsections/h2-ported-specfile.inc
6666

6767

6868
.. literalinclude:: specs/module.spec
6969
:language: spec
7070

71-
.. include:: subsections/h2-diff.rst
71+
.. include:: subsections/h2-diff.inc
7272

7373

7474
.. literalinclude:: specs/module.spec

subsections/h3-install.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ After that, add the corresponding Python 3 install command, which will be either
1111
%py2_install
1212
%py3_install
1313

14-
.. include:: /snippets/install_non-python-script.rst
14+
.. include:: /snippets/install_non-python-script.inc

tools.rst

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Porting tools for programming in Python
22
=======================================
33

4-
.. include:: snippets/desc_tools.rst
4+
.. include:: snippets/desc_tools.inc
55

6-
.. include:: snippets/section_header.rst
6+
.. include:: snippets/section_header.inc
77

88

99
Porting the specfile to Python 3
@@ -21,17 +21,17 @@ Let's take an example spec file and port it to illustrate the process. We start
2121
:language: spec
2222

2323

24-
.. include:: subsections/h2-modifications.rst
24+
.. include:: subsections/h2-modifications.inc
2525

26-
.. include:: subsections/h3-subpackages.rst
26+
.. include:: subsections/h3-subpackages.inc
2727

28-
.. include:: subsections/h4-python_provide.rst
28+
.. include:: subsections/h4-python_provide.inc
2929

30-
.. include:: subsections/h4-description.rst
30+
.. include:: subsections/h4-description.inc
3131

32-
.. include:: subsections/h3-build-requires.rst
32+
.. include:: subsections/h3-build-requires.inc
3333

34-
.. include:: subsections/h3-build.rst
34+
.. include:: subsections/h3-build.inc
3535

3636

3737
%install
@@ -41,7 +41,7 @@ The ``%install`` section is perhaps the most crucial one, because we have to be
4141

4242
First, in the same manner as in the preceding `build-section`_ section, it is advisable to upgrade the current Python 2 install command to use the new ``%py2_install`` macro, however, if that doesn't work for you, you can stick with the current install command, just make sure it's invoked by the ``%{__python2}`` macro. The corresponding Python 3 install command will then either be the custom command prefixed by ``%{__python3}`` or the new ``%py3_install`` macro, which I'll be using in this example.
4343

44-
.. include:: snippets/install_non-python-script.rst
44+
.. include:: snippets/install_non-python-script.inc
4545

4646
As the `packaging guidelines`_ specify, the Python 2 package is currently to be the default one, thus it is best if we first install the Python 3 version of our software and then the one for Python 2, because in case they are installing some files into the same directories (such as ``/usr/bin/``), one installation will overwrite the files of the other. So if we install the Python 2 version last, its files will be located in those shared directories.
4747

@@ -77,13 +77,13 @@ What remains is to provide symlinks for the executables in the format ``executab
7777
Note that these symlinks use a relative path in relation to their location, i.e. they are pointing to a file that is at any given moment in the same directory as they are.
7878

7979

80-
.. include:: subsections/h3-check.rst
80+
.. include:: subsections/h3-check.inc
8181

8282

8383
%files
8484
^^^^^^
8585

86-
.. include:: snippets/files_preamble.rst
86+
.. include:: snippets/files_preamble.inc
8787

8888
You can reuse the current ``%files`` section for the Python 2 submodule by giving it the appropriate package name. You can keep it almost the same as before, just make sure that, where appropriate, it uses the new macros ``%{python2_sitelib}``, ``%{python2_sitearch}``, ``%{python2_version}`` or perhaps ``%{python2_version_nodots}``. Finally, don't forget to add the two new locations of the executable we've made available through the symlinks.
8989

@@ -109,14 +109,14 @@ Accordingly we'll also add a ``%files`` section for the Python 3 subpackage. You
109109
%{_bindir}/sample-exec-%{python3_version}
110110
111111
112-
.. include:: subsections/h2-ported-specfile.rst
112+
.. include:: subsections/h2-ported-specfile.inc
113113

114114

115115
.. literalinclude:: specs/tool.spec
116116
:language: spec
117117

118118

119-
.. include:: subsections/h2-diff.rst
119+
.. include:: subsections/h2-diff.inc
120120

121121

122122
.. literalinclude:: specs/tool.spec

0 commit comments

Comments
 (0)