Skip to content

Commit 71e46f0

Browse files
authored
Use :cpy-file: throughout the Devguide (#984)
* Use :cpy-file: throughout the Devguide. * Fix broken file paths.
1 parent f9f005a commit 71e46f0

File tree

7 files changed

+114
-106
lines changed

7 files changed

+114
-106
lines changed

core-developers/experts.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ while any other issues can and should be decided by any committer.
1717

1818
Developers can choose to follow labels, so if a label that they are
1919
following is added to an issue or pull request, they will be notified
20-
automatically. The :file:`CODEOWNERS` file is also used to indicate
20+
automatically. The :cpy-file:`.github/CODEOWNERS` file is also used to indicate
2121
maintainers that will be automatically added as reviewers to pull requests.
2222

2323
Unless a name is followed by a '*', you should never assign an issue to

developer-workflow/c-api.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ C API Tests
101101
Tests for the public C API live in the ``_testcapi`` module.
102102
Functions named ``test_*`` are used as tests directly.
103103
Tests that need Python code (or are just easier to partially write in Python)
104-
live in ``Lib/test``, mainly in :file:`Lib/test/test_capi.py`.
104+
live in ``Lib/test``, mainly in :cpy-file:`Lib/test/test_capi`.
105105

106106
Due to its size, the ``_testcapi`` module is defined in several source
107107
files.
108108
To add a new set of tests (or extract a set out of the monolithic
109-
:file:`Modules/_testcapimodule.c`):
109+
:cpy-file:`Modules/_testcapimodule.c`):
110110

111111
- Create a C file named ``Modules/_testcapi/yourfeature.c``
112112

developer-workflow/grammar.rst

+26-23
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Abstract
88
========
99

1010
There's more to changing Python's grammar than editing
11-
:file:`Grammar/python.gram`. Here's a checklist.
11+
:cpy-file:`Grammar/python.gram`. Here's a checklist.
1212

1313
.. note::
1414
These instructions are for Python 3.9 and beyond. Earlier
@@ -25,42 +25,45 @@ Checklist
2525

2626
Note: sometimes things mysteriously don't work. Before giving up, try ``make clean``.
2727

