Skip to content

Commit 6e19fd4

Browse files
committed
docs: improved documentation structure and rendering
- Fixed literalinclude rendering in customization.md with MyST colon_fence - Moved skip-constraints example to multiple-versions how-to guide - Updated conf.py: fixed typos, use dynamic copyright year, added MyST extension Signed-off-by: Martin Prpič <[email protected]>
1 parent 610cef6 commit 6e19fd4

File tree

4 files changed

+88
-68
lines changed

4 files changed

+88
-68
lines changed

docs/conf.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
1616

1717
project = "Fromager"
18-
copyright = "2024, Fromager Authors"
18+
copyright = "%Y, Fromager Authors"
1919
author = "Fromager Authors"
2020
release = metadata.version("fromager")
2121

@@ -30,14 +30,19 @@
3030
"sphinx.ext.intersphinx",
3131
]
3232

33+
# Enable MyST extensions to support reStructuredText directives in Markdown
34+
myst_enable_extensions = [
35+
"colon_fence",
36+
]
37+
3338
# Recognized suffixes
3439
source_suffix = {
3540
".rst": "restructuredtext",
3641
".md": "markdown",
3742
}
3843

3944
templates_path = ["_templates"]
40-
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "example"]
45+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
4146

4247
language = "English"
4348

@@ -67,7 +72,7 @@
6772

6873

6974
class FromagerHookDocumenter(FunctionDocumenter):
70-
"""Documenter for 'autofromagehook' directive"""
75+
"""Documenter for 'autofromagerhook' directive"""
7176

7277
objtype = "fromagerhook"
7378

@@ -79,7 +84,7 @@ def format_name(self):
7984

8085

8186
class PyFromagerHook(PyFunction):
82-
""":py:fromagehook"""
87+
""":py:fromagerhook"""
8388

8489
def handle_signature(self, sig: str, signode: desc_signature) -> tuple[str, str]:
8590
# hack to remove module prefix from output

docs/customization.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,17 @@ bootstrap requirements, such as:
154154
my-package @ git+https://github.com/example/[email protected]
155155
```
156156

157-
For example requirements with git URLs, see:
157+
Example requirements file with Git URLs:
158158

159-
.. literalinclude:: example/requirements-git-example.txt
160-
:caption: requirements-git-example.txt
159+
```{literalinclude} example/requirements-git-example.txt
160+
:caption: requirements-git-example.txt
161+
```
161162

162-
For a complete package configuration example, see:
163+
A complete package configuration example:
163164

164-
.. literalinclude:: example/git-submodules-example.yaml
165-
:caption: git-submodules-example.yaml
165+
```{literalinclude} example/git-submodules-example.yaml
166+
:caption: git-submodules-example.yaml
167+
```
166168

167169
### Build directory
168170

docs/example/skip-constraints-example.md

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

docs/how-tos/multiple-versions.rst

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,74 @@ Important Considerations
5757
The graph and build-sequence files can already handle multiple conflicting
5858
versions, so this change simply allows bypassing the final constraints
5959
validation step that ensures pip-compatibility.
60+
61+
Complete Example
62+
----------------
63+
64+
This example demonstrates a complete walkthrough of using the ``--skip-constraints``
65+
option to build wheel collections containing conflicting package versions.
66+
67+
Use Case
68+
~~~~~~~~
69+
70+
Suppose you need to build a package index that contains multiple versions of the
71+
same package for different downstream consumers. For example, you might want to
72+
include both Django 3.2 and Django 4.0 in your collection.
73+
74+
Requirements Files
75+
~~~~~~~~~~~~~~~~~~
76+
77+
Create a requirements file with conflicting versions:
78+
79+
**requirements-conflicting.txt**
80+
81+
.. code-block:: text
82+
83+
django==3.2.0
84+
django==4.0.0
85+
requests==2.28.0
86+
87+
Normally, this would fail with a conflict error because both Django versions
88+
cannot be installed together.
89+
90+
Running with --skip-constraints
91+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92+
93+
.. code-block:: bash
94+
95+
fromager bootstrap --skip-constraints \
96+
--sdists-repo ./sdists-repo \
97+
--wheels-repo ./wheels-repo \
98+
--work-dir ./work-dir \
99+
-r requirements-conflicting.txt
100+
101+
Expected Behavior
102+
~~~~~~~~~~~~~~~~~
103+
104+
1. **Success**: Both Django versions will be built successfully
105+
2. **Output Files**:
106+
107+
- ``build-order.json`` - Contains build order for all packages
108+
- ``graph.json`` - Contains dependency resolution graph
109+
- No ``constraints.txt`` file is generated
110+
111+
3. **Wheel Repository**: Contains wheels for both Django versions and their respective dependencies
112+
113+
Verification
114+
~~~~~~~~~~~~
115+
116+
Check that both versions were built:
117+
118+
.. code-block:: bash
119+
120+
find wheels-repo/downloads/ -name "Django-*.whl"
121+
# Expected output:
122+
# wheels-repo/downloads/Django-3.2.0-py3-none-any.whl
123+
# wheels-repo/downloads/Django-4.0.0-py3-none-any.whl
124+
125+
Verify no constraints file was created:
126+
127+
.. code-block:: bash
128+
129+
ls work-dir/constraints.txt
130+
# Expected: file does not exist

0 commit comments

Comments
 (0)