@@ -5,7 +5,7 @@ Configuration
55autopypath can be configured in several ways to suit different project structures
66and user preferences. The configuration sources include:
77
8- - Configuration files: `autopypath.toml ` and `pyproject.toml `.
8+ - Configuration files: `` autopypath.toml `` and `` pyproject.toml ` `.
99- Function parameters: Directly passing configuration options to the `configure_pypath() ` function.
1010- Default settings: Built-in defaults used when no other configuration is provided.
1111
@@ -16,9 +16,9 @@ By default, autopypath identifies the repository root by looking for specific
1616marker files or directories. The default markers are:
1717
1818- ``autopypath.toml ``: A configuration file that can specify custom repository
19- root markers in addition to other settings. Only the first autopypath.toml file
20- found when searching upwards from the starting directory is used. Additional autopypath.toml files
21- found higher up the directory tree are ignored.
19+ root markers in addition to other settings. Only the first `` autopypath.toml `` file
20+ found when searching upwards from the starting directory is used. Additional
21+ `` autopypath.toml `` files found higher up the directory tree are ignored.
2222- ``pyproject.toml ``: A common project configuration file that can also
2323 contain autopypath settings.
2424- ``.git ``: Indicates a Git repository root by the presence of this directory.
@@ -34,10 +34,10 @@ root of the repository. Autopypath searches upwards from the starting directory
3434until it finds one of these markers.
3535
3636It is possible to customize the repository root markers by providing a
37- list of marker names to the `repo_markers ` parameter of the `configure_pypath() `
38- function or by specifying them in the `autopypath.toml ` configuration file.
37+ list of marker names to the `` repo_markers `` parameter of the `` configure_pypath() ` `
38+ function or by specifying them in the `` autopypath.toml ` ` configuration file.
3939
40- Example of customizing repository root markers in `autopypath.toml ` or `pyproject.toml `:
40+ Example of customizing repository root markers in `` autopypath.toml `` or `` pyproject.toml ` `:
4141
4242.. code-block :: toml
4343
@@ -48,73 +48,73 @@ Example of customizing repository root markers in `autopypath.toml` or `pyprojec
4848 Load Strategy
4949=============
5050
51- Load Strategy determines how found paths are added to `sys.path `. The default
52- strategy is `prepend `, but it can be customized using the `load_strategy ` parameter
53- to `configure_pypath() ` or configured in `pyproject.toml`` file in the repository root, or in
54- an `autopypath.toml ` file.
51+ Load Strategy determines how found paths are added to :data: `sys.path `. The default
52+ strategy is `` prepend `` , but it can be customized using the `` load_strategy ` ` parameter
53+ to `configure_pypath() ` or configured in `` pyproject.toml `` file in the repository root, or in
54+ an `` autopypath.toml ` ` file.
5555
5656The available load strategies are:
5757
5858prepend
5959-------
6060
61- `prepend ` adds merged found paths to the start of `sys.path `
61+ `` prepend `` adds merged found paths to the start of :data: `sys.path `
6262in precedence resolution ordered from highest to lowest. This ensures that
6363modules in the repository take precedence over globally installed modules.
6464
65- prepend_highest_only
65+ prepend_highest_priority
6666--------------------
6767
68- `prepend_highest_only ` adds only the highest precedence found path to the start of `sys.path `.
68+ `` prepend_highest_priority `` adds only the highest precedence found path to the start of :data: `sys.path `.
6969This is useful when you want to ensure that only the most relevant path is used.
7070
7171replace
7272-------
7373
74- `replace ` clears `sys.path ` and adds only the found paths. This is useful for isolated environments
74+ `` replace `` clears :data: `sys.path ` and adds only the found paths. This is useful for isolated environments
7575where you want to avoid any interference from globally installed modules. This
7676is a highly advanced use case and should be used with **extreme ** caution as it will remove all
77- other paths from `sys.path ` - including standard library paths.
77+ other paths from :data: `sys.path ` - including standard library paths.
7878
7979.. warning ::
8080
8181 This **WILL ** break many Python functionalities and is in the category of "if you don't know why you need it,
8282 you don't need it". Expert users only!
8383
84- The load strategy can be set in either `pyproject.toml ` or `autopypath.toml ` like this:
84+ The load strategy can be set in either `` pyproject.toml `` or `` autopypath.toml ` ` like this:
8585
8686.. code-block :: toml
8787 :caption: pyproject.toml or autopypath.toml
8888
8989 [tool.autopypath]
90- load_strategy = "prepend" # or "prepend_highest_only " or "replace"
90+ load_strategy = "prepend" # or "prepend_highest_priority " or "replace"
9191
9292 Paths
9393=====
9494
95- By default, autopypath adds several common project directories to `sys.path `
95+ By default, autopypath adds several common project directories to :data: `sys.path `
9696relative to the repository root. These default paths are intended to cover
9797the most common project layouts. The default paths, in order of priority, are:
9898
99- - `src `: Common source directory for project code.
100- - `tests `: Common source directory for test code.
101- - `lib `: Common source directory for library code.
102- - `src/test `: Alternate test source directory.
99+ - `` src ` `: Common source directory for project code.
100+ - `` tests ` `: Common source directory for test code.
101+ - `` lib ` `: Common source directory for library code.
102+ - `` src/test ` `: Alternate test source directory.
103103
104104These directories are added to :data: `sys.path ` if they exist in the repository root -
105105but only if no other paths are provided.
106106
107- You can customize the paths added to `sys.path ` using the `paths ` parameter
108- to `configure_pypath() `, in a `pyproject.toml `, or a `autopypath.toml ` file
109- in the `[tool.autopypath] ` section.
107+ You can customize the paths added to :data: `sys.path ` using the `` paths ` ` parameter
108+ to `configure_pypath() `, in a `` pyproject.toml `` , or a `` autopypath.toml ` ` file
109+ in the `` [tool.autopypath] ` ` section.
110110
111111This is just the 'out-of-the-box' default configuration and is intended to cover
112112the most common project layouts. You can (and **should **) customize it as needed for your project.
113113
114114
115115If a configured path does not exist or is not a directory, it will be logged at 'INFO' level and skipped.
116116
117- In either `pyproject.toml ` or `autopypath.toml `, the configuration for paths looks like this:
117+ In either `` pyproject.toml `` or `` autopypath.toml ` `, the configuration for paths looks like this:
118118
119119.. code-block :: toml
120120
@@ -125,28 +125,27 @@ Path Resolution Order
125125=====================
126126
127127The order in which autopypath resolves paths can be customized using the
128- `path_resolution_order ` parameter to `configure_pypath() ` or in a
129- `pyproject.toml ` or `autopypath.toml ` file. This setting determines the sequence
130- of configuration sources that autopypath checks for paths to add to `sys.path `.
128+ `` path_resolution_order ` ` parameter to `configure_pypath() ` or in a
129+ `` pyproject.toml `` or `` autopypath.toml ` ` file. This setting determines the sequence
130+ of configuration sources that autopypath checks for paths to add to :data: `sys.path `.
131131
132132The available sources are:
133133
134- - `manual `: Paths provided directly via the `paths ` parameter to `configure_pypath() `.
135- - `autopypath `: Paths specified in `autopypath.toml ` configuration files.
136- - `pyproject `: Paths specified in `pyproject.toml ` configuration files.
134+ - `` manual `` : Paths provided directly via the `` paths ` ` parameter to `configure_pypath() `.
135+ - `` autopypath `` : Paths specified in `` autopypath.toml ` ` configuration files.
136+ - `` pyproject `` : Paths specified in `` pyproject.toml ` ` configuration files.
137137
138- The default resolution order is `['manual', 'autopypath', 'pyproject'] `, meaning
139- that manually provided paths take precedence over those specified in `autopypath.toml `,
140- which in turn take precedence over those in `pyproject.toml `. '
138+ The default resolution order is `` ['manual', 'autopypath', 'pyproject'] ` `, meaning
139+ that manually provided paths take precedence over those specified in `` autopypath.toml ` `,
140+ which in turn take precedence over those in `` pyproject.toml ``.
141141
142- This primarily affect the order in which paths are added to `sys.path ` when using
143- the `prepend ` load strategy.
142+ This primarily affects the order in which paths are added to :data: `sys.path ` when using
143+ the `` prepend ` ` load strategy.
144144
145- In either `pyproject.toml ` or `autopypath.toml `, the configuration for path resolution
145+ In either `` pyproject.toml `` or `` autopypath.toml ` `, the configuration for path resolution
146146order looks like this:
147147
148148.. code-block :: toml
149149
150150 [tool.autopypath]
151151 path_resolution_order = ["manual", "autopypath", "pyproject"]
152-
0 commit comments