|
| 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