Package: qgis-venv-creator
QGIS Venv CreatorSingle file and zero dependency tool to create a Python virtual environment for QGIS plugin development.Table of ContentsInstallationUsageDevelopmentLicenseInstallationThe recommended way to installqgis-venv-creator(and other Python cli tools) is to install it withpipx. Pipx will install the application in an isolated environment and make it available as a command line utility. To installpipx, follow the instructions provided athttps://github.com/pypa/pipx#install-pipx.$pipxinstallqgis-venv-creatorAlternatively, to install in your current Python environment:$pipinstallqgis-venv-creatorCopy as a scriptqgis-venv-creatoris a single Python script that can be downloaded and copied to your project root, or any other location from which you wish to use it.UsageQuick startOn your plugin root directory, run:$create-qgis-venvNote:If you have copied the script file to your project root, you can run it withpython create-qgis-venv.py.On a system where there might be multiple QGIS installations (ie. Windows, MacOs), you are asked to select the one you want to use for development.After the virtual environment is created, you can activate it and it will have access to the QGIS Python environment.Optionscreate-qgis-venv [-h] [--venv-parent VENV_PARENT] [--venv-name VENV_NAME]
                    [--qgis-installation QGIS_INSTALLATION]
                    [--qgis-installation-search-path-pattern QGIS_INSTALLATION_SEARCH_PATH_PATTERN]
                    [--python-executable PYTHON_EXECUTABLE] [--debug]OptionAvailable on platformDescription-h, --helpALLShow this help message and exit--venv-parentALLPath to the parent directory of the virtual environment to be created. Most likely your project directory. Default current directory.--venv-nameALLName of the virtual environment--qgis-installationWindowsPath to the QGIS installation to use for development. Installations made with official msi and Osgeo4W installers are supported. Give the path to the 'qgis' directory inside the 'apps' directory. If not given, the user is prompted to select one.--qgis-installation-search-path-patternWindowsCustom glob pattern for QGIS installations to be selected. Can be set also with environment variable QGIS_INSTALLATION_SEARCH_PATH_PATTERN. For example "C:\qgis\*\apps\qgis*\" to find installations from "C:\qgis\3.32\apps\qgis\" and "C:\qgis\3.28\apps\qgis-ltr\"--python-executableWindowsPath to the Python executable used by the QGIS installation. If not given, the Python executable is searched from the QGIS installation.--debugALLEnable debug loggingDevelopmentThis project usesHatchfor development and packaging. Install instructions can be found at the project's websitehttps://hatch.pypa.io/latest/install.To facilitate development with VS Code, it is recommended to create hatch environments in the project folder. You can configure hatch to do so by running:hatch config set dirs.env.virtual ".hatch"After Hatch has created the environment, you can set your Python interpreter to use the one located in.hatch/qgis-venv-creator.Pre-commit hookThis project usespre-committo run code checks and tests before committing. You can install pre-commit with:pipx install pre-commitInstall pre-commit hooks to your repo with:pre-commit installLicenseqgis-venv-creatoris distributed under the terms of theMITlicense.