cli-usereq 0.75.0__tar.gz → 0.75.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cli_usereq-0.75.0/src/cli_usereq.egg-info → cli_usereq-0.75.1}/PKG-INFO +10 -6
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/README.md +9 -5
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/pyproject.toml +1 -1
- {cli_usereq-0.75.0 → cli_usereq-0.75.1/src/cli_usereq.egg-info}/PKG-INFO +10 -6
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/__init__.py +1 -1
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/cli.py +133 -68
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_cli.py +116 -5
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_update_check.py +123 -1
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/LICENSE +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/setup.cfg +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/cli_usereq.egg-info/SOURCES.txt +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/cli_usereq.egg-info/dependency_links.txt +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/cli_usereq.egg-info/entry_points.txt +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/cli_usereq.egg-info/requires.txt +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/cli_usereq.egg-info/top_level.txt +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/__main__.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/compress.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/compress_files.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/doxygen_parser.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/find_constructs.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/generate_markdown.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/guidelines/Google_C++_Style_Guide.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/guidelines/Google_Python_Style_Guide.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/guidelines/Google_TypeScript_Style_Guide.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/guidelines/RFC2119.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/analyze.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/change.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/check.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/cover.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/create.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/fix.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/flowchart.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/implement.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/new.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/orchestrate.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/readme.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/recreate.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/refactor.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/references.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/renumber.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/workflow.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts/write.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/prompts-version.txt +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/templates/Agentic_Text_Authoring_Guidance.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/templates/Document_Source_Code_in_Doxygen_Style.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/templates/HDT_Test_Authoring_Guide.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/templates/Requirements_Template.md +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/source_analyzer.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/static_check.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/token_counter.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_analyzer_cli.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_analyzer_comments.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_analyzer_core.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_analyzer_errors.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_analyzer_format.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_analyzer_helpers.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_compress.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_dependency_manifests.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_doxygen_parser.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_files_commands.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_find_constructs.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_find_constructs_comprehensive.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_generate_markdown.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_helpers.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_import_isolation.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_pre_release_check.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_release_workflow.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_source_analyzer.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_static_check.py +0 -0
- {cli_usereq-0.75.0 → cli_usereq-0.75.1}/tests/test_token_counter.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cli-usereq
|
|
3
|
-
Version: 0.75.
|
|
3
|
+
Version: 0.75.1
|
|
4
4
|
Summary: Initialize a project with prompts, agents, and templates from the useReq repository.
|
|
5
5
|
Author: Ogekuri
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -709,7 +709,7 @@ Dynamic: license-file
|
|
|
709
709
|
> * **No Support or Feature Requests:** Please **do not** open issues, bug reports, or feature requests. They will not be addressed or accepted at this stage of development.
|
|
710
710
|
> * **No Warranty:** This software is provided **"AS IS"**, without warranty of any kind, express or implied. You may use it strictly for **testing and evaluation purposes** at your own sole risk.
|
|
711
711
|
|
|
712
|
-
# useReq / req (0.75.
|
|
712
|
+
# useReq / req (0.75.1)
|
|
713
713
|
|
|
714
714
|
<p align="center">
|
|
715
715
|
<img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+">
|
|
@@ -762,7 +762,7 @@ Get running in three steps: install the tool, configure one provider, and instal
|
|
|
762
762
|
uv tool install cli-usereq
|
|
763
763
|
|
|
764
764
|
# or persistent install tracking the git repository
|
|
765
|
-
uv tool install cli-usereq --force --from git+https://github.com/Ogekuri/CLI-useReq.git
|
|
765
|
+
uv tool install cli-usereq --force --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git
|
|
766
766
|
|
|
767
767
|
# or run instantly without installing (PyPI release)
|
|
768
768
|
uvx --from cli-usereq req --help
|
|
@@ -813,9 +813,12 @@ This exposes the CLI as `req` (also callable as `usereq` or `python -m usereq`).
|
|
|
813
813
|
|
|
814
814
|
```bash
|
|
815
815
|
req --upgrade
|
|
816
|
+
|
|
817
|
+
# force full package download and complete reinstallation
|
|
818
|
+
req --upgrade --force
|
|
816
819
|
```
|
|
817
820
|
|
|
818
|
-
On Linux this executes `uv tool install cli-usereq
|
|
821
|
+
On Linux this executes the standard `uv tool install cli-usereq` command from the PyPI index without any forcing option; on other platforms the manual command is printed and `uv` is not executed. Adding `--force` forces full package download and complete reinstallation: `req --upgrade --force` executes `uv tool install cli-usereq --force --reinstall --refresh`. Use `req --upgrade --develop` (or the equivalent `req --upgrade --dev`) to install the latest tagged GitHub release instead of PyPI. When the upgrade succeeds and `auto-install` is enabled (the default), the persisted providers are automatically re-provisioned — equivalent to running `install`. Provide `--prj-base` in the same invocation to enable this; without it, a warning is printed and the provider update is skipped. Disable the behavior persistently with `--disable-auto-install` and re-enable it with `--enable-auto-install`.
|
|
819
822
|
|
|
820
823
|
### Install from GitHub (alternative channel)
|
|
821
824
|
|
|
@@ -823,7 +826,7 @@ Intermediate and test releases are published on GitHub at [`Ogekuri/CLI-useReq`]
|
|
|
823
826
|
|
|
824
827
|
```bash
|
|
825
828
|
# persistent install tracking the git repository
|
|
826
|
-
uv tool install cli-usereq --force --from git+https://github.com/Ogekuri/CLI-useReq.git
|
|
829
|
+
uv tool install cli-usereq --force --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git
|
|
827
830
|
|
|
828
831
|
# or run instantly without installing
|
|
829
832
|
uvx --from git+https://github.com/Ogekuri/CLI-useReq.git req --help
|
|
@@ -832,7 +835,7 @@ uvx --from git+https://github.com/Ogekuri/CLI-useReq.git req --help
|
|
|
832
835
|
req --upgrade --develop
|
|
833
836
|
```
|
|
834
837
|
|
|
835
|
-
On Linux `req --upgrade --develop` (or `req --upgrade --dev`) executes `uv tool install cli-usereq --
|
|
838
|
+
On Linux `req --upgrade --develop` (or `req --upgrade --dev`) executes the standard `uv tool install cli-usereq --from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>` command, where `<TAG>` is the latest tagged release resolved through the GitHub releases API regardless of the branch holding it; on other platforms the manual command is printed and `uv` is not executed. Adding `--force` (`req --upgrade --develop --force`) executes `uv tool install cli-usereq --force --reinstall --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>` instead.
|
|
836
839
|
|
|
837
840
|
### Tool removal
|
|
838
841
|
|
|
@@ -992,6 +995,7 @@ Notes:
|
|
|
992
995
|
- `--verbose` / `--debug` — detailed and diagnostic output.
|
|
993
996
|
- `--ver` / `--version` — print the installed package version, query PyPI and GitHub, and print `PyPI latest: <version>` and `GitHub latest: <version>` lines (`unknown` when a repository cannot be reached).
|
|
994
997
|
- `--develop` / `--dev` — with `--upgrade`: install the latest tagged GitHub release from `git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>`, with `<TAG>` resolved through the GitHub releases API regardless of branch, instead of PyPI; `--dev` is an equivalent alias of `--develop`.
|
|
998
|
+
- `--force` — with `--upgrade`: force full package download and complete reinstallation (`uv tool install ... --force --reinstall --refresh`); without `--force` the standard install/update process runs without any forcing option.
|
|
995
999
|
- `-h` / `--help` — print command help and exit.
|
|
996
1000
|
|
|
997
1001
|
A startup release check queries the latest PyPI release (idle-gated to at most once per hour; once per day on API failures) and prints a bright-green stderr notice when a newer version is available.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
> * **No Support or Feature Requests:** Please **do not** open issues, bug reports, or feature requests. They will not be addressed or accepted at this stage of development.
|
|
11
11
|
> * **No Warranty:** This software is provided **"AS IS"**, without warranty of any kind, express or implied. You may use it strictly for **testing and evaluation purposes** at your own sole risk.
|
|
12
12
|
|
|
13
|
-
# useReq / req (0.75.
|
|
13
|
+
# useReq / req (0.75.1)
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
16
16
|
<img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+">
|
|
@@ -63,7 +63,7 @@ Get running in three steps: install the tool, configure one provider, and instal
|
|
|
63
63
|
uv tool install cli-usereq
|
|
64
64
|
|
|
65
65
|
# or persistent install tracking the git repository
|
|
66
|
-
uv tool install cli-usereq --force --from git+https://github.com/Ogekuri/CLI-useReq.git
|
|
66
|
+
uv tool install cli-usereq --force --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git
|
|
67
67
|
|
|
68
68
|
# or run instantly without installing (PyPI release)
|
|
69
69
|
uvx --from cli-usereq req --help
|
|
@@ -114,9 +114,12 @@ This exposes the CLI as `req` (also callable as `usereq` or `python -m usereq`).
|
|
|
114
114
|
|
|
115
115
|
```bash
|
|
116
116
|
req --upgrade
|
|
117
|
+
|
|
118
|
+
# force full package download and complete reinstallation
|
|
119
|
+
req --upgrade --force
|
|
117
120
|
```
|
|
118
121
|
|
|
119
|
-
On Linux this executes `uv tool install cli-usereq
|
|
122
|
+
On Linux this executes the standard `uv tool install cli-usereq` command from the PyPI index without any forcing option; on other platforms the manual command is printed and `uv` is not executed. Adding `--force` forces full package download and complete reinstallation: `req --upgrade --force` executes `uv tool install cli-usereq --force --reinstall --refresh`. Use `req --upgrade --develop` (or the equivalent `req --upgrade --dev`) to install the latest tagged GitHub release instead of PyPI. When the upgrade succeeds and `auto-install` is enabled (the default), the persisted providers are automatically re-provisioned — equivalent to running `install`. Provide `--prj-base` in the same invocation to enable this; without it, a warning is printed and the provider update is skipped. Disable the behavior persistently with `--disable-auto-install` and re-enable it with `--enable-auto-install`.
|
|
120
123
|
|
|
121
124
|
### Install from GitHub (alternative channel)
|
|
122
125
|
|
|
@@ -124,7 +127,7 @@ Intermediate and test releases are published on GitHub at [`Ogekuri/CLI-useReq`]
|
|
|
124
127
|
|
|
125
128
|
```bash
|
|
126
129
|
# persistent install tracking the git repository
|
|
127
|
-
uv tool install cli-usereq --force --from git+https://github.com/Ogekuri/CLI-useReq.git
|
|
130
|
+
uv tool install cli-usereq --force --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git
|
|
128
131
|
|
|
129
132
|
# or run instantly without installing
|
|
130
133
|
uvx --from git+https://github.com/Ogekuri/CLI-useReq.git req --help
|
|
@@ -133,7 +136,7 @@ uvx --from git+https://github.com/Ogekuri/CLI-useReq.git req --help
|
|
|
133
136
|
req --upgrade --develop
|
|
134
137
|
```
|
|
135
138
|
|
|
136
|
-
On Linux `req --upgrade --develop` (or `req --upgrade --dev`) executes `uv tool install cli-usereq --
|
|
139
|
+
On Linux `req --upgrade --develop` (or `req --upgrade --dev`) executes the standard `uv tool install cli-usereq --from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>` command, where `<TAG>` is the latest tagged release resolved through the GitHub releases API regardless of the branch holding it; on other platforms the manual command is printed and `uv` is not executed. Adding `--force` (`req --upgrade --develop --force`) executes `uv tool install cli-usereq --force --reinstall --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>` instead.
|
|
137
140
|
|
|
138
141
|
### Tool removal
|
|
139
142
|
|
|
@@ -293,6 +296,7 @@ Notes:
|
|
|
293
296
|
- `--verbose` / `--debug` — detailed and diagnostic output.
|
|
294
297
|
- `--ver` / `--version` — print the installed package version, query PyPI and GitHub, and print `PyPI latest: <version>` and `GitHub latest: <version>` lines (`unknown` when a repository cannot be reached).
|
|
295
298
|
- `--develop` / `--dev` — with `--upgrade`: install the latest tagged GitHub release from `git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>`, with `<TAG>` resolved through the GitHub releases API regardless of branch, instead of PyPI; `--dev` is an equivalent alias of `--develop`.
|
|
299
|
+
- `--force` — with `--upgrade`: force full package download and complete reinstallation (`uv tool install ... --force --reinstall --refresh`); without `--force` the standard install/update process runs without any forcing option.
|
|
296
300
|
- `-h` / `--help` — print command help and exit.
|
|
297
301
|
|
|
298
302
|
A startup release check queries the latest PyPI release (idle-gated to at most once per hour; once per day on API failures) and prints a bright-green stderr notice when a newer version is available.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cli-usereq"
|
|
7
|
-
version = "0.75.
|
|
7
|
+
version = "0.75.1"
|
|
8
8
|
description = "Initialize a project with prompts, agents, and templates from the useReq repository."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cli-usereq
|
|
3
|
-
Version: 0.75.
|
|
3
|
+
Version: 0.75.1
|
|
4
4
|
Summary: Initialize a project with prompts, agents, and templates from the useReq repository.
|
|
5
5
|
Author: Ogekuri
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -709,7 +709,7 @@ Dynamic: license-file
|
|
|
709
709
|
> * **No Support or Feature Requests:** Please **do not** open issues, bug reports, or feature requests. They will not be addressed or accepted at this stage of development.
|
|
710
710
|
> * **No Warranty:** This software is provided **"AS IS"**, without warranty of any kind, express or implied. You may use it strictly for **testing and evaluation purposes** at your own sole risk.
|
|
711
711
|
|
|
712
|
-
# useReq / req (0.75.
|
|
712
|
+
# useReq / req (0.75.1)
|
|
713
713
|
|
|
714
714
|
<p align="center">
|
|
715
715
|
<img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+">
|
|
@@ -762,7 +762,7 @@ Get running in three steps: install the tool, configure one provider, and instal
|
|
|
762
762
|
uv tool install cli-usereq
|
|
763
763
|
|
|
764
764
|
# or persistent install tracking the git repository
|
|
765
|
-
uv tool install cli-usereq --force --from git+https://github.com/Ogekuri/CLI-useReq.git
|
|
765
|
+
uv tool install cli-usereq --force --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git
|
|
766
766
|
|
|
767
767
|
# or run instantly without installing (PyPI release)
|
|
768
768
|
uvx --from cli-usereq req --help
|
|
@@ -813,9 +813,12 @@ This exposes the CLI as `req` (also callable as `usereq` or `python -m usereq`).
|
|
|
813
813
|
|
|
814
814
|
```bash
|
|
815
815
|
req --upgrade
|
|
816
|
+
|
|
817
|
+
# force full package download and complete reinstallation
|
|
818
|
+
req --upgrade --force
|
|
816
819
|
```
|
|
817
820
|
|
|
818
|
-
On Linux this executes `uv tool install cli-usereq
|
|
821
|
+
On Linux this executes the standard `uv tool install cli-usereq` command from the PyPI index without any forcing option; on other platforms the manual command is printed and `uv` is not executed. Adding `--force` forces full package download and complete reinstallation: `req --upgrade --force` executes `uv tool install cli-usereq --force --reinstall --refresh`. Use `req --upgrade --develop` (or the equivalent `req --upgrade --dev`) to install the latest tagged GitHub release instead of PyPI. When the upgrade succeeds and `auto-install` is enabled (the default), the persisted providers are automatically re-provisioned — equivalent to running `install`. Provide `--prj-base` in the same invocation to enable this; without it, a warning is printed and the provider update is skipped. Disable the behavior persistently with `--disable-auto-install` and re-enable it with `--enable-auto-install`.
|
|
819
822
|
|
|
820
823
|
### Install from GitHub (alternative channel)
|
|
821
824
|
|
|
@@ -823,7 +826,7 @@ Intermediate and test releases are published on GitHub at [`Ogekuri/CLI-useReq`]
|
|
|
823
826
|
|
|
824
827
|
```bash
|
|
825
828
|
# persistent install tracking the git repository
|
|
826
|
-
uv tool install cli-usereq --force --from git+https://github.com/Ogekuri/CLI-useReq.git
|
|
829
|
+
uv tool install cli-usereq --force --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git
|
|
827
830
|
|
|
828
831
|
# or run instantly without installing
|
|
829
832
|
uvx --from git+https://github.com/Ogekuri/CLI-useReq.git req --help
|
|
@@ -832,7 +835,7 @@ uvx --from git+https://github.com/Ogekuri/CLI-useReq.git req --help
|
|
|
832
835
|
req --upgrade --develop
|
|
833
836
|
```
|
|
834
837
|
|
|
835
|
-
On Linux `req --upgrade --develop` (or `req --upgrade --dev`) executes `uv tool install cli-usereq --
|
|
838
|
+
On Linux `req --upgrade --develop` (or `req --upgrade --dev`) executes the standard `uv tool install cli-usereq --from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>` command, where `<TAG>` is the latest tagged release resolved through the GitHub releases API regardless of the branch holding it; on other platforms the manual command is printed and `uv` is not executed. Adding `--force` (`req --upgrade --develop --force`) executes `uv tool install cli-usereq --force --reinstall --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>` instead.
|
|
836
839
|
|
|
837
840
|
### Tool removal
|
|
838
841
|
|
|
@@ -992,6 +995,7 @@ Notes:
|
|
|
992
995
|
- `--verbose` / `--debug` — detailed and diagnostic output.
|
|
993
996
|
- `--ver` / `--version` — print the installed package version, query PyPI and GitHub, and print `PyPI latest: <version>` and `GitHub latest: <version>` lines (`unknown` when a repository cannot be reached).
|
|
994
997
|
- `--develop` / `--dev` — with `--upgrade`: install the latest tagged GitHub release from `git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>`, with `<TAG>` resolved through the GitHub releases API regardless of branch, instead of PyPI; `--dev` is an equivalent alias of `--develop`.
|
|
998
|
+
- `--force` — with `--upgrade`: force full package download and complete reinstallation (`uv tool install ... --force --reinstall --refresh`); without `--force` the standard install/update process runs without any forcing option.
|
|
995
999
|
- `-h` / `--help` — print command help and exit.
|
|
996
1000
|
|
|
997
1001
|
A startup release check queries the latest PyPI release (idle-gated to at most once per hour; once per day on API failures) and prints a bright-green stderr notice when a newer version is available.
|
|
@@ -18,7 +18,7 @@ from . import source_analyzer # usereq.source_analyzer submodule
|
|
|
18
18
|
from . import token_counter # usereq.token_counter submodule
|
|
19
19
|
from typing import Any
|
|
20
20
|
|
|
21
|
-
__version__ = "0.75.
|
|
21
|
+
__version__ = "0.75.1"
|
|
22
22
|
"""! @brief Semantic version string of the package."""
|
|
23
23
|
|
|
24
24
|
|
|
@@ -31,8 +31,8 @@ from typing import Any, Mapping, Optional
|
|
|
31
31
|
REPO_ROOT = Path(__file__).resolve().parents[2]
|
|
32
32
|
"""! @brief The absolute path to the repository root."""
|
|
33
33
|
|
|
34
|
-
RESOURCE_ROOT = Path(
|
|
35
|
-
"""! @brief The absolute path
|
|
34
|
+
RESOURCE_ROOT = Path(os.path.abspath(__file__)).parent / "resources"
|
|
35
|
+
"""! @brief The absolute lexical path of the packaged resources directory; never resolves symbolic links (SRS-505)."""
|
|
36
36
|
|
|
37
37
|
VERBOSE = False
|
|
38
38
|
"""! @brief Whether verbose output is enabled."""
|
|
@@ -149,9 +149,10 @@ def guidelines_dir() -> Path:
|
|
|
149
149
|
@brief Resolve the packaged guidelines directory of the running installation.
|
|
150
150
|
@details Composes the packaged resources root of the running installation with the
|
|
151
151
|
non-configurable ``guidelines`` suffix so installed skills reference the resources
|
|
152
|
-
shipped with this installation instead of any external copy (SRS-360, SRS-497)
|
|
152
|
+
shipped with this installation instead of any external copy (SRS-360, SRS-497);
|
|
153
|
+
composition is lexical and never resolves symbolic links (SRS-505).
|
|
153
154
|
@return {Path} Absolute path of the packaged guidelines directory.
|
|
154
|
-
@satisfies SRS-360, SRS-497
|
|
155
|
+
@satisfies SRS-360, SRS-497, SRS-505
|
|
155
156
|
"""
|
|
156
157
|
return RESOURCE_ROOT / "guidelines"
|
|
157
158
|
|
|
@@ -161,9 +162,10 @@ def templates_dir() -> Path:
|
|
|
161
162
|
@brief Resolve the packaged document-template directory of the running installation.
|
|
162
163
|
@details Composes the packaged resources root of the running installation with the
|
|
163
164
|
non-configurable ``templates`` suffix feeding the ``%%TEMPLATE_PATH%%`` substitution
|
|
164
|
-
so installed skills reference the templates shipped with this installation (SRS-498)
|
|
165
|
+
so installed skills reference the templates shipped with this installation (SRS-498);
|
|
166
|
+
composition is lexical and never resolves symbolic links (SRS-505).
|
|
165
167
|
@return {Path} Absolute path of the packaged templates directory.
|
|
166
|
-
@satisfies SRS-495, SRS-498
|
|
168
|
+
@satisfies SRS-495, SRS-498, SRS-505
|
|
167
169
|
"""
|
|
168
170
|
return RESOURCE_ROOT / "templates"
|
|
169
171
|
|
|
@@ -422,10 +424,12 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
422
424
|
global base arguments ``--prj-base`` and ``--git-base`` both before and after the subcommand
|
|
423
425
|
token; ``--prj-base`` is mandatory only for the SRS-396 project-scan subcommands (enforced by
|
|
424
426
|
``_require_prj_base``) and ``--git-base`` is never mandatory for any SRS-408 subcommand
|
|
425
|
-
(SRS-392, SRS-393, SRS-396, SRS-397, SRS-410).
|
|
427
|
+
(SRS-392, SRS-393, SRS-396, SRS-397, SRS-410). The ``--force`` auxiliary argument is
|
|
428
|
+
accepted by ``--upgrade`` (with or without ``--develop``/``--dev``) and forces full
|
|
429
|
+
package download and complete reinstallation (SRS-508, SRS-511).
|
|
426
430
|
"""
|
|
427
431
|
usage = (
|
|
428
|
-
"req [-h] [--upgrade] [--develop] [--dev] [--uninstall] [--prj-base PRJ_BASE] [--git-base GIT_BASE] "
|
|
432
|
+
"req [-h] [--upgrade] [--develop] [--dev] [--force] [--uninstall] [--prj-base PRJ_BASE] [--git-base GIT_BASE] "
|
|
429
433
|
"[--set-docs-dir DOCS_DIR] [--set-src-dir SRC_DIR] [--set-tests-dir TESTS_DIR] [--verbose] [--debug] "
|
|
430
434
|
"[--enable PROVIDER] [--disable PROVIDER] [--enable-auto-install] [--disable-auto-install] "
|
|
431
435
|
"[--enable-line-numbers] "
|
|
@@ -507,6 +511,17 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
507
511
|
"--dev is an equivalent alias of --develop."
|
|
508
512
|
),
|
|
509
513
|
)
|
|
514
|
+
parser.add_argument(
|
|
515
|
+
"--force",
|
|
516
|
+
action="store_true",
|
|
517
|
+
dest="force",
|
|
518
|
+
help=(
|
|
519
|
+
"With --upgrade: force full package download and complete "
|
|
520
|
+
"reinstallation (uv tool install ... --force --reinstall "
|
|
521
|
+
"--refresh). Without --force the standard install/update "
|
|
522
|
+
"process runs without any forcing option."
|
|
523
|
+
),
|
|
524
|
+
)
|
|
510
525
|
parser.add_argument(
|
|
511
526
|
"--uninstall", action="store_true", help="Uninstall the tool with uv."
|
|
512
527
|
)
|
|
@@ -931,33 +946,40 @@ def _resolve_github_upgrade_tag() -> str:
|
|
|
931
946
|
return resolved_tag
|
|
932
947
|
|
|
933
948
|
|
|
934
|
-
def run_upgrade(use_github: bool = False) -> None:
|
|
949
|
+
def run_upgrade(use_github: bool = False, force: bool = False) -> None:
|
|
935
950
|
"""!
|
|
936
951
|
@brief Executes the upgrade using uv from the PyPI index or the latest GitHub release tag.
|
|
937
952
|
@param use_github {bool} When True, install the latest tagged GitHub release instead of
|
|
938
953
|
the PyPI index (`--upgrade --develop` or equivalent alias `--dev`, SRS-440, SRS-445).
|
|
939
|
-
@
|
|
940
|
-
|
|
941
|
-
`
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
954
|
+
@param force {bool} When True, append `--force --reinstall --refresh` so uv re-downloads
|
|
955
|
+
the package and fully reinstalls it (`--upgrade --force`, SRS-508, SRS-509, SRS-510).
|
|
956
|
+
@details Builds the standard `uv tool install cli-usereq` command against the PyPI index
|
|
957
|
+
by default (SRS-343); without `force` no forcing option is passed so the standard
|
|
958
|
+
install/update process runs unchanged. When `force` is True the command becomes
|
|
959
|
+
`uv tool install cli-usereq --force --reinstall --refresh` (SRS-509). When `use_github`
|
|
960
|
+
is True, resolves the latest GitHub release tag through `_resolve_github_upgrade_tag()`
|
|
961
|
+
(SRS-451) and appends `--from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>`
|
|
962
|
+
regardless of the branch holding that tag (SRS-440, SRS-452, SRS-510). Executes the
|
|
963
|
+
command only on Linux; on non-Linux platforms prints the manual command and skips uv
|
|
964
|
+
execution.
|
|
945
965
|
@throws {ReqError} When the SRS-451 GitHub tag resolution fails (exit code 1, SRS-453) or
|
|
946
966
|
when the uv process fails.
|
|
947
967
|
@return {None} Function return value.
|
|
948
968
|
@note Tag resolution precedes the platform gate so the non-Linux manual command embeds the
|
|
949
969
|
resolved tag (SRS-452).
|
|
950
|
-
@note The `--develop`/`--dev` argv alias mapping to `use_github=True`
|
|
951
|
-
`main(...)` before calling this
|
|
952
|
-
|
|
970
|
+
@note The `--develop`/`--dev` argv alias mapping to `use_github=True` and the `--force`
|
|
971
|
+
argv token mapping to `force=True` are resolved by `main(...)` before calling this
|
|
972
|
+
function.
|
|
973
|
+
@satisfies SRS-343, SRS-440, SRS-445, SRS-451, SRS-452, SRS-453, SRS-508, SRS-509, SRS-510
|
|
953
974
|
"""
|
|
954
975
|
command = [
|
|
955
976
|
"uv",
|
|
956
977
|
"tool",
|
|
957
978
|
"install",
|
|
958
979
|
TOOL_PROGRAM_NAME,
|
|
959
|
-
"--force",
|
|
960
980
|
]
|
|
981
|
+
if force:
|
|
982
|
+
command += ["--force", "--reinstall", "--refresh"]
|
|
961
983
|
if use_github:
|
|
962
984
|
resolved_tag = _resolve_github_upgrade_tag()
|
|
963
985
|
command += ["--from", f"{GITHUB_UPGRADE_SOURCE}@{resolved_tag}"]
|
|
@@ -2405,52 +2427,101 @@ def run_config_commands(args: Namespace) -> None:
|
|
|
2405
2427
|
apply_auto_install_config(False)
|
|
2406
2428
|
|
|
2407
2429
|
|
|
2430
|
+
def _non_symlink_regular_files(directory: Path) -> list[Path]:
|
|
2431
|
+
"""!
|
|
2432
|
+
@brief List non-hidden regular files in one directory without following symbolic links.
|
|
2433
|
+
@details Scans ``directory`` with ``os.scandir`` and ``follow_symlinks=False`` so
|
|
2434
|
+
symbolic-link entries are never followed or resolved: symlinked files, symlinked
|
|
2435
|
+
subdirectories, and broken links are excluded, and only entries whose own inode is
|
|
2436
|
+
a regular file are kept (SRS-504). Hidden names starting with ``.`` are excluded.
|
|
2437
|
+
When ``directory`` is itself a symbolic link or is absent, returns an empty list so
|
|
2438
|
+
callers apply their absent-directory fallback instead of reading through the link.
|
|
2439
|
+
@param directory {Path} Absolute directory to enumerate.
|
|
2440
|
+
@return {list[Path]} Sorted paths of non-symlink regular files.
|
|
2441
|
+
@satisfies SRS-504
|
|
2442
|
+
"""
|
|
2443
|
+
if directory.is_symlink() or not directory.is_dir():
|
|
2444
|
+
return []
|
|
2445
|
+
entries = [
|
|
2446
|
+
Path(entry.path)
|
|
2447
|
+
for entry in os.scandir(directory)
|
|
2448
|
+
if entry.is_file(follow_symlinks=False)
|
|
2449
|
+
and not entry.name.startswith(".")
|
|
2450
|
+
]
|
|
2451
|
+
return sorted(entries)
|
|
2452
|
+
|
|
2453
|
+
|
|
2408
2454
|
def generate_guidelines_file_list() -> str:
|
|
2409
2455
|
"""!
|
|
2410
2456
|
@brief Build the `%%GUIDELINES_FILES%%` substitution payload from GUIDELINES_DIR.
|
|
2411
|
-
@details Enumerates non-hidden regular files in :func:`guidelines_dir`
|
|
2412
|
-
`resources/guidelines` of the running installation, SRS-360) in deterministic
|
|
2413
|
-
order and renders each as a backticked
|
|
2414
|
-
|
|
2457
|
+
@details Enumerates non-hidden non-symlink regular files in :func:`guidelines_dir`
|
|
2458
|
+
(packaged `resources/guidelines` of the running installation, SRS-360) in deterministic
|
|
2459
|
+
sorted order without following symbolic links (SRS-504) and renders each as a backticked
|
|
2460
|
+
home-relative path (SRS-402). When the directory is absent, symlinked, or empty, renders
|
|
2461
|
+
the home-relative directory itself with a trailing slash.
|
|
2415
2462
|
@return {str} Comma-separated backticked home-relative paths, or the directory fallback.
|
|
2416
|
-
@satisfies SRS-403
|
|
2463
|
+
@satisfies SRS-403, SRS-504
|
|
2417
2464
|
"""
|
|
2418
2465
|
source_dir = guidelines_dir()
|
|
2419
|
-
if not source_dir.is_dir():
|
|
2420
|
-
return f"`{format_home_relative_path(source_dir)}/`"
|
|
2421
|
-
|
|
2422
2466
|
files = [
|
|
2423
2467
|
f"`{format_home_relative_path(file_path)}`"
|
|
2424
|
-
for file_path in
|
|
2425
|
-
if file_path.is_file() and not file_path.name.startswith(".")
|
|
2468
|
+
for file_path in _non_symlink_regular_files(source_dir)
|
|
2426
2469
|
]
|
|
2427
2470
|
if not files:
|
|
2428
2471
|
return f"`{format_home_relative_path(source_dir)}/`"
|
|
2429
2472
|
return ", ".join(files)
|
|
2430
2473
|
|
|
2431
2474
|
|
|
2432
|
-
def
|
|
2475
|
+
def generate_guidelines_file_names() -> list[str]:
|
|
2433
2476
|
"""!
|
|
2434
|
-
@brief List the
|
|
2435
|
-
@details Returns one
|
|
2436
|
-
:func:`guidelines_dir` (packaged `resources/guidelines` of the running installation)
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
@return {list[str]}
|
|
2440
|
-
@satisfies SRS-360, SRS-
|
|
2477
|
+
@brief List the bare guideline file names reported after installation.
|
|
2478
|
+
@details Returns one bare file name per non-hidden non-symlink regular file in
|
|
2479
|
+
:func:`guidelines_dir` (packaged `resources/guidelines` of the running installation)
|
|
2480
|
+
without following symbolic links (SRS-504, SRS-516); names carry no directory
|
|
2481
|
+
components, and an absent, symlinked, or empty directory yields an empty list.
|
|
2482
|
+
@return {list[str]} Bare guideline file names in deterministic sorted order.
|
|
2483
|
+
@satisfies SRS-360, SRS-513, SRS-516
|
|
2441
2484
|
"""
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2485
|
+
return [
|
|
2486
|
+
file_path.name for file_path in _non_symlink_regular_files(guidelines_dir())
|
|
2487
|
+
]
|
|
2488
|
+
|
|
2445
2489
|
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2490
|
+
def generate_templates_file_names() -> list[str]:
|
|
2491
|
+
"""!
|
|
2492
|
+
@brief List the bare template file names reported after installation.
|
|
2493
|
+
@details Returns one bare file name per non-hidden non-symlink regular file in
|
|
2494
|
+
:func:`templates_dir` (packaged `resources/templates` of the running installation)
|
|
2495
|
+
without following symbolic links (SRS-516); names carry no directory components,
|
|
2496
|
+
and an absent, symlinked, or empty directory yields an empty list.
|
|
2497
|
+
@return {list[str]} Bare template file names in deterministic sorted order.
|
|
2498
|
+
@satisfies SRS-498, SRS-514, SRS-516
|
|
2499
|
+
"""
|
|
2500
|
+
return [
|
|
2501
|
+
file_path.name for file_path in _non_symlink_regular_files(templates_dir())
|
|
2450
2502
|
]
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2503
|
+
|
|
2504
|
+
|
|
2505
|
+
def _print_resource_report() -> None:
|
|
2506
|
+
"""!
|
|
2507
|
+
@brief Print the compact post-installation packaged-resource report.
|
|
2508
|
+
@details Prints the home-relative lexical guidelines directory path ending with
|
|
2509
|
+
`/`, then one comma-separated line of bare guideline file names (SRS-513), then
|
|
2510
|
+
the home-relative lexical templates directory path ending with `/`, then one
|
|
2511
|
+
comma-separated line of bare template file names (SRS-514). Every printed path
|
|
2512
|
+
is composed lexically without resolving symbolic links (SRS-515); an empty
|
|
2513
|
+
enumeration emits no file-name line (SRS-516).
|
|
2514
|
+
@return {None} Function return value.
|
|
2515
|
+
@satisfies SRS-513, SRS-514, SRS-515, SRS-516
|
|
2516
|
+
"""
|
|
2517
|
+
print(f"Guidelines: {format_home_relative_path(guidelines_dir())}/")
|
|
2518
|
+
guideline_names = generate_guidelines_file_names()
|
|
2519
|
+
if guideline_names:
|
|
2520
|
+
print(", ".join(guideline_names))
|
|
2521
|
+
print(f"Templates: {format_home_relative_path(templates_dir())}/")
|
|
2522
|
+
template_names = generate_templates_file_names()
|
|
2523
|
+
if template_names:
|
|
2524
|
+
print(", ".join(template_names))
|
|
2454
2525
|
|
|
2455
2526
|
|
|
2456
2527
|
def ensure_relative(value: str, name: str, code: int) -> None:
|
|
@@ -3046,14 +3117,15 @@ def run(args: Namespace) -> None:
|
|
|
3046
3117
|
roots (SRS-381..SRS-386, SRS-464, SRS-486) with home-relative packaged-resource token
|
|
3047
3118
|
substitution for `%%GUIDELINES_FILES%%`, `%%GUIDELINES_PATH%%`, `%%TEMPLATE_PATH%%`,
|
|
3048
3119
|
`%%DOC_PATH%%`, `%%SRC_PATHS%%`, and `%%TEST_PATH%%` (SRS-360, SRS-402, SRS-403,
|
|
3049
|
-
SRS-498, SRS-500, SRS-501, SRS-502),
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3120
|
+
SRS-498, SRS-500, SRS-501, SRS-502), never following or resolving symbolic links in
|
|
3121
|
+
substitution sources (SRS-504, SRS-505, SRS-506), and never rewrites the user-global
|
|
3122
|
+
configuration file (SRS-448). Install does not consume `--prj-base` (SRS-447); project
|
|
3123
|
+
scaffolding, containment validation, and directory persistence are removed legacy
|
|
3124
|
+
behaviors (SRS-363, SRS-407, SRS-449).
|
|
3053
3125
|
@param args Parsed CLI namespace.
|
|
3054
3126
|
@return {None} Function return value.
|
|
3055
3127
|
@throws ReqError If no provider is enabled.
|
|
3056
|
-
@satisfies SRS-035, SRS-064, SRS-279, SRS-359, SRS-360, SRS-361, SRS-362, SRS-381, SRS-387, SRS-388, SRS-402, SRS-403, SRS-418, SRS-447, SRS-448, SRS-498, SRS-500, SRS-501, SRS-502
|
|
3128
|
+
@satisfies SRS-035, SRS-064, SRS-279, SRS-359, SRS-360, SRS-361, SRS-362, SRS-381, SRS-387, SRS-388, SRS-402, SRS-403, SRS-418, SRS-447, SRS-448, SRS-498, SRS-500, SRS-501, SRS-502, SRS-504, SRS-505, SRS-506
|
|
3057
3129
|
"""
|
|
3058
3130
|
global VERBOSE, DEBUG
|
|
3059
3131
|
VERBOSE = getattr(args, "verbose", False)
|
|
@@ -3168,21 +3240,11 @@ def run(args: Namespace) -> None:
|
|
|
3168
3240
|
|
|
3169
3241
|
# Final success notification: printed only when the command completed all
|
|
3170
3242
|
# intended filesystem modifications without raising an exception.
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
# Print the discovered directories used for token substitutions
|
|
3178
|
-
# as required by REQ-078: one item per line prefixed with '- '.
|
|
3179
|
-
guidelines_items = generate_guidelines_file_items()
|
|
3180
|
-
|
|
3181
|
-
if guidelines_items:
|
|
3182
|
-
for entry in guidelines_items:
|
|
3183
|
-
print(f"- {entry}")
|
|
3184
|
-
else:
|
|
3185
|
-
print("The folder %%GUIDELINES_FILES%% does not contain any files")
|
|
3243
|
+
# SRS-513..SRS-516: compact packaged-resource report; SRS-515 keeps every
|
|
3244
|
+
# reported path lexical, so symbolic links are never resolved here.
|
|
3245
|
+
home_value = format_home_relative_path(home_dir())
|
|
3246
|
+
print(f"Installation completed successfully in {home_value}")
|
|
3247
|
+
_print_resource_report()
|
|
3186
3248
|
|
|
3187
3249
|
|
|
3188
3250
|
# Build and print installation report table with per-provider skills details.
|
|
@@ -4260,7 +4322,10 @@ def main(argv: Optional[list[str]] = None) -> int:
|
|
|
4260
4322
|
run_uninstall()
|
|
4261
4323
|
return 0
|
|
4262
4324
|
if "--upgrade" in argv_list:
|
|
4263
|
-
run_upgrade(
|
|
4325
|
+
run_upgrade(
|
|
4326
|
+
use_github=("--develop" in argv_list or "--dev" in argv_list),
|
|
4327
|
+
force=("--force" in argv_list),
|
|
4328
|
+
)
|
|
4264
4329
|
_maybe_auto_install_after_upgrade(argv_list)
|
|
4265
4330
|
return 0
|
|
4266
4331
|
if maybe_print_version(argv_list, pypi_latest=pypi_latest_from_check):
|
|
@@ -17,7 +17,8 @@ SRS-364..366 (provider grammar), SRS-368 (SKILL.md front matter),
|
|
|
17
17
|
SRS-371/374 (flowchart artifacts), SRS-381..390 (user-level install,
|
|
18
18
|
global config, model removal), SRS-391 (runtime git resolution),
|
|
19
19
|
SRS-462..SRS-494 (show providers table, installation status, alphabetical
|
|
20
|
-
order, skills path), SRS-495 (packaged templates directory)
|
|
20
|
+
order, skills path), SRS-495 (packaged templates directory), SRS-513..SRS-517
|
|
21
|
+
(compact post-installation resource report).
|
|
21
22
|
"""
|
|
22
23
|
|
|
23
24
|
import json
|
|
@@ -571,8 +572,8 @@ class TestGuidelinesDirectory(HomeIsolatedTestCase):
|
|
|
571
572
|
"`~/resources/guidelines/RFC2119.md`",
|
|
572
573
|
)
|
|
573
574
|
self.assertEqual(
|
|
574
|
-
cli.
|
|
575
|
-
["
|
|
575
|
+
cli.generate_guidelines_file_names(),
|
|
576
|
+
["RFC2119.md"],
|
|
576
577
|
)
|
|
577
578
|
|
|
578
579
|
def test_guidelines_file_list_falls_back_to_directory(self) -> None:
|
|
@@ -587,6 +588,100 @@ class TestGuidelinesDirectory(HomeIsolatedTestCase):
|
|
|
587
588
|
self.assertEqual(cli.templates_dir(), self.templates)
|
|
588
589
|
self.assertEqual(cli.templates_dir(), self.resource_root / "templates")
|
|
589
590
|
|
|
591
|
+
def test_guidelines_enumeration_excludes_symlinks(self) -> None:
|
|
592
|
+
"""SRS-504/SRS-507: %%GUIDELINES_FILES%% never follows symbolic links."""
|
|
593
|
+
# Arrange
|
|
594
|
+
self.guidelines.mkdir(parents=True, exist_ok=True)
|
|
595
|
+
(self.guidelines / "RFC2119.md").write_text("rfc\n", encoding="utf-8")
|
|
596
|
+
(self.guidelines / "Linked.md").symlink_to(self.guidelines / "RFC2119.md")
|
|
597
|
+
(self.guidelines / "LinkedDir").symlink_to(self.resource_root)
|
|
598
|
+
# Act
|
|
599
|
+
file_list = cli.generate_guidelines_file_list()
|
|
600
|
+
names = cli.generate_guidelines_file_names()
|
|
601
|
+
# Assert
|
|
602
|
+
self.assertEqual(file_list, "`~/resources/guidelines/RFC2119.md`")
|
|
603
|
+
self.assertEqual(names, ["RFC2119.md"])
|
|
604
|
+
|
|
605
|
+
def test_symlinked_guidelines_directory_falls_back_to_directory(self) -> None:
|
|
606
|
+
"""SRS-504/SRS-507: a symlinked guidelines directory is not followed."""
|
|
607
|
+
# Arrange
|
|
608
|
+
real_dir = self.HOME / "real-guidelines"
|
|
609
|
+
real_dir.mkdir(parents=True)
|
|
610
|
+
(real_dir / "RFC2119.md").write_text("rfc\n", encoding="utf-8")
|
|
611
|
+
self.guidelines.symlink_to(real_dir)
|
|
612
|
+
# Act
|
|
613
|
+
file_list = cli.generate_guidelines_file_list()
|
|
614
|
+
# Assert
|
|
615
|
+
self.assertEqual(file_list, "`~/resources/guidelines/`")
|
|
616
|
+
|
|
617
|
+
def test_packaged_paths_render_lexically_without_symlink_resolution(self) -> None:
|
|
618
|
+
"""SRS-505/SRS-507: packaged directory tokens never resolve symbolic links."""
|
|
619
|
+
# Arrange
|
|
620
|
+
shutil.rmtree(self.resource_root)
|
|
621
|
+
real_root = self.HOME / "real-resources"
|
|
622
|
+
(real_root / "guidelines").mkdir(parents=True)
|
|
623
|
+
(real_root / "templates").mkdir(parents=True)
|
|
624
|
+
self.resource_root.symlink_to(real_root)
|
|
625
|
+
# Act
|
|
626
|
+
rendered_guidelines = cli.format_home_relative_path(cli.guidelines_dir())
|
|
627
|
+
rendered_templates = cli.format_home_relative_path(cli.templates_dir())
|
|
628
|
+
# Assert
|
|
629
|
+
self.assertEqual(rendered_guidelines, "~/resources/guidelines")
|
|
630
|
+
self.assertEqual(rendered_templates, "~/resources/templates")
|
|
631
|
+
|
|
632
|
+
def test_install_reports_guidelines_and_templates_compactly(self) -> None:
|
|
633
|
+
"""SRS-513/SRS-514/SRS-516/SRS-517: compact bare file-name resource report."""
|
|
634
|
+
# Arrange
|
|
635
|
+
self.guidelines.mkdir(parents=True, exist_ok=True)
|
|
636
|
+
(self.guidelines / "RFC2119.md").write_text("rfc\n", encoding="utf-8")
|
|
637
|
+
(self.guidelines / "Linked.md").symlink_to(self.guidelines / "RFC2119.md")
|
|
638
|
+
self.templates.mkdir(parents=True, exist_ok=True)
|
|
639
|
+
(self.templates / "Requirements_Template.md").write_text(
|
|
640
|
+
"tpl\n", encoding="utf-8"
|
|
641
|
+
)
|
|
642
|
+
expected_output = [
|
|
643
|
+
"Installation completed successfully in ~",
|
|
644
|
+
"Guidelines: ~/resources/guidelines/",
|
|
645
|
+
"RFC2119.md",
|
|
646
|
+
"Templates: ~/resources/templates/",
|
|
647
|
+
"Requirements_Template.md",
|
|
648
|
+
]
|
|
649
|
+
# Act
|
|
650
|
+
with patch("sys.stdout", new_callable=io.StringIO) as mock_stdout:
|
|
651
|
+
rc = self.run_cli(["--enable", "codex", "install"])
|
|
652
|
+
lines = mock_stdout.getvalue().splitlines()
|
|
653
|
+
# Assert
|
|
654
|
+
self.assertEqual(rc, 0)
|
|
655
|
+
for expected_line in expected_output:
|
|
656
|
+
self.assertIn(expected_line, lines)
|
|
657
|
+
self.assertNotIn("Linked.md", mock_stdout.getvalue())
|
|
658
|
+
self.assertNotIn(
|
|
659
|
+
"~/resources/guidelines/RFC2119.md", mock_stdout.getvalue()
|
|
660
|
+
)
|
|
661
|
+
|
|
662
|
+
def test_install_report_keeps_symlinked_resource_root_lexical(self) -> None:
|
|
663
|
+
"""SRS-515/SRS-517: printed resource paths never resolve symbolic links."""
|
|
664
|
+
# Arrange
|
|
665
|
+
real_root = self.HOME / "real-resources"
|
|
666
|
+
(real_root / "guidelines").mkdir(parents=True)
|
|
667
|
+
(real_root / "templates").mkdir(parents=True)
|
|
668
|
+
(real_root / "prompts").mkdir(parents=True)
|
|
669
|
+
shutil.rmtree(self.resource_root)
|
|
670
|
+
self.resource_root.symlink_to(real_root)
|
|
671
|
+
expected_output = [
|
|
672
|
+
"Guidelines: ~/resources/guidelines/",
|
|
673
|
+
"Templates: ~/resources/templates/",
|
|
674
|
+
]
|
|
675
|
+
# Act
|
|
676
|
+
with patch("sys.stdout", new_callable=io.StringIO) as mock_stdout:
|
|
677
|
+
rc = self.run_cli(["--enable", "codex", "install"])
|
|
678
|
+
lines = mock_stdout.getvalue().splitlines()
|
|
679
|
+
# Assert
|
|
680
|
+
self.assertEqual(rc, 0)
|
|
681
|
+
for expected_line in expected_output:
|
|
682
|
+
self.assertIn(expected_line, lines)
|
|
683
|
+
self.assertNotIn(str(real_root), mock_stdout.getvalue())
|
|
684
|
+
|
|
590
685
|
def test_install_does_not_copy_guidelines_into_project(self) -> None:
|
|
591
686
|
"""SRS-404: installation never writes guideline files into the project."""
|
|
592
687
|
project = Path(tempfile.mkdtemp(prefix="usereq-guidelines-"))
|
|
@@ -620,6 +715,20 @@ class TestDirectoryTokenSubstitution(HomeIsolatedTestCase):
|
|
|
620
715
|
self.assertIn("usereq/docs/REQUIREMENTS.md", content)
|
|
621
716
|
self.assertIn("`src/`", content)
|
|
622
717
|
|
|
718
|
+
def test_directory_tokens_render_configured_lexical_values(self) -> None:
|
|
719
|
+
"""SRS-506/SRS-507: configured directory values render without resolution."""
|
|
720
|
+
# Arrange
|
|
721
|
+
(self.HOME / "real-docs").mkdir()
|
|
722
|
+
(self.HOME / "docs").symlink_to(self.HOME / "real-docs")
|
|
723
|
+
cli.update_directory_config("docs", "tests", ["src"])
|
|
724
|
+
# Act
|
|
725
|
+
self.run_cli(["--enable", "claude", "install"])
|
|
726
|
+
skill = self.HOME / ".claude" / "skills" / "req-analyze" / "SKILL.md"
|
|
727
|
+
content = skill.read_text(encoding="utf-8")
|
|
728
|
+
# Assert
|
|
729
|
+
self.assertIn("docs/REQUIREMENTS.md", content)
|
|
730
|
+
self.assertNotIn("real-docs", content)
|
|
731
|
+
|
|
623
732
|
|
|
624
733
|
class TestPackagedTemplatesDirectory(unittest.TestCase):
|
|
625
734
|
"""SRS-495: packaged document templates resolve under resources/templates."""
|
|
@@ -1538,7 +1647,10 @@ class TestUpgradeUninstall(unittest.TestCase):
|
|
|
1538
1647
|
cli.run_upgrade()
|
|
1539
1648
|
mock_run.assert_called_once()
|
|
1540
1649
|
command = mock_run.call_args[0][0]
|
|
1541
|
-
self.assertEqual(
|
|
1650
|
+
self.assertEqual(
|
|
1651
|
+
command,
|
|
1652
|
+
["uv", "tool", "install", "cli-usereq"],
|
|
1653
|
+
)
|
|
1542
1654
|
|
|
1543
1655
|
def test_upgrade_with_github_on_linux_executes_uv_install_from_git(self) -> None:
|
|
1544
1656
|
"""SRS-440/SRS-452: GitHub upgrade pins the latest release tag on the git source."""
|
|
@@ -1558,7 +1670,6 @@ class TestUpgradeUninstall(unittest.TestCase):
|
|
|
1558
1670
|
"tool",
|
|
1559
1671
|
"install",
|
|
1560
1672
|
"cli-usereq",
|
|
1561
|
-
"--force",
|
|
1562
1673
|
"--from",
|
|
1563
1674
|
"git+https://github.com/Ogekuri/CLI-useReq.git@v9.9.9",
|
|
1564
1675
|
],
|
|
@@ -534,12 +534,51 @@ class TestOnlineUpdateCheck(unittest.TestCase):
|
|
|
534
534
|
)
|
|
535
535
|
|
|
536
536
|
def test_upgrade_command_installs_from_pypi_by_default(self) -> None:
|
|
537
|
-
"""Default upgrade command must
|
|
537
|
+
"""Default upgrade command must run the standard install without forcing (SRS-343)."""
|
|
538
538
|
result_mock = MagicMock(returncode=0)
|
|
539
539
|
|
|
540
540
|
with patch("usereq.cli.subprocess.run", return_value=result_mock) as run_mock:
|
|
541
541
|
cli.run_upgrade()
|
|
542
542
|
|
|
543
|
+
run_mock.assert_called_once_with(
|
|
544
|
+
[
|
|
545
|
+
"uv",
|
|
546
|
+
"tool",
|
|
547
|
+
"install",
|
|
548
|
+
cli.TOOL_PROGRAM_NAME,
|
|
549
|
+
],
|
|
550
|
+
check=False,
|
|
551
|
+
)
|
|
552
|
+
|
|
553
|
+
def test_upgrade_command_without_force_has_no_forcing_options(self) -> None:
|
|
554
|
+
"""Standard --upgrade must run the plain install/update process (SRS-343, SRS-508).
|
|
555
|
+
|
|
556
|
+
Without --force no uv forcing option (--force, --reinstall, --refresh)
|
|
557
|
+
may appear in the executed command.
|
|
558
|
+
"""
|
|
559
|
+
# Arrange
|
|
560
|
+
result_mock = MagicMock(returncode=0)
|
|
561
|
+
|
|
562
|
+
# Act
|
|
563
|
+
with patch("usereq.cli.subprocess.run", return_value=result_mock) as run_mock:
|
|
564
|
+
cli.run_upgrade()
|
|
565
|
+
|
|
566
|
+
# Assert
|
|
567
|
+
command = run_mock.call_args.args[0]
|
|
568
|
+
self.assertNotIn("--force", command)
|
|
569
|
+
self.assertNotIn("--reinstall", command)
|
|
570
|
+
self.assertNotIn("--refresh", command)
|
|
571
|
+
|
|
572
|
+
def test_upgrade_command_with_force_reinstalls_completely(self) -> None:
|
|
573
|
+
"""--upgrade --force must force download and full reinstallation (SRS-509)."""
|
|
574
|
+
# Arrange
|
|
575
|
+
result_mock = MagicMock(returncode=0)
|
|
576
|
+
|
|
577
|
+
# Act
|
|
578
|
+
with patch("usereq.cli.subprocess.run", return_value=result_mock) as run_mock:
|
|
579
|
+
cli.run_upgrade(force=True)
|
|
580
|
+
|
|
581
|
+
# Assert
|
|
543
582
|
run_mock.assert_called_once_with(
|
|
544
583
|
[
|
|
545
584
|
"uv",
|
|
@@ -547,6 +586,8 @@ class TestOnlineUpdateCheck(unittest.TestCase):
|
|
|
547
586
|
"install",
|
|
548
587
|
cli.TOOL_PROGRAM_NAME,
|
|
549
588
|
"--force",
|
|
589
|
+
"--reinstall",
|
|
590
|
+
"--refresh",
|
|
550
591
|
],
|
|
551
592
|
check=False,
|
|
552
593
|
)
|
|
@@ -584,6 +625,31 @@ class TestOnlineUpdateCheck(unittest.TestCase):
|
|
|
584
625
|
|
|
585
626
|
# Assert
|
|
586
627
|
fetch_mock.assert_called_once_with(raw_tag=True)
|
|
628
|
+
run_mock.assert_called_once_with(
|
|
629
|
+
[
|
|
630
|
+
"uv",
|
|
631
|
+
"tool",
|
|
632
|
+
"install",
|
|
633
|
+
cli.TOOL_PROGRAM_NAME,
|
|
634
|
+
"--from",
|
|
635
|
+
"git+https://github.com/Ogekuri/CLI-useReq.git@v9.9.9",
|
|
636
|
+
],
|
|
637
|
+
check=False,
|
|
638
|
+
)
|
|
639
|
+
|
|
640
|
+
def test_upgrade_command_with_github_and_force_reinstalls_completely(self) -> None:
|
|
641
|
+
"""--upgrade --develop --force must force reinstall of the GitHub tag (SRS-510)."""
|
|
642
|
+
# Arrange
|
|
643
|
+
result_mock = MagicMock(returncode=0)
|
|
644
|
+
|
|
645
|
+
# Act
|
|
646
|
+
with (
|
|
647
|
+
patch("usereq.cli.fetch_github_latest_version", return_value="v9.9.9"),
|
|
648
|
+
patch("usereq.cli.subprocess.run", return_value=result_mock) as run_mock,
|
|
649
|
+
):
|
|
650
|
+
cli.run_upgrade(use_github=True, force=True)
|
|
651
|
+
|
|
652
|
+
# Assert
|
|
587
653
|
run_mock.assert_called_once_with(
|
|
588
654
|
[
|
|
589
655
|
"uv",
|
|
@@ -591,12 +657,68 @@ class TestOnlineUpdateCheck(unittest.TestCase):
|
|
|
591
657
|
"install",
|
|
592
658
|
cli.TOOL_PROGRAM_NAME,
|
|
593
659
|
"--force",
|
|
660
|
+
"--reinstall",
|
|
661
|
+
"--refresh",
|
|
594
662
|
"--from",
|
|
595
663
|
"git+https://github.com/Ogekuri/CLI-useReq.git@v9.9.9",
|
|
596
664
|
],
|
|
597
665
|
check=False,
|
|
598
666
|
)
|
|
599
667
|
|
|
668
|
+
def test_upgrade_accepts_force_argument(self) -> None:
|
|
669
|
+
"""--upgrade must accept the auxiliary --force argument (SRS-508)."""
|
|
670
|
+
# Arrange / Act
|
|
671
|
+
args = cli.parse_args(["--upgrade", "--force"])
|
|
672
|
+
|
|
673
|
+
# Assert
|
|
674
|
+
self.assertTrue(args.upgrade)
|
|
675
|
+
self.assertTrue(args.force)
|
|
676
|
+
|
|
677
|
+
def test_upgrade_help_documents_force_argument(self) -> None:
|
|
678
|
+
"""Inline help must document --force as an auxiliary --upgrade argument (SRS-511)."""
|
|
679
|
+
# Arrange
|
|
680
|
+
parser = cli.build_parser()
|
|
681
|
+
|
|
682
|
+
# Act
|
|
683
|
+
with patch("sys.stdout", new_callable=io.StringIO) as mock_stdout:
|
|
684
|
+
with self.assertRaises(SystemExit):
|
|
685
|
+
parser.parse_args(["--help"])
|
|
686
|
+
|
|
687
|
+
# Assert
|
|
688
|
+
help_text = mock_stdout.getvalue()
|
|
689
|
+
self.assertIn("--force", help_text)
|
|
690
|
+
self.assertIn("--reinstall", help_text)
|
|
691
|
+
|
|
692
|
+
def test_main_upgrade_force_dispatches_forced_upgrade(self) -> None:
|
|
693
|
+
"""main must dispatch --upgrade --force with force=True (SRS-508, SRS-509)."""
|
|
694
|
+
# Arrange / Act
|
|
695
|
+
with (
|
|
696
|
+
patch("usereq.cli.maybe_notify_newer_version", autospec=True),
|
|
697
|
+
patch("usereq.cli.run_upgrade") as upgrade_mock,
|
|
698
|
+
patch("usereq.cli._maybe_auto_install_after_upgrade", autospec=True),
|
|
699
|
+
patch("sys.stdout"),
|
|
700
|
+
):
|
|
701
|
+
exit_code = cli.main(["--upgrade", "--force"])
|
|
702
|
+
|
|
703
|
+
# Assert
|
|
704
|
+
self.assertEqual(exit_code, 0)
|
|
705
|
+
upgrade_mock.assert_called_once_with(use_github=False, force=True)
|
|
706
|
+
|
|
707
|
+
def test_main_upgrade_develop_force_dispatches_forced_github_upgrade(self) -> None:
|
|
708
|
+
"""main must dispatch --upgrade --develop --force with both flags (SRS-510)."""
|
|
709
|
+
# Arrange / Act
|
|
710
|
+
with (
|
|
711
|
+
patch("usereq.cli.maybe_notify_newer_version", autospec=True),
|
|
712
|
+
patch("usereq.cli.run_upgrade") as upgrade_mock,
|
|
713
|
+
patch("usereq.cli._maybe_auto_install_after_upgrade", autospec=True),
|
|
714
|
+
patch("sys.stdout"),
|
|
715
|
+
):
|
|
716
|
+
exit_code = cli.main(["--upgrade", "--develop", "--force"])
|
|
717
|
+
|
|
718
|
+
# Assert
|
|
719
|
+
self.assertEqual(exit_code, 0)
|
|
720
|
+
upgrade_mock.assert_called_once_with(use_github=True, force=True)
|
|
721
|
+
|
|
600
722
|
def test_upgrade_command_with_github_fails_when_tag_unfetchable(self) -> None:
|
|
601
723
|
"""GitHub tag-resolution failure must raise ReqError code 1 without executing uv (SRS-453)."""
|
|
602
724
|
# Arrange
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/guidelines/Google_C++_Style_Guide.md
RENAMED
|
File without changes
|
{cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/guidelines/Google_Python_Style_Guide.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/templates/HDT_Test_Authoring_Guide.md
RENAMED
|
File without changes
|
{cli_usereq-0.75.0 → cli_usereq-0.75.1}/src/usereq/resources/templates/Requirements_Template.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|