Skip to content

Commit 0ddf740

Browse files
committed
docs: add quick start guide
Add quickstart.rst with installation instructions and a simple stevedore example for new users. Update getting-started.rst to point new users to the quick start guide. Content adapted from the learning-fromager repository. Signed-off-by: shifa-khan shikhan@redhat.com Closes: #799
1 parent 5cf7ab8 commit 0ddf740

File tree

3 files changed

+88
-0
lines changed

3 files changed

+88
-0
lines changed

docs/getting-started.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Getting Started
22
===============
33

4+
.. note::
5+
6+
New to fromager? Start with :doc:`quickstart` for a simple first build.
7+
48
The basic process for using fromager to build a collection of wheels is
59

610
1. Make a list of the top-level dependencies (applications, extension libraries,

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ those special cases directly into fromager.
2727
:maxdepth: 2
2828

2929
using.md
30+
quickstart.rst
3031
getting-started.rst
3132
customization.md
3233
concepts/index.rst

docs/quickstart.rst

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
Quick Start
2+
===========
3+
4+
This guide gets you from zero to your first wheel build in under 5 minutes.
5+
6+
Prerequisites
7+
-------------
8+
9+
You'll need Python 3.11 or later and network access to download packages from PyPI.
10+
11+
Installation
12+
------------
13+
14+
Install fromager using pip:
15+
16+
.. code-block:: console
17+
18+
$ pip install fromager
19+
$ fromager --version
20+
fromager, version X.Y.Z
21+
22+
Your First Build
23+
----------------
24+
25+
Let's build a simple package and its dependencies from source. We'll use
26+
``stevedore``, a lightweight package with minimal dependencies.
27+
28+
Create a ``requirements.txt`` file with the package name:
29+
30+
.. code-block:: console
31+
32+
$ echo "stevedore" > requirements.txt
33+
34+
Run the bootstrap command:
35+
36+
.. code-block:: console
37+
38+
$ fromager bootstrap -r requirements.txt
39+
40+
primary settings file: overrides/settings.yaml
41+
per-package settings dir: overrides/settings
42+
variant: cpu
43+
...
44+
100%|████████████████████████████████████████| 3/3 [00:08<00:00, 2.67s/pkg]
45+
writing installation dependencies to ./work-dir/constraints.txt
46+
47+
Check your results:
48+
49+
.. code-block:: console
50+
51+
$ ls wheels-repo/downloads/
52+
pbr-6.1.0-0-py2.py3-none-any.whl
53+
setuptools-75.1.0-0-py3-none-any.whl
54+
stevedore-5.3.0-0-py3-none-any.whl
55+
56+
You've built ``stevedore`` and its dependencies (``pbr``, ``setuptools``)
57+
entirely from source. Fromager downloaded the source distributions from PyPI,
58+
figured out the build and runtime dependencies, built each package in the
59+
correct order, and created wheels in ``wheels-repo/downloads/``.
60+
61+
For a detailed explanation of the output files and directories, see
62+
:doc:`files`.
63+
64+
Pinning Versions with Constraints
65+
---------------------------------
66+
67+
For reproducible builds, use a constraints file to pin specific versions:
68+
69+
.. code-block:: console
70+
71+
$ echo "stevedore==5.3.0" > constraints.txt
72+
$ fromager -c constraints.txt bootstrap -r requirements.txt
73+
74+
The ``-c`` option ensures fromager uses exactly the versions you specify.
75+
76+
Next Steps
77+
----------
78+
79+
Now that you've seen fromager work with a simple package, you might want to:
80+
81+
* Learn to debug build failures with a more complex example in :doc:`getting-started`
82+
* Customize builds with settings, patches, and variants in :doc:`customization`
83+
* Check specific guides in :doc:`how-tos/index`

0 commit comments

Comments
 (0)