|
2 | 2 |
|
3 | 3 | ## How to bootstrap a project with mxmake |
4 | 4 |
|
5 | | -Requirements: |
| 5 | +### Essential Requirements |
6 | 6 |
|
7 | | -- [`make`](https://www.gnu.org/software/make/) has to be installed. |
8 | | - This is usually done by your system's package manager - as `sudo apt install make` on Debian-/Ubuntu-based systems. |
9 | | -- `Python 3` has to be installed with the `venv` module. |
10 | | - Some system Python installations need extra action here - as `sudo apt install python-venv` on Debian-/Ubuntu-based systems. |
| 7 | +All installation methods require: |
| 8 | +- [`make`](https://www.gnu.org/software/make/) command-line tool |
| 9 | + - Ubuntu/Debian: `sudo apt install make` |
| 10 | + - macOS: `xcode-select --install` |
| 11 | + - Windows: [See installation guide](https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058#make) |
11 | 12 |
|
12 | | -Create a project folder and enter it: |
| 13 | +### Choose Your Installation Method |
13 | 14 |
|
| 15 | +mxmake supports two installation approaches: |
| 16 | + |
| 17 | +#### Option 1: UV-only (Modern, Recommended) |
| 18 | + |
| 19 | +**Requirements**: Only [UV](https://docs.astral.sh/uv/) - **NO Python installation needed!** |
| 20 | + |
| 21 | +UV automatically downloads Python when creating virtual environments, making it the simplest option for new projects. |
| 22 | + |
| 23 | +**Install UV**: |
| 24 | +```shell |
| 25 | +# Official installer (Linux/macOS) |
| 26 | +curl -LsSf https://astral.sh/uv/install.sh | sh |
| 27 | + |
| 28 | +# Or via pip (if you already have Python) |
| 29 | +pip install uv |
| 30 | +``` |
| 31 | + |
| 32 | +**Bootstrap your project**: |
14 | 33 | ```shell |
15 | | -mkdir myproject |
16 | | -cd myproject |
| 34 | +mkdir myproject && cd myproject |
| 35 | + |
| 36 | +# Run mxmake init (UV downloads Python automatically) |
| 37 | +uvx mxmake init |
| 38 | + |
| 39 | +# Answer prompts interactively or use --preseeds for automation |
| 40 | +# Select topics and configure settings |
| 41 | + |
| 42 | +# Run make install (UV creates venv with downloaded Python) |
| 43 | +make install |
17 | 44 | ``` |
18 | 45 |
|
19 | | -You can either install *mxmake* globally or in a virtual environment. |
| 46 | +**Key advantages**: |
| 47 | +- No Python pre-installation required |
| 48 | +- UV downloads the exact Python version you specify |
| 49 | +- Faster package installation |
| 50 | +- Ideal for CI/CD environments |
20 | 51 |
|
21 | | -For global installation do a `pip install mxmake`, otherwise create a virtual environment, activate it, and install it like so: |
| 52 | +```{note} |
| 53 | +When using UV, set `PYTHON_PACKAGE_INSTALLER=uv` and `UV_PYTHON=3.14` (or your preferred version) in the Makefile settings section. UV will automatically download and use that Python version. |
| 54 | +``` |
| 55 | + |
| 56 | +#### Option 2: Traditional pip-based |
22 | 57 |
|
| 58 | +**Requirements**: Python 3.10+ with venv module |
| 59 | +- Ubuntu/Debian: `sudo apt install python3 python3-venv` |
| 60 | +- macOS: Python 3.10+ from [python.org](https://www.python.org/downloads/) |
| 61 | +- Windows: Python 3.10+ from [python.org](https://www.python.org/downloads/windows/) |
| 62 | + |
| 63 | +**Install mxmake**: |
23 | 64 | ```shell |
| 65 | +mkdir myproject && cd myproject |
| 66 | + |
| 67 | +# Option A: Global installation |
| 68 | +pip install mxmake |
| 69 | + |
| 70 | +# Option B: In a virtual environment |
24 | 71 | python3 -m venv venv |
25 | | -. venv/bin/activate |
| 72 | +. venv/bin/activate # On Windows: venv\Scripts\activate |
26 | 73 | pip install mxmake |
27 | 74 | ``` |
28 | 75 |
|
29 | | -Now create an initial `Makefile` with *mxmake*: |
30 | | - |
| 76 | +**Bootstrap your project**: |
31 | 77 | ```shell |
32 | 78 | mxmake init |
| 79 | + |
| 80 | +# Answer prompts interactively |
| 81 | +# This creates mx.ini and Makefile |
| 82 | + |
| 83 | +make install |
33 | 84 | ``` |
34 | 85 |
|
35 | | -This is an interactive session and some questions are to be answered. |
36 | | -If in doubt select the `core` topic and then just hit {kbd}`Return` until done. |
| 86 | +### After Initialization |
37 | 87 |
|
38 | | -This creates an empty `mx.ini` (only if it does not exist already) and a `Makefile`. |
| 88 | +Both methods create: |
| 89 | +- `Makefile` - Generated by mxmake with your selected topics/domains |
| 90 | +- `mx.ini` - Configuration for mxdev (if you selected that option) |
39 | 91 |
|
40 | | -To update an existing Makefile without beeing prompted interactive, run `mxmake update`. |
| 92 | +To update an existing Makefile without interactive prompts, run `mxmake update`. |
41 | 93 |
|
42 | 94 | ## How to change the settings |
43 | 95 |
|
@@ -65,19 +117,39 @@ They will be lost on next `mxmake init` respective `mxmake update` run. |
65 | 117 |
|
66 | 118 | ### Python Package Installer |
67 | 119 |
|
68 | | -By default, mxmake uses `pip` as the package installer. You can switch to [UV](https://docs.astral.sh/uv/) by setting `PYTHON_PACKAGE_INSTALLER=uv` in the settings section. |
| 120 | +mxmake supports two package installers: |
69 | 121 |
|
70 | | -When using UV, mxmake automatically detects if UV is installed globally or installs it locally in the virtual environment. |
| 122 | +**UV (Recommended)**: Modern, fast package installer that can automatically download Python. |
| 123 | +- Set `PYTHON_PACKAGE_INSTALLER=uv` in the Makefile |
| 124 | +- UV is auto-detected if installed globally, or installed locally in the venv |
| 125 | +- **Specify `UV_PYTHON` explicitly** (e.g., `3.14`) to control which Python version UV downloads |
71 | 126 |
|
72 | | -```{note} |
73 | | -When using UV, you should explicitly set `UV_PYTHON` to specify which Python version UV should use. While `UV_PYTHON` currently defaults to `PRIMARY_PYTHON` for backward compatibility, this default may change in future versions. Set `UV_PYTHON` explicitly to avoid surprises. |
74 | | -``` |
| 127 | +**pip (Default)**: Traditional package installer, requires Python pre-installed. |
| 128 | +- Works with any Python 3.10+ installation |
| 129 | +- Uses the Python specified in `PRIMARY_PYTHON` setting |
75 | 130 |
|
76 | | -Example: |
| 131 | +Example UV configuration: |
77 | 132 | ```makefile |
78 | | -PRIMARY_PYTHON?=python3 |
79 | 133 | PYTHON_PACKAGE_INSTALLER?=uv |
80 | | -UV_PYTHON?=3.14 |
| 134 | +UV_PYTHON?=3.14 # UV downloads Python 3.14 automatically |
| 135 | +``` |
| 136 | +
|
| 137 | +Example pip configuration: |
| 138 | +```makefile |
| 139 | +PRIMARY_PYTHON?=python3.12 |
| 140 | +PYTHON_PACKAGE_INSTALLER?=pip # Default |
| 141 | +``` |
| 142 | +
|
| 143 | +```{important} |
| 144 | +When using UV, **always set `UV_PYTHON` explicitly**. While it currently defaults to `PRIMARY_PYTHON` for backward compatibility, relying on this default is not recommended and may change in future versions. |
| 145 | +``` |
| 146 | + |
| 147 | +```{note} |
| 148 | +With UV + `UV_PYTHON` explicitly set: |
| 149 | +- `PRIMARY_PYTHON` is **not needed** (only used as UV_PYTHON default) |
| 150 | +- `PYTHON_MIN_VERSION` is **not needed** (validation skipped with global UV) |
| 151 | +
|
| 152 | +These settings are **only required** for pip-based workflows. |
81 | 153 | ``` |
82 | 154 |
|
83 | 155 | ## How to use on the Windows operating system |
|
0 commit comments