csrd-utils 0.3.7__tar.gz → 0.3.8__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.
Files changed (51) hide show
  1. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/PKG-INFO +7 -3
  2. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/README.md +6 -2
  3. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/pyproject.toml +1 -1
  4. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/__main__.py +46 -30
  5. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/.gitignore +0 -0
  6. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/__init__.py +0 -0
  7. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/augmentor.py +0 -0
  8. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/doctor.py +0 -0
  9. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/features/workers/conftest.fragment.py +0 -0
  10. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/features/workers/docker-compose.fragment.yaml +0 -0
  11. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/features/workers/manifest.yaml +0 -0
  12. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/features/workers/requirements.fragment +0 -0
  13. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/features/workers/settings.fragment.py +0 -0
  14. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/features/workers/src/app/workers/__init__.py +0 -0
  15. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/features/workers/src/app/workers/celery_app.py +0 -0
  16. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/features/workers/src/app/workers/tasks.py +0 -0
  17. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/features/workers/tests/test_workers.py +0 -0
  18. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/fragments.py +0 -0
  19. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/generator.py +0 -0
  20. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/resources.py +0 -0
  21. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/README.md +0 -0
  22. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/cookiecutter.json +0 -0
  23. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/hooks/post_gen_project.py +0 -0
  24. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/.dockerignore +0 -0
  25. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/.env.example +0 -0
  26. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/Dockerfile +0 -0
  27. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/README.md +0 -0
  28. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/docker-compose.yml +0 -0
  29. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/requirements.txt +0 -0
  30. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/__init__.py +0 -0
  31. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/cache.py +0 -0
  32. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/delegates/__init__.py +0 -0
  33. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/delegates/upstreams.py +0 -0
  34. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/dependencies/__init__.py +0 -0
  35. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/dependencies/delegates.py +0 -0
  36. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/dependencies/item_repository.py +0 -0
  37. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/dependencies/worker_broker.py +0 -0
  38. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/middleware/__init__.py +0 -0
  39. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/middleware/logging.py +0 -0
  40. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/repositories/__init__.py +0 -0
  41. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/repositories/item_repository.py +0 -0
  42. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/settings.py +0 -0
  43. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/views/__init__.py +0 -0
  44. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/views/unversioned/__init__.py +0 -0
  45. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/views/unversioned/health_view.py +0 -0
  46. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/views/unversioned/items_view.py +0 -0
  47. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/workers/__init__.py +0 -0
  48. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/src/app/workers/tasks.py +0 -0
  49. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/tests/__init__.py +0 -0
  50. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/tests/conftest.py +0 -0
  51. {csrd_utils-0.3.7 → csrd_utils-0.3.8}/src/csrd_utils/templates/cookiecutter-service/{{cookiecutter.service_name}}/tests/test_items.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: csrd-utils
3
- Version: 0.3.7
3
+ Version: 0.3.8
4
4
  Summary: CLI utilities for csrd service generation and feature augmentation
5
5
  Project-URL: Repository, https://github.com/csrd-api/fastapi-common
6
6
  Project-URL: Documentation, https://github.com/csrd-api/fastapi-common/tree/main/packages/utils
@@ -26,7 +26,7 @@ pip install "csrd-utils @ git+https://github.com/csrd-api/fastapi-common.git#sub
26
26
  ```bash
27
27
  csrd --help
28
28
  csrd --version
29
- csrd new service # interactive prompts
29
+ csrd new service # compact interactive mode (prompts 1-6, then advanced gate)
30
30
  csrd new service --interactive --name items # pre-fills name prompt with 'items'
31
31
  csrd new service --name inventory --no-interactive --output .
32
32
  csrd feature list
@@ -40,10 +40,14 @@ csrd doctor --service .
40
40
 
41
41
  ### Interactive generation behavior
42
42
 
43
- - `csrd new service` runs interactive prompts by default.
43
+ - `csrd new service` runs a compact interactive flow by default (core prompts 1-6), then asks whether to show advanced options.
44
+ - In compact mode, advanced options are hidden by default.
45
+ - `csrd new service --interactive` runs the full verbose interactive flow.
44
46
  - Passing `--name <value>` in interactive mode uses that value as the name prompt default.
45
47
  - You can still overwrite the default by entering a different value at the prompt.
46
48
  - Use `--no-interactive` for fully flag-driven generation.
49
+ - Database default is `none`.
50
+ - All yes/no prompts default to `No` (`y/N`).
47
51
 
48
52
  ## Typical workflow
49
53
 
@@ -13,7 +13,7 @@ pip install "csrd-utils @ git+https://github.com/csrd-api/fastapi-common.git#sub
13
13
  ```bash
14
14
  csrd --help
15
15
  csrd --version
16
- csrd new service # interactive prompts
16
+ csrd new service # compact interactive mode (prompts 1-6, then advanced gate)
17
17
  csrd new service --interactive --name items # pre-fills name prompt with 'items'
18
18
  csrd new service --name inventory --no-interactive --output .
19
19
  csrd feature list
@@ -27,10 +27,14 @@ csrd doctor --service .
27
27
 
28
28
  ### Interactive generation behavior
29
29
 
30
- - `csrd new service` runs interactive prompts by default.
30
+ - `csrd new service` runs a compact interactive flow by default (core prompts 1-6), then asks whether to show advanced options.
31
+ - In compact mode, advanced options are hidden by default.
32
+ - `csrd new service --interactive` runs the full verbose interactive flow.
31
33
  - Passing `--name <value>` in interactive mode uses that value as the name prompt default.
