Improve the developer bootstrap docs
This commit is contained in:
parent
c41ac9cd83
commit
a3854531da
23
README.md
23
README.md
|
@ -214,20 +214,17 @@ The rootfs image `jlmkr.py` downloads comes from the [Linux Containers Image ser
|
|||
|
||||
## Development
|
||||
|
||||
After cloning the project, navigate into its working directory and create a self-contained Python [virtual environment](https://packaging.python.org/en/latest/tutorials/installing-packages/#creating-and-using-virtual-environments).
|
||||
After cloning the project, navigate into its working directory and create a self-contained Python [virtual environment](https://packaging.python.org/en/latest/tutorials/installing-packages/#creating-and-using-virtual-environments). Traditionally you would do that using the following command. Unfortunately, TrueNAS SCALE has [left out](https://ixsystems.atlassian.net/browse/NAS-130029) a necessary library from the base installation and *this command will fail:*
|
||||
|
||||
python3 -m venv --no-setuptools .venv
|
||||
python3 -m venv .venv
|
||||
|
||||
> *Note: Due to [NAS-130029](https://ixsystems.atlassian.net/browse/NAS-130029), the user's safe working Python environment can only be bootstrapped from TrueNAS SCALE's [developer mode](https://www.truenas.com/docs/scale/scaletutorials/systemsettings/advanced/developermode/), or in a jail or elsewhere. If you like to take long walks with strangers, the following might suffice as an alternative to the above one-liner.*
|
||||
>
|
||||
> ```
|
||||
> curl -L https://github.com/brettcannon/microvenv/archive/refs/tags/v2023.5.tar.gz | tar xz --strip-components=1 microvenv-2023.5/microvenv
|
||||
> python3 -m microvenv
|
||||
> curl -OL https://bootstrap.pypa.io/pip/pip.pyz
|
||||
> .venv/bin/python3 pip.pyz install virtualenv
|
||||
> .venv/bin/virtualenv --no-setuptools .venv
|
||||
> rm -rf microvenv pip.pyz
|
||||
> ```
|
||||
The following workaround should accomplish the same task in more steps.
|
||||
```
|
||||
python3 -m venv --without-pip .venv
|
||||
curl -OL https://bootstrap.pypa.io/pip/pip.pyz
|
||||
.venv/bin/python3 pip.pyz install pip
|
||||
rm pip.pyz
|
||||
```
|
||||
*Note: This process and the resulting build environment will cache some items under `~/.local/share` in addition to the project directory.*
|
||||
|
||||
Activate the venv into your *current* shell session.
|
||||
|
@ -242,7 +239,7 @@ For more information on Python standard venvs, go to [the source](https://packag
|
|||
|
||||
### Hatching a build
|
||||
|
||||
While in an *active* session, install the [Hatch](https://hatch.pypa.io) project manager. This will load quite a flurry of dependencies, but will only do so into the new `.venv` directory.
|
||||
While in an *active* session, install the [Hatch](https://hatch.pypa.io) project manager. This will load quite a flurry of dependencies, but will only do so into the new `.venv` directory. *(And a bit into self-managed directories under `~/.local/share`.)*
|
||||
|
||||
pip install hatch
|
||||
|
||||
|
|
Loading…
Reference in New Issue