28-
* :file:`Grammar/python.gram`: The grammar, with actions that build AST nodes. After changing
29-
it, run ``make regen-pegen`` (or ``build.bat --regen`` on Windows), to
30-
regenerate :file:`Parser/parser.c`.
28+
* :cpy-file:`Grammar/python.gram`: The grammar, with actions that build AST nodes.
29+
After changing it, run ``make regen-pegen`` (or ``build.bat --regen`` on Windows),
30+
to regenerate :cpy-file:`Parser/parser.c`.
3131
(This runs Python's parser generator, ``Tools/peg_generator``).
3232

33-
* :file:`Grammar/Tokens` is a place for adding new token types. After
34-
changing it, run ``make regen-token`` to regenerate :file:`Include/token.h`,
35-
:file:`Parser/token.c`, :file:`Lib/token.py` and
36-
:file:`Doc/library/token-list.inc`. If you change both ``python.gram`` and ``Tokens``,
37-
run ``make regen-token`` before ``make regen-pegen``. On Windows,
38-
``build.bat --regen`` will regenerate both at the same time.
33+
* :cpy-file:`Grammar/Tokens` is a place for adding new token types. After
34+
changing it, run ``make regen-token`` to regenerate :cpy-file:`Include/token.h`,
35+
:cpy-file:`Parser/token.c`, :cpy-file:`Lib/token.py` and
36+
:cpy-file:`Doc/library/token-list.inc`. If you change both ``python.gram``
37+
and ``Tokens``, run ``make regen-token`` before ``make regen-pegen``.
38+
On Windows, ``build.bat --regen`` will regenerate both at the same time.
3939

40-
* :file:`Parser/Python.asdl` may need changes to match the grammar. Then run ``make
41-
regen-ast`` to regenerate :file:`Include/Python-ast.h` and :file:`Python/Python-ast.c`.
40+
* :cpy-file:`Parser/Python.asdl` may need changes to match the grammar.
41+
Then run ``make regen-ast`` to regenerate :cpy-file:`Include/Python-ast.h`
42+
and :cpy-file:`Python/Python-ast.c`.
4243

43-
* :file:`Parser/tokenizer.c` contains the tokenization code. This is where you would
44-
add a new type of comment or string literal, for example.
44+
* :cpy-file:`Parser/tokenizer.c` contains the tokenization code.
45+
This is where you would add a new type of comment or string literal, for example.
4546

46-
* :file:`Python/ast.c` will need changes to validate AST objects involved with the
47-
grammar change.
47+
* :cpy-file:`Python/ast.c` will need changes to validate AST objects
48+
involved with the grammar change.
4849

49-
* :file:`Python/ast_unparse.c` will need changes to unparse AST objects involved with the
50-
grammar change ("unparsing" is used to turn annotations into strings per :pep:`563`).
50+
* :cpy-file:`Python/ast_unparse.c` will need changes to unparse AST
51+
involved with the grammar change ("unparsing" is used to turn annotations
52+
into strings per :pep:`563`).
5153

5254
* The :ref:`compiler` has its own page.
5355

54-
* ``_Unparser`` in the :file:`Lib/ast.py` file may need changes to accommodate
55-
any modifications in the AST nodes.
56+
* ``_Unparser`` in the :cpy-file:`Lib/ast.py` file may need changes
57+
to accommodate any modifications in the AST nodes.
5658

57-
* :file:`Doc/library/ast.rst` may need to be updated to reflect changes to AST nodes.
59+
* :cpy-file:`Doc/library/ast.rst` may need to be updated to reflect changes
60+
to AST nodes.
5861

5962
* Add some usage of your new syntax to ``test_grammar.py``.
6063

6164
* Certain changes may require tweaks to the library module :mod:`pyclbr`.
6265

63-
* :file:`Lib/tokenize.py` needs changes to match changes to the tokenizer.
66+
* :cpy-file:`Lib/tokenize.py` needs changes to match changes to the tokenizer.
6467

6568
* Documentation must be written! Specifically, one or more of the pages in
66-
:file:`Doc/reference/` will need to be updated.
69+
:cpy-file:`Doc/reference/` will need to be updated.

documentation/start-documenting.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ You can also use ``make help`` to see a list of targets supported by
101101
you submit a :ref:`pull request <pullrequest>`, so you should make
102102
sure that it runs without errors.
103103

104-
**On Windows**, a :file:`make.bat` batchfile tries to emulate :command:`make`
105-
as closely as possible, but the venv target is not implemented, so you will
106-
probably want to make sure you are working in a virtual environment before
107-
proceeding, otherwise all dependencies will be automatically installed on your
108-
system.
104+
**On Windows**, the :cpy-file:`Doc/make.bat` batchfile tries to emulate
105+
:command:`make` as closely as possible, but the venv target is not implemented,
106+
so you will probably want to make sure you are working in a virtual environment
107+
before proceeding, otherwise all dependencies will be automatically installed
108+
on your system.
109109

110110
When ready, run the following from the root of your :ref:`repository clone
111111
<checkout>` to build the output as HTML::
@@ -114,9 +114,9 @@ When ready, run the following from the root of your :ref:`repository clone
114114
make html
115115

116116
You can also use ``make help`` to see a list of targets supported by
117-
:file:`make.bat`.
117+
:cpy-file:`Doc/make.bat`.
118118

119-
See also :file:`Doc/README.rst` for more information.
119+
See also :cpy-file:`Doc/README.rst` for more information.
120120

121121
Using sphinx-build
122122
------------------

getting-started/git-boot-camp.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ Exclude generated files from diff by default::
274274
git config diff.generated.binary true
275275

276276
The ``generated`` `attribute <https://git-scm.com/docs/gitattributes>`_ is
277-
defined in :file:`.gitattributes`, found in the repository root.
277+
defined in :cpy-file:`.gitattributes`, found in the repository root.
278278

279279
.. _push-changes:
280280

0 commit comments

Comments
 (0)