32
34
  - You can still overwrite the default by entering a different value at the prompt.
33
35
  - Use `--no-interactive` for fully flag-driven generation.
36
+ - Database default is `none`.
37
+ - All yes/no prompts default to `No` (`y/N`).
34
38
 
35
39
  ## Typical workflow
36
40
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "csrd-utils"
3
- version = "0.3.7"
3
+ version = "0.3.8"
4
4
  description = "CLI utilities for csrd service generation and feature augmentation"
5
5
  license = { text = "MIT" }
6
6
  requires-python = ">=3.12"
@@ -70,6 +70,7 @@ def _prompt_int(label: str, default: int) -> int:
70
70
 
71
71
  def _collect_new_service_config(args: argparse.Namespace) -> GenerateServiceArgs:
72
72
  explicit_interactive = getattr(args, "interactive", None)
73
+ is_explicit_interactive = explicit_interactive is True
73
74
  interactive = (
74
75
  bool(explicit_interactive) if explicit_interactive is not None else args.name is None
75
76
  )
@@ -112,36 +113,51 @@ def _collect_new_service_config(args: argparse.Namespace) -> GenerateServiceArgs
112
113
  plural_default = f"{model_name.lower()}s"
113
114
  model_name_plural = _prompt_text("Model name plural", plural_default)
114
115
 
115
- database = _prompt_choice("Database", ["sqlite", "maria", "postgres", "none"], args.database)
116
- has_database = database != "none"
117
- selected_database = "sqlite" if not has_database else database
118
-
119
- has_delegates = _prompt_bool("Enable delegates", args.delegates)
120
- upstreams_default = args.upstreams
121
- if has_delegates and not upstreams_default:
122
- upstreams_default = "http://service-a:8080"
123
- upstreams = (
124
- _prompt_text("Delegates upstreams (comma-separated)", upstreams_default)
125
- if has_delegates
126
- else ""
127
- )
116
+ show_advanced = True
117
+ if not is_explicit_interactive:
118
+ show_advanced = _prompt_bool("Show advanced configuration options", False)
128
119
 
129
- has_workers = _prompt_bool("Enable workers", args.workers)
130
- broker = (
131
- _prompt_choice("Worker broker", ["redis", "rabbitmq"], args.broker)
132
- if has_workers
133
- else args.broker
134
- )
135
-
136
- has_caching = _prompt_bool("Enable caching", args.caching)
137
- cache_backend = (
138
- _prompt_choice("Cache backend", ["redis"], args.cache_backend)
139
- if has_caching
140
- else args.cache_backend
141
- )
120
+ if show_advanced:
121
+ database = _prompt_choice(
122
+ "Database", ["sqlite", "maria", "postgres", "none"], args.database
123
+ )
124
+ has_database = database != "none"
125
+ has_delegates = _prompt_bool("Enable delegates", False)
126
+ upstreams_default = args.upstreams
127
+ if has_delegates and not upstreams_default:
128
+ upstreams_default = "http://service-a:8080"
129
+ upstreams = (
130
+ _prompt_text("Delegates upstreams (comma-separated)", upstreams_default)
131
+ if has_delegates
132
+ else ""
133
+ )
134
+ has_workers = _prompt_bool("Enable workers", False)
135
+ broker = (
136
+ _prompt_choice("Worker broker", ["redis", "rabbitmq"], args.broker)
137
+ if has_workers
138
+ else args.broker
139
+ )
140
+ has_caching = _prompt_bool("Enable caching", False)
141
+ cache_backend = (
142
+ _prompt_choice("Cache backend", ["redis"], args.cache_backend)
143
+ if has_caching
144
+ else args.cache_backend
145
+ )
146
+ has_structured_logging = _prompt_bool("Enable structured logging", False)
147
+ overwrite_if_exists = _prompt_bool("Overwrite if target exists", False)
148
+ else:
149
+ database = args.database
150
+ has_database = database != "none"
151
+ has_delegates = args.delegates
152
+ upstreams = args.upstreams if has_delegates else ""
153
+ has_workers = args.workers
154
+ broker = args.broker
155
+ has_caching = args.caching
156
+ cache_backend = args.cache_backend
157
+ has_structured_logging = args.structured_logging
158
+ overwrite_if_exists = args.force
142
159
 
143
- has_structured_logging = _prompt_bool("Enable structured logging", args.structured_logging)
144
- overwrite_if_exists = _prompt_bool("Overwrite if target exists", args.force)
160
+ selected_database = "sqlite" if not has_database else database
145
161
 
146
162
  return GenerateServiceArgs(
147
163
  {
@@ -207,7 +223,7 @@ def _build_parser() -> argparse.ArgumentParser:
207
223
  service.add_argument("--model-name", default="Item", help="Primary model name")
208
224
  service.add_argument("--model-name-plural", default="items", help="Plural model name")
209
225
  service.add_argument(
210
- "--database", choices=["sqlite", "maria", "postgres", "none"], default="sqlite"
226
+ "--database", choices=["sqlite", "maria", "postgres", "none"], default="none"
211
227
  )
212
228
  service.add_argument("--delegates", action="store_true", help="Enable delegates")
213
229
  service.add_argument("--upstreams", default="", help="Comma-separated upstream URLs")
@@ -219,7 +235,7 @@ def _build_parser() -> argparse.ArgumentParser:
219
235
  "--structured-logging",
220
236
  dest="structured_logging",
221
237
  action="store_true",
222
- default=True,
238
+ default=False,
223
239
  help="Enable structured logging",
224
240
  )
225
241
  service.add_argument(
File without changes