From 458b086468592ada000d0757e4ae36f6c82176c1 Mon Sep 17 00:00:00 2001 From: "Celestial.y" Date: Wed, 8 Oct 2025 04:17:15 +0800 Subject: [PATCH 1/9] Update 1.install-deps-selector.sh --- scriptdata/step/1.install-deps-selector.sh | Bin 6088 -> 6099 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/scriptdata/step/1.install-deps-selector.sh b/scriptdata/step/1.install-deps-selector.sh index 881fc04a1c8db646cbb3a3a7158dacd7832895f7..e0d420ac3fb9965bab80d602ba1833c92b1ad7e6 100644 GIT binary patch delta 38 scmX@1e_5ZAVFNpxa6w{eaVnPr5LjDtr4}b9b8$@;WE0-3%(hez0MFJ5@&Et; delta 13 Ucmcbte?osFBRkt>A-02p03&DwRsaA1 From aa9b1c333131a265c83c3163900b23eab7e8d02d Mon Sep 17 00:00:00 2001 From: clsty Date: Wed, 8 Oct 2025 05:53:41 +0800 Subject: [PATCH 2/9] Fix weird character causing git take it as binary --- scriptdata/step/1.install-deps-selector.sh | Bin 6099 -> 6098 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/scriptdata/step/1.install-deps-selector.sh b/scriptdata/step/1.install-deps-selector.sh index e0d420ac3fb9965bab80d602ba1833c92b1ad7e6..8ff67ff0a851307e5f36000884d4073972661dee 100644 GIT binary patch delta 8 Pcmcbte@TBM<0Wwb5<&x? delta 9 Qcmcble_5ZAVZ$YH027h}o&W#< From 1fc4b88784dfeac3a13a99d5dc226b35c6e5503b Mon Sep 17 00:00:00 2001 From: clsty Date: Wed, 8 Oct 2025 05:56:05 +0800 Subject: [PATCH 3/9] Update comment --- scriptdata/step/1.install-deps-selector.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scriptdata/step/1.install-deps-selector.sh b/scriptdata/step/1.install-deps-selector.sh index 8ff67ff0a..34dbe1d1a 100644 --- a/scriptdata/step/1.install-deps-selector.sh +++ b/scriptdata/step/1.install-deps-selector.sh @@ -2,7 +2,7 @@ # It's not for directly running. function outdate_detect(){ - # Shallow clone makes latest_commit_timestamp() not worky. + # Shallow clone prevent latest_commit_timestamp() from working. git_auto_unshallow local source_path="$1" From a4c2bf31c71ece500f9432c0a48f9ffef6d7ed26 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Wed, 8 Oct 2025 10:01:20 +0200 Subject: [PATCH 4/9] use python venv for opencv python scripts (#2143) --- .config/quickshell/ii/modules/background/Background.qml | 2 +- .config/quickshell/ii/screenshot.qml | 2 +- .config/quickshell/ii/scripts/images/find-regions-venv.sh | 6 ++++++ .config/quickshell/ii/scripts/images/find_regions.py | 2 +- .../quickshell/ii/scripts/images/least-busy-region-venv.sh | 6 ++++++ dist-arch/illogical-impulse-python/PKGBUILD | 1 - scriptdata/uv/requirements.in | 2 ++ scriptdata/uv/requirements.txt | 4 ++++ 8 files changed, 21 insertions(+), 4 deletions(-) create mode 100755 .config/quickshell/ii/scripts/images/find-regions-venv.sh create mode 100755 .config/quickshell/ii/scripts/images/least-busy-region-venv.sh diff --git a/.config/quickshell/ii/modules/background/Background.qml b/.config/quickshell/ii/modules/background/Background.qml index f354cf6b9..d7c50b74b 100644 --- a/.config/quickshell/ii/modules/background/Background.qml +++ b/.config/quickshell/ii/modules/background/Background.qml @@ -152,7 +152,7 @@ Variants { property int contentHeight: 300 property int horizontalPadding: bgRoot.movableXSpace property int verticalPadding: bgRoot.movableYSpace - command: [Quickshell.shellPath("scripts/images/least_busy_region.py"), "--screen-width", Math.round(bgRoot.screen.width / bgRoot.effectiveWallpaperScale), "--screen-height", Math.round(bgRoot.screen.height / bgRoot.effectiveWallpaperScale), "--width", contentWidth, "--height", contentHeight, "--horizontal-padding", horizontalPadding, "--vertical-padding", verticalPadding, path + command: [Quickshell.shellPath("scripts/images/least-busy-region-venv.sh"), "--screen-width", Math.round(bgRoot.screen.width / bgRoot.effectiveWallpaperScale), "--screen-height", Math.round(bgRoot.screen.height / bgRoot.effectiveWallpaperScale), "--width", contentWidth, "--height", contentHeight, "--horizontal-padding", horizontalPadding, "--vertical-padding", verticalPadding, path // "--visual-output", ,] stdout: StdioCollector { diff --git a/.config/quickshell/ii/screenshot.qml b/.config/quickshell/ii/screenshot.qml index 13e07bb5e..7f3d5d4ef 100644 --- a/.config/quickshell/ii/screenshot.qml +++ b/.config/quickshell/ii/screenshot.qml @@ -307,7 +307,7 @@ ShellRoot { Process { id: imageDetectionProcess - command: ["bash", "-c", `${Directories.scriptPath}/images/find_regions.py ` + command: ["bash", "-c", `${Directories.scriptPath}/images/find-regions-venv.sh ` + `--hyprctl ` + `--image '${StringUtils.shellSingleQuoteEscape(panelWindow.screenshotPath)}' ` + `--max-width ${Math.round(panelWindow.screen.width * root.falsePositivePreventionRatio)} ` diff --git a/.config/quickshell/ii/scripts/images/find-regions-venv.sh b/.config/quickshell/ii/scripts/images/find-regions-venv.sh new file mode 100755 index 000000000..8064256cb --- /dev/null +++ b/.config/quickshell/ii/scripts/images/find-regions-venv.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +source $(eval echo $ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate +"$SCRIPT_DIR/find_regions.py" "$@" + diff --git a/.config/quickshell/ii/scripts/images/find_regions.py b/.config/quickshell/ii/scripts/images/find_regions.py index e5aa29341..fe68a4dbe 100755 --- a/.config/quickshell/ii/scripts/images/find_regions.py +++ b/.config/quickshell/ii/scripts/images/find_regions.py @@ -1,4 +1,4 @@ -#!/usr/bin/env -S\_/bin/sh\_-c\_"source\_\$(eval\_echo\_\$ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate&&exec\_python\_-E\_"\$0"\_"\$@"" +#!/usr/bin/env python3 import argparse import cv2 diff --git a/.config/quickshell/ii/scripts/images/least-busy-region-venv.sh b/.config/quickshell/ii/scripts/images/least-busy-region-venv.sh new file mode 100755 index 000000000..c45e9ee04 --- /dev/null +++ b/.config/quickshell/ii/scripts/images/least-busy-region-venv.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +source $(eval echo $ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate +"$SCRIPT_DIR/least_busy_region.py" "$@" + diff --git a/dist-arch/illogical-impulse-python/PKGBUILD b/dist-arch/illogical-impulse-python/PKGBUILD index d9c6caa55..fc1ac1e05 100644 --- a/dist-arch/illogical-impulse-python/PKGBUILD +++ b/dist-arch/illogical-impulse-python/PKGBUILD @@ -13,5 +13,4 @@ depends=( libportal-gtk4 gobject-introspection sassc - python-opencv ) diff --git a/scriptdata/uv/requirements.in b/scriptdata/uv/requirements.in index 333230580..277a461cb 100644 --- a/scriptdata/uv/requirements.in +++ b/scriptdata/uv/requirements.in @@ -14,3 +14,5 @@ loguru pycairo pygobject tqdm +numpy +opencv-contrib-python diff --git a/scriptdata/uv/requirements.txt b/scriptdata/uv/requirements.txt index 05f9c671a..348b39b5d 100644 --- a/scriptdata/uv/requirements.txt +++ b/scriptdata/uv/requirements.txt @@ -22,8 +22,12 @@ materialyoucolor==2.0.10 # kde-material-you-colors numpy==2.2.2 # via + # -r scriptdata/uv/requirements.in # kde-material-you-colors # material-color-utilities + # opencv-contrib-python +opencv-contrib-python==4.12.0.88 + # via -r scriptdata/uv/requirements.in packaging==24.2 # via # build From c412090dbc3f8c80539b2775459d3e6976236a10 Mon Sep 17 00:00:00 2001 From: "Celestial.y" Date: Wed, 8 Oct 2025 22:25:47 +0800 Subject: [PATCH 5/9] Update scriptdata/uv/README.md --- scriptdata/uv/README.md | 102 +++++++++++++++++++++++++++++++++------- 1 file changed, 84 insertions(+), 18 deletions(-) diff --git a/scriptdata/uv/README.md b/scriptdata/uv/README.md index af2fc817c..444290981 100644 --- a/scriptdata/uv/README.md +++ b/scriptdata/uv/README.md @@ -7,17 +7,19 @@ This is important because there has been so many complaints about the failure in 1. Edit `requirements.in`. You may refer to [PyPI](https://pypi.org/) for possible package names. - See also [uv doc](https://docs.astral.sh/uv/pip/dependencies/#using-requirementsin). -2. Run `uv pip compile requirements.in -o requirements.txt` in this folder. +2. Run `uv pip compile requirements.in -o requirements.txt` in this folder.[^1] + +[^1]: `requirements.txt` is included in git repo. It's for locking package versions to enhance stability and reproducibility. In fact, including package version lock file in git repo is also common in other places, for example the `package-lock.json` of Node.js projects. See [this stackoverflow question](https://stackoverflow.com/questions/48524417/should-the-package-lock-json-file-be-added-to-gitignore) for a deeper explanation. ## How will the python packages get installed? - They will be installed to the virtual environment `$ILLOGICAL_IMPULSE_VIRTUAL_ENV`. - The default value of `$ILLOGICAL_IMPULSE_VIRTUAL_ENV` is `$XDG_STATE_HOME/quickshell/.venv`. - The default value of `$XDG_STATE_HOME` is `$HOME/.local/state`. - - Currently we use `env = ILLOGICAL_IMPULSE_VIRTUAL_ENV, ~/.local/state/quickshell/.venv` in `~/.config/hypr/hyprland/env.conf` to set this environment variable.[^1] + - Currently we use `env = ILLOGICAL_IMPULSE_VIRTUAL_ENV, ~/.local/state/quickshell/.venv` in `~/.config/hypr/hyprland/env.conf` to set this environment variable.[^2] - See the function `install-python-packages()` defined in `/scriptdata/lib/package-installers.sh` for details. -[^1]: Hyprland seems to have weird problem dealing with recursive variable, so we can not use `$XDG_STATE_HOME/quickshell/.venv` even if we had set `$XDG_STATE_HOME` to `~/.local/state` explicitly, else `$XDG_STATE_HOME` will possibly not get expanded but get recognised as literally `$XDG_STATE_HOME`. This problem never happens for some users, but according to some issues when we were using recursive variable setting in the past, it's possible to happen for other users. Reason unknown. +[^2]: Hyprland seems to have weird problem dealing with recursive variable, so we can not use `$XDG_STATE_HOME/quickshell/.venv` even if we had set `$XDG_STATE_HOME` to `~/.local/state` explicitly, else `$XDG_STATE_HOME` will possibly not get expanded but get recognised as literally `$XDG_STATE_HOME`. This problem never happens for some users, but according to some issues when we were using recursive variable setting in the past, it's possible to happen for other users. Reason unknown. ## How to use the python packages installed through here? @@ -25,21 +27,84 @@ Basically you'll need to activate the virtual environment first: ```bash source $(eval echo $ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate ``` -then use the python package inside it; + +It will add the python executable located in the venv to `$PATH` and give it the highest priority. +Run `which python` and you'll understand. + +This python executable will also search and use the python package inside the venv, +which enables running any python script or running command provided via python package using the venv. + After that you probably need to deactivate it: ```bash deactivate ``` -### Situation 1: Call the command directly -Take `kde-material-you-colors` as example. + +### Situation 1: As a single command +**Description:** At someplace which accept a single command, +- run a python script, +- or run a command provided by python package. + +Example: In `~/‎.config/quickshell/ii/screenshot.qml`: +```qml +Process { +id: imageDetectionProcess + command: ["bash", "-c", `${Directories.scriptPath}/images/find_regions.py ` + command: ["bash", "-c", `${Directories.scriptPath}/images/find-regions-venv.sh ` ++ `--hyprctl ` ++ `--image '${StringUtils.shellSingleQuoteEscape(panelWindow.screenshotPath)}' ` ++ `--max-width ${Math.round(panelWindow.screen.width * root.falsePositivePreventionRatio)} ` +``` +In this example, python script `${Directories.scriptPath}/images/find_regions.py` is called and receives some arguments. + +#### Solution A: shebang + +Add the shebang below to the beginning of python script: +```python +#!/usr/bin/env -S\_/bin/sh\_-c\_"source\_\$(eval\_echo\_\$ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate&&exec\_python\_-E\_"\$0"\_"\$@"" +``` +And that's it! + +**Note:** This is the simplest solution as it only modifies the shebang of python script. +However: +- It's only for python script, not the command provided by python package. + - P.S. Run the script directly, eg. `./foo.py`, not `python3 foo.py`, or the shebang will be ignored. +- It can not deal with complex argument (e.g. filaname containing spaces) passed to the python script. + - The example above is actually unstable, considering that `--image '${StringUtils.shellSingleQuoteEscape(panelWindow.screenshotPath)}'` could be a rather complex argument. + +#### Solution B: bash script as wrapper + +For this solution, first make sure the python script is using the shebang `#!/usr/bin/env python3`. + +Write a wrapper script in bash. +(Take `find_regions.py` as example, write `find-regions-venv.sh` in the same directory.) ```bash -source "$(eval echo $ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate" -kde-material-you-colors "$mode_flag" --color "$color" -sv "$sv_num" +#!/usr/bin/env bash + +# Specify the path of the python script. +# The example below only applies when `find_regions.py` and the wrapper script are under the same folder. +PY_SCRIPT="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)/find_regions.py" + +source $(eval echo $ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate +"$PY_SCRIPT" "$@" deactivate ``` -### Situation 2: Use python script (wrapped) -Take `generate_colors_material.py` as example: +### Situation 2: Inside a bash script +Note: the solutions for `Situation 1: As a single command` also apply here; but **not** vice versa. + +**Description:** +Inside a bash script, +- run a python script, +- or run a command provided by python package. + +**Solution:** +- Add "activation command" before the target line, +- Also add "deactivation command" after the target line. + +**Example:** + +For running a python script, +take `generate_colors_material.py` as example: ```bash source "$(eval echo $ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate" python3 "$SCRIPT_DIR/generate_colors_material.py" "${generate_colors_material_args[@]}" \ @@ -47,12 +112,13 @@ python3 "$SCRIPT_DIR/generate_colors_material.py" "${generate_colors_material_ar "$SCRIPT_DIR"/applycolor.sh ``` -### Situation 3: Use python script (shebang) -**Note**: This method is only for simple situation. -It can not deal with complex arguments (e.g. filaname containing spaces) passed to the python script. - -Take `generate_colors_material.py` as example, add the shebang below to its beginning: -```python -#!/usr/bin/env -S\_/bin/sh\_-c\_"source\_\$(eval\_echo\_\$ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate&&exec\_python\_-E\_"\$0"\_"\$@"" +For running a python script provided by python package, +take `kde-material-you-colors` as example: +```bash +source "$(eval echo $ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate" +kde-material-you-colors "$mode_flag" --color "$color" -sv "$sv_num" +deactivate ``` -Then you should run the script directly, i.e. `./generate_colors_material.py`, **not** `python3 generate_colors_material.py`. + + + From 26bab59886c5e38179b82bcde83091829dae4822 Mon Sep 17 00:00:00 2001 From: "Celestial.y" Date: Wed, 8 Oct 2025 22:43:15 +0800 Subject: [PATCH 6/9] Fix example in scriptdata/uv/README.md --- scriptdata/uv/README.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/scriptdata/uv/README.md b/scriptdata/uv/README.md index 444290981..dab4579cd 100644 --- a/scriptdata/uv/README.md +++ b/scriptdata/uv/README.md @@ -49,12 +49,11 @@ Example: In `~/‎.config/quickshell/ii/screenshot.qml`: Process { id: imageDetectionProcess command: ["bash", "-c", `${Directories.scriptPath}/images/find_regions.py ` - command: ["bash", "-c", `${Directories.scriptPath}/images/find-regions-venv.sh ` + `--hyprctl ` + `--image '${StringUtils.shellSingleQuoteEscape(panelWindow.screenshotPath)}' ` + `--max-width ${Math.round(panelWindow.screen.width * root.falsePositivePreventionRatio)} ` ``` -In this example, python script `${Directories.scriptPath}/images/find_regions.py` is called and receives some arguments. +In this example, python script `find_regions.py` is called and receives some arguments. #### Solution A: shebang @@ -73,21 +72,31 @@ However: #### Solution B: bash script as wrapper -For this solution, first make sure the python script is using the shebang `#!/usr/bin/env python3`. +First make sure the python script is using the shebang `#!/usr/bin/env python3`, instead of `#!/usr/bin/python3` or something else. -Write a wrapper script in bash. -(Take `find_regions.py` as example, write `find-regions-venv.sh` in the same directory.) +Then write a wrapper script in bash. +Let's continue the `screenshot.qml` example, in the same directory as `find_regions.py`, write a `find-regions-venv.sh`: ```bash #!/usr/bin/env bash # Specify the path of the python script. -# The example below only applies when `find_regions.py` and the wrapper script are under the same folder. +# The example below only applies when `find_regions.py` and this wrapper script are under the same folder. PY_SCRIPT="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)/find_regions.py" source $(eval echo $ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate "$PY_SCRIPT" "$@" deactivate ``` +**Not done yet!** Do not forget to update the code calling the original python script. +In this example, in `~/‎.config/quickshell/ii/screenshot.qml` we should modify `find_regions.py` to the wrapper script `find-regions-venv.sh`: +```qml +Process { +id: imageDetectionProcess + command: ["bash", "-c", `${Directories.scriptPath}/images/find-regions-venv.sh ` ++ `--hyprctl ` ++ `--image '${StringUtils.shellSingleQuoteEscape(panelWindow.screenshotPath)}' ` ++ `--max-width ${Math.round(panelWindow.screen.width * root.falsePositivePreventionRatio)} ` +``` ### Situation 2: Inside a bash script Note: the solutions for `Situation 1: As a single command` also apply here; but **not** vice versa. From 26dc81fc6d85c676e4c7f2c74b0ff04500ad8f84 Mon Sep 17 00:00:00 2001 From: "Celestial.y" Date: Wed, 8 Oct 2025 22:51:59 +0800 Subject: [PATCH 7/9] Update scriptdata/uv/README.md --- scriptdata/uv/README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scriptdata/uv/README.md b/scriptdata/uv/README.md index dab4579cd..6ea05938a 100644 --- a/scriptdata/uv/README.md +++ b/scriptdata/uv/README.md @@ -6,10 +6,13 @@ This is important because there has been so many complaints about the failure in ## How to add/remove python package? 1. Edit `requirements.in`. You may refer to [PyPI](https://pypi.org/) for possible package names. - - See also [uv doc](https://docs.astral.sh/uv/pip/dependencies/#using-requirementsin). -2. Run `uv pip compile requirements.in -o requirements.txt` in this folder.[^1] +2. Run `uv pip compile requirements.in -o requirements.txt` in this folder. -[^1]: `requirements.txt` is included in git repo. It's for locking package versions to enhance stability and reproducibility. In fact, including package version lock file in git repo is also common in other places, for example the `package-lock.json` of Node.js projects. See [this stackoverflow question](https://stackoverflow.com/questions/48524417/should-the-package-lock-json-file-be-added-to-gitignore) for a deeper explanation. +**Notes:** +- See also [uv doc](https://docs.astral.sh/uv/pip/dependencies/#using-requirementsin). +- `requirements.txt` is included in git repo. It's for locking package versions to enhance stability and reproducibility. + - In fact, including package version lock file in git repo is also common in other places, for example the `package-lock.json` of Node.js projects (see also [this stackoverflow question](https://stackoverflow.com/questions/48524417/should-the-package-lock-json-file-be-added-to-gitignore)). + - However, it's not always recommended to include package version lock file in Git, for example [the poetry document](https://python-poetry.org/docs/basic-usage/#committing-your-poetrylock-file-to-version-control) recommend application developers to include package version lock file in Git, but library developers should consider more, such as not inluding the lock file or including it but refreshing regularly. ## How will the python packages get installed? From 95c3cf2c9019df246d6db4b524b1da3ed83bec2d Mon Sep 17 00:00:00 2001 From: "Celestial.y" Date: Wed, 8 Oct 2025 22:55:04 +0800 Subject: [PATCH 8/9] Update scriptdata/uv/README.md --- scriptdata/uv/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scriptdata/uv/README.md b/scriptdata/uv/README.md index 6ea05938a..cc73c7ed5 100644 --- a/scriptdata/uv/README.md +++ b/scriptdata/uv/README.md @@ -10,8 +10,8 @@ This is important because there has been so many complaints about the failure in **Notes:** - See also [uv doc](https://docs.astral.sh/uv/pip/dependencies/#using-requirementsin). -- `requirements.txt` is included in git repo. It's for locking package versions to enhance stability and reproducibility. - - In fact, including package version lock file in git repo is also common in other places, for example the `package-lock.json` of Node.js projects (see also [this stackoverflow question](https://stackoverflow.com/questions/48524417/should-the-package-lock-json-file-be-added-to-gitignore)). +- `requirements.txt` is included in Git. It's for locking package versions to enhance stability and reproducibility. + - In fact, including package version lock file in Git is also the most common way for similar situations, for example the `package-lock.json` of Node.js projects (see also [this stackoverflow question](https://stackoverflow.com/questions/48524417/should-the-package-lock-json-file-be-added-to-gitignore)). - However, it's not always recommended to include package version lock file in Git, for example [the poetry document](https://python-poetry.org/docs/basic-usage/#committing-your-poetrylock-file-to-version-control) recommend application developers to include package version lock file in Git, but library developers should consider more, such as not inluding the lock file or including it but refreshing regularly. ## How will the python packages get installed? From b2a7b191cfdffbb97fc9d510526c4883130be4fe Mon Sep 17 00:00:00 2001 From: "Celestial.y" Date: Wed, 8 Oct 2025 23:00:10 +0800 Subject: [PATCH 9/9] Update scriptdata/uv/README.md --- scriptdata/uv/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scriptdata/uv/README.md b/scriptdata/uv/README.md index cc73c7ed5..72861d7a8 100644 --- a/scriptdata/uv/README.md +++ b/scriptdata/uv/README.md @@ -11,8 +11,7 @@ This is important because there has been so many complaints about the failure in **Notes:** - See also [uv doc](https://docs.astral.sh/uv/pip/dependencies/#using-requirementsin). - `requirements.txt` is included in Git. It's for locking package versions to enhance stability and reproducibility. - - In fact, including package version lock file in Git is also the most common way for similar situations, for example the `package-lock.json` of Node.js projects (see also [this stackoverflow question](https://stackoverflow.com/questions/48524417/should-the-package-lock-json-file-be-added-to-gitignore)). - - However, it's not always recommended to include package version lock file in Git, for example [the poetry document](https://python-poetry.org/docs/basic-usage/#committing-your-poetrylock-file-to-version-control) recommend application developers to include package version lock file in Git, but library developers should consider more, such as not inluding the lock file or including it but refreshing regularly. + - In fact, including package version lock file in Git is also the most common way for similar situations, for example the `package-lock.json` of Node.js projects (see also [this stackoverflow question](https://stackoverflow.com/questions/48524417/should-the-package-lock-json-file-be-added-to-gitignore)). Although there are some situations when it's not suitable to include the lock file, for example [the poetry document](https://python-poetry.org/docs/basic-usage/#committing-your-poetrylock-file-to-version-control) recommend application developers to include package version lock file in Git, but library developers should consider more, such as not inluding the lock file or including it but refreshing regularly. ## How will the python packages get installed?