Usage¶
In order to use buildenv tool features, please follow these instructions.
Project already configured with buildenv¶
Any project already using the buildenv tool has generated loading scripts in its root folder.
The typical project setup scenario with buildenv is:
clone the project –
git clone git@github.com:xxx/yyy.gitlaunch the loading script:
on Linux (or git bash):
./buildenv.shon Windows:
buildenv.cmd
build the project; the build environment (i.e. python venv + extensions) is now installed and loaded in your terminal
Install buildenv in a new/existing project¶
New projects¶
The buildenv install command can be used, with ad-hoc templates selection, in install to create a new project from scratch, with ready to use environment for the chosen project type.
The recommended install process is to run the command through an uvx command, including templates extensions.
As an example, in order to setup a new nmk Python project from scratch, you may simply execute the following command:
uvx --with nmk-python buildenv install -p /path/to/my/new/project
Migrate legacy buildenv projects¶
For project already using buildenv 1.X version, using the buildenv install command will:
upgrade the loading scripts for buildenv version 2
remove the legacy useless files from the project:
buildenv-loader.py: from version 2.0, there is no need for Python bootstrap code out of the venvbuildenv.cfg: from version 2.0, buildenv doesn’t need a configuration file system anymore.buildenvfolder: there are no more persistent activation scripts, all activation scripts are systematically regenerated each time buildenv is invokedrequirements.txt: if usinguvbackend, this file is now useless, since all dependencies are managed from thepyproject.tomlfile
Note
It is important to choose the backend when upgrading the scripts. You should run:
uvx buildenv install --backend uvfor Python projectsuvx buildenv install --backend uvxfor non-Python projects