womm-cli 4.0.0__py3-none-any.whl

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 (218) hide show
  1. womm/__init__.py +53 -0
  2. womm/__main__.py +48 -0
  3. womm/_version.py +10 -0
  4. womm/assets/copier/meta/copier.yml +15 -0
  5. womm/assets/copier/meta/template/README.md.jinja +32 -0
  6. womm/assets/copier/meta/template/copier.yml.jinja +13 -0
  7. womm/assets/copier/meta/template/template/.gitkeep +0 -0
  8. womm/assets/copier/official/javascript/copier.yml +104 -0
  9. womm/assets/copier/official/javascript/template/.gitignore.jinja +35 -0
  10. womm/assets/copier/official/javascript/template/.nvmrc.jinja +1 -0
  11. womm/assets/copier/official/javascript/template/.prettierignore.jinja +10 -0
  12. womm/assets/copier/official/javascript/template/README.md.jinja +81 -0
  13. womm/assets/copier/official/javascript/template/biome.json.jinja +54 -0
  14. womm/assets/copier/official/javascript/template/eslint.config.mjs.jinja +51 -0
  15. womm/assets/copier/official/javascript/template/index.html.jinja +12 -0
  16. womm/assets/copier/official/javascript/template/package.json.jinja +88 -0
  17. womm/assets/copier/official/javascript/template/prettier.config.mjs.jinja +8 -0
  18. womm/assets/copier/official/javascript/template/src/App.jsx.jinja +10 -0
  19. womm/assets/copier/official/javascript/template/src/App.tsx.jinja +10 -0
  20. womm/assets/copier/official/javascript/template/src/App.vue.jinja +18 -0
  21. womm/assets/copier/official/javascript/template/src/index.jsx.jinja +10 -0
  22. womm/assets/copier/official/javascript/template/src/index.tsx.jinja +11 -0
  23. womm/assets/copier/official/javascript/template/src/main.js.jinja +21 -0
  24. womm/assets/copier/official/javascript/template/src/main.ts.jinja +21 -0
  25. womm/assets/copier/official/javascript/template/tsconfig.json.jinja +35 -0
  26. womm/assets/copier/official/javascript/template/vite.config.mjs.jinja +10 -0
  27. womm/assets/copier/official/javascript/template/{% if with_ci %}.github{% endif %}/workflows/ci.yml.jinja +63 -0
  28. womm/assets/copier/official/javascript/template/{% if with_tests %}tests{% endif %}/smoke.test.js.jinja +12 -0
  29. womm/assets/copier/official/javascript/template/{% if with_tests %}tests{% endif %}/smoke.test.ts.jinja +12 -0
  30. womm/assets/copier/official/javascript/template/{% if with_vscode %}.vscode{% endif %}/extensions.json.jinja +4 -0
  31. womm/assets/copier/official/javascript/template/{% if with_vscode %}.vscode{% endif %}/settings.json.jinja +27 -0
  32. womm/assets/copier/official/python/copier.yml +107 -0
  33. womm/assets/copier/official/python/template/.gitignore.jinja +40 -0
  34. womm/assets/copier/official/python/template/.pre-commit-config.yaml.jinja +19 -0
  35. womm/assets/copier/official/python/template/.python-version.jinja +1 -0
  36. womm/assets/copier/official/python/template/README.md.jinja +83 -0
  37. womm/assets/copier/official/python/template/pyproject.toml.jinja +114 -0
  38. womm/assets/copier/official/python/template/{% if framework == 'django' %}manage.py{% endif %}.jinja +23 -0
  39. womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/__init__.py.jinja +3 -0
  40. womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/asgi.py.jinja +9 -0
  41. womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/core/__init__.py.jinja +0 -0
  42. womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/core/apps.py.jinja +10 -0
  43. womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/core/models.py.jinja +1 -0
  44. womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/core/views.py.jinja +8 -0
  45. womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/py.typed +0 -0
  46. womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/settings.py.jinja +81 -0
  47. womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/urls.py.jinja +11 -0
  48. womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/wsgi.py.jinja +9 -0
  49. womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/__init__.py.jinja +3 -0
  50. womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/asgi.py.jinja +9 -0
  51. womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/core/__init__.py.jinja +0 -0
  52. womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/core/apps.py.jinja +10 -0
  53. womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/core/models.py.jinja +1 -0
  54. womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/core/views.py.jinja +8 -0
  55. womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/py.typed +0 -0
  56. womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/settings.py.jinja +81 -0
  57. womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/urls.py.jinja +11 -0
  58. womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/wsgi.py.jinja +9 -0
  59. womm/assets/copier/official/python/template/{% if with_ci %}.github{% endif %}/workflows/ci.yml.jinja +78 -0
  60. womm/assets/copier/official/python/template/{% if with_tests %}tests{% endif %}/test_smoke.py.jinja +16 -0
  61. womm/assets/copier/official/python/template/{% if with_vscode %}.vscode{% endif %}/extensions.json.jinja +8 -0
  62. womm/assets/copier/official/python/template/{% if with_vscode %}.vscode{% endif %}/settings.json.jinja +28 -0
  63. womm/bin/refresh_env.cmd +130 -0
  64. womm/cli.py +111 -0
  65. womm/commands/__init__.py +30 -0
  66. womm/commands/core/__init__.py +29 -0
  67. womm/commands/core/doctor.py +52 -0
  68. womm/commands/core/path.py +337 -0
  69. womm/commands/project/__init__.py +31 -0
  70. womm/commands/project/create.py +128 -0
  71. womm/commands/project/setup.py +438 -0
  72. womm/commands/project/template.py +160 -0
  73. womm/commands/system/__init__.py +31 -0
  74. womm/commands/system/context/__init__.py +82 -0
  75. womm/commands/system/context/backup.py +344 -0
  76. womm/commands/system/context/inventory.py +111 -0
  77. womm/commands/system/context/registration.py +290 -0
  78. womm/commands/system/deps.py +165 -0
  79. womm/commands/system/system.py +130 -0
  80. womm/exceptions/__init__.py +69 -0
  81. womm/exceptions/common/__init__.py +55 -0
  82. womm/exceptions/common/command_service.py +91 -0
  83. womm/exceptions/common/file_service.py +60 -0
  84. womm/exceptions/common/security_service.py +44 -0
  85. womm/exceptions/common/validation_service.py +70 -0
  86. womm/exceptions/context/__init__.py +27 -0
  87. womm/exceptions/context/context_service.py +55 -0
  88. womm/exceptions/project/__init__.py +29 -0
  89. womm/exceptions/project/project_service.py +59 -0
  90. womm/exceptions/system/__init__.py +25 -0
  91. womm/exceptions/system/system_service.py +53 -0
  92. womm/interfaces/__init__.py +71 -0
  93. womm/interfaces/context/__init__.py +34 -0
  94. womm/interfaces/context/menu_interface.py +686 -0
  95. womm/interfaces/context/registry_interface.py +562 -0
  96. womm/interfaces/context/script_detector_interface.py +208 -0
  97. womm/interfaces/context/script_registrar.py +264 -0
  98. womm/interfaces/core/__init__.py +26 -0
  99. womm/interfaces/core/doctor_interface.py +102 -0
  100. womm/interfaces/dependencies/__init__.py +28 -0
  101. womm/interfaces/dependencies/deps_interface.py +160 -0
  102. womm/interfaces/project/__init__.py +36 -0
  103. womm/interfaces/project/create_interface.py +162 -0
  104. womm/interfaces/project/detection_interface.py +181 -0
  105. womm/interfaces/project/manager_interface.py +99 -0
  106. womm/interfaces/project/setup_interface.py +477 -0
  107. womm/interfaces/project/template_store_interface.py +196 -0
  108. womm/interfaces/system/__init__.py +32 -0
  109. womm/interfaces/system/detector_interface.py +84 -0
  110. womm/interfaces/system/environment_interface.py +110 -0
  111. womm/interfaces/system/path_interface.py +570 -0
  112. womm/services/__init__.py +70 -0
  113. womm/services/common/__init__.py +33 -0
  114. womm/services/common/base_validation_service.py +450 -0
  115. womm/services/common/command_runner_service.py +647 -0
  116. womm/services/common/file_scanner_service.py +483 -0
  117. womm/services/common/security_validator_service.py +348 -0
  118. womm/services/context/__init__.py +37 -0
  119. womm/services/context/backup_entries.py +148 -0
  120. womm/services/context/parameters.py +515 -0
  121. womm/services/context/registry_paths.py +56 -0
  122. womm/services/context/registry_service.py +573 -0
  123. womm/services/context/validation_service.py +691 -0
  124. womm/services/dependencies/__init__.py +29 -0
  125. womm/services/dependencies/probe.py +102 -0
  126. womm/services/project/__init__.py +48 -0
  127. womm/services/project/copier_project_creation_service.py +111 -0
  128. womm/services/project/destination_guard.py +96 -0
  129. womm/services/project/detection_service.py +354 -0
  130. womm/services/project/env_utils.py +333 -0
  131. womm/services/project/javascript_environment_service.py +348 -0
  132. womm/services/project/python_environment_service.py +245 -0
  133. womm/services/project/setup_profile_resolver.py +146 -0
  134. womm/services/project/template_store_service.py +344 -0
  135. womm/services/project/validation_service.py +418 -0
  136. womm/services/system/__init__.py +32 -0
  137. womm/services/system/detector_service.py +704 -0
  138. womm/services/system/environment_service.py +494 -0
  139. womm/services/system/path_service.py +642 -0
  140. womm/shared/__init__.py +30 -0
  141. womm/shared/configs/__init__.py +51 -0
  142. womm/shared/configs/context/__init__.py +43 -0
  143. womm/shared/configs/context/context_config.py +125 -0
  144. womm/shared/configs/context/context_file_types_config.py +159 -0
  145. womm/shared/configs/context/context_limits_config.py +187 -0
  146. womm/shared/configs/context/context_paths_config.py +115 -0
  147. womm/shared/configs/context/context_types_config.py +65 -0
  148. womm/shared/configs/context/script_config.py +219 -0
  149. womm/shared/configs/dependencies/__init__.py +32 -0
  150. womm/shared/configs/dependencies/runtime_config.py +46 -0
  151. womm/shared/configs/dependencies/runtime_package_manager_config.py +48 -0
  152. womm/shared/configs/logging_config.py +89 -0
  153. womm/shared/configs/project/__init__.py +33 -0
  154. womm/shared/configs/project/project_config.py +109 -0
  155. womm/shared/configs/project/project_structure_config.py +88 -0
  156. womm/shared/configs/project/python_project_config.py +165 -0
  157. womm/shared/configs/security/__init__.py +26 -0
  158. womm/shared/configs/security/security_patterns_config.py +242 -0
  159. womm/shared/configs/system/__init__.py +28 -0
  160. womm/shared/configs/system/system_detector_config.py +210 -0
  161. womm/shared/configs/system/system_environment_config.py +101 -0
  162. womm/shared/models/__init__.py +13 -0
  163. womm/shared/models/template_source.py +65 -0
  164. womm/shared/paths.py +192 -0
  165. womm/shared/results/__init__.py +138 -0
  166. womm/shared/results/base.py +85 -0
  167. womm/shared/results/command_results.py +61 -0
  168. womm/shared/results/context_results.py +345 -0
  169. womm/shared/results/dependency_results.py +110 -0
  170. womm/shared/results/doctor_results.py +41 -0
  171. womm/shared/results/file_results.py +97 -0
  172. womm/shared/results/project_results.py +163 -0
  173. womm/shared/results/security_results.py +128 -0
  174. womm/shared/results/system_results.py +268 -0
  175. womm/shared/results/template_results.py +43 -0
  176. womm/shared/runtime.py +36 -0
  177. womm/ui/__init__.py +31 -0
  178. womm/ui/common/__init__.py +39 -0
  179. womm/ui/common/interactive_menu.py +246 -0
  180. womm/ui/common/logging.py +184 -0
  181. womm/ui/common/prompts.py +93 -0
  182. womm/ui/context/__init__.py +31 -0
  183. womm/ui/context/display.py +485 -0
  184. womm/ui/context/menu_display.py +189 -0
  185. womm/ui/context/wizard.py +557 -0
  186. womm/ui/project/__init__.py +42 -0
  187. womm/ui/project/create/create_completion_summaries.py +55 -0
  188. womm/ui/project/project_wizard.py +174 -0
  189. womm/ui/project/setup/setup_completion_summaries.py +111 -0
  190. womm/ui/project/templates/template_store_display.py +128 -0
  191. womm/ui/system/__init__.py +60 -0
  192. womm/ui/system/display.py +531 -0
  193. womm/ui/system/path_display.py +387 -0
  194. womm/utils/__init__.py +23 -0
  195. womm/utils/common/__init__.py +49 -0
  196. womm/utils/common/file_scanner_utils.py +110 -0
  197. womm/utils/common/path_resolver_utils.py +127 -0
  198. womm/utils/common/safe_fs_utils.py +135 -0
  199. womm/utils/context/__init__.py +54 -0
  200. womm/utils/context/core_utils.py +345 -0
  201. womm/utils/context/icon_utils.py +259 -0
  202. womm/utils/project/__init__.py +106 -0
  203. womm/utils/project/asset_utils.py +154 -0
  204. womm/utils/project/core_utils.py +391 -0
  205. womm/utils/project/file_utils.py +494 -0
  206. womm/utils/project/platform_utils.py +170 -0
  207. womm/utils/project/validation_utils.py +273 -0
  208. womm/utils/security/__init__.py +46 -0
  209. womm/utils/security/security_validation_utils.py +258 -0
  210. womm/utils/system/__init__.py +69 -0
  211. womm/utils/system/detector_utils.py +299 -0
  212. womm/utils/system/environment_utils.py +172 -0
  213. womm/utils/system/path_utils.py +101 -0
  214. womm_cli-4.0.0.dist-info/METADATA +203 -0
  215. womm_cli-4.0.0.dist-info/RECORD +218 -0
  216. womm_cli-4.0.0.dist-info/WHEEL +4 -0
  217. womm_cli-4.0.0.dist-info/entry_points.txt +2 -0
  218. womm_cli-4.0.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <div id="app">
3
+ <h1>Welcome to {{ "{{" }} projectName {{ "}}" }}</h1>
4
+ <p>{{ "{{" }} description {{ "}}" }}</p>
5
+ </div>
6
+ </template>
7
+
8
+ <script{% if typescript %} lang="ts"{% endif %}>
9
+ export default {
10
+ name: "App",
11
+ data() {
12
+ return {
13
+ projectName: "{{ project_name }}",
14
+ description: {{ description | tojson }},
15
+ };
16
+ },
17
+ };
18
+ </script>
@@ -0,0 +1,10 @@
1
+ import { StrictMode } from "react";
2
+ import { createRoot } from "react-dom/client";
3
+ import App from "./App";
4
+
5
+ const root = createRoot(document.getElementById("root"));
6
+ root.render(
7
+ <StrictMode>
8
+ <App />
9
+ </StrictMode>,
10
+ );
@@ -0,0 +1,11 @@
1
+ import { StrictMode } from "react";
2
+ import { createRoot } from "react-dom/client";
3
+ import App from "./App";
4
+
5
+ const container = document.getElementById("root") as HTMLElement;
6
+ const root = createRoot(container);
7
+ root.render(
8
+ <StrictMode>
9
+ <App />
10
+ </StrictMode>,
11
+ );
@@ -0,0 +1,21 @@
1
+ {%- if framework == "vue" -%}
2
+ import { createApp } from "vue";
3
+ import App from "./App.vue";
4
+
5
+ createApp(App).mount("#app");
6
+ {%- else -%}
7
+ import { pathToFileURL } from "node:url";
8
+
9
+ /**
10
+ * Main entry point for {{ project_name }}.
11
+ */
12
+
13
+ export function main() {
14
+ console.log("Hello from {{ project_name }}!");
15
+ return 0;
16
+ }
17
+
18
+ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
19
+ process.exitCode = main();
20
+ }
21
+ {%- endif %}
@@ -0,0 +1,21 @@
1
+ {%- if framework == "vue" -%}
2
+ import { createApp } from "vue";
3
+ import App from "./App.vue";
4
+
5
+ createApp(App).mount("#app");
6
+ {%- else -%}
7
+ import { pathToFileURL } from "node:url";
8
+
9
+ /**
10
+ * Main entry point for {{ project_name }}.
11
+ */
12
+
13
+ export function main(): number {
14
+ console.log("Hello from {{ project_name }}!");
15
+ return 0;
16
+ }
17
+
18
+ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
19
+ process.exitCode = main();
20
+ }
21
+ {%- endif %}
@@ -0,0 +1,35 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "lib": ["ES2022"{% if framework in ("react", "vue") %}, "DOM", "DOM.Iterable"{% endif %}],
5
+ "module": "{% if framework == 'none' %}NodeNext{% else %}ESNext{% endif %}",
6
+ "moduleResolution": "{% if framework == 'none' %}NodeNext{% else %}Bundler{% endif %}",
7
+ {%- if framework == "react" %}
8
+ "jsx": "react-jsx",
9
+ {%- elif framework == "vue" %}
10
+ "jsx": "preserve",
11
+ {%- endif %}
12
+ {%- if framework == "none" %}
13
+ "outDir": "./dist",
14
+ "rootDir": "./src",
15
+ "sourceMap": true,
16
+ {%- else %}
17
+ "noEmit": true,
18
+ "types": ["vite/client"{% if with_tests %}, "vitest/globals"{% endif %}],
19
+ {%- endif %}
20
+ "esModuleInterop": true,
21
+ "forceConsistentCasingInFileNames": true,
22
+ "isolatedModules": true,
23
+ "resolveJsonModule": true,
24
+ "strict": true,
25
+ "noImplicitReturns": true,
26
+ "noUnusedLocals": true,
27
+ "noUnusedParameters": true,
28
+ "skipLibCheck": true
29
+ },
30
+ {# shortcut: with framework "none" the tests are not type-checked, because this
31
+ tsconfig emits to dist/ with rootDir src/; add a tests/tsconfig.json if the
32
+ test suite grows beyond smoke tests. #}
33
+ "include": ["src/**/*"{% if with_tests and framework != "none" %}, "tests/**/*"{% endif %}{% if framework == "vue" %}, "src/**/*.vue"{% endif %}],
34
+ "exclude": ["coverage", "dist", "node_modules"]
35
+ }
@@ -0,0 +1,10 @@
1
+ {% if framework == "react" -%}
2
+ import react from "@vitejs/plugin-react";
3
+ {% else -%}
4
+ import vue from "@vitejs/plugin-vue";
5
+ {% endif %}
6
+ import { defineConfig } from "vite";
7
+
8
+ export default defineConfig({
9
+ plugins: [{% if framework == "react" %}react{% else %}vue{% endif %}()],
10
+ });
@@ -0,0 +1,63 @@
1
+ {%- set run = "npm run" if package_manager == "npm" else package_manager if package_manager in ("pnpm", "yarn") else "bun run" -%}
2
+ name: CI
3
+
4
+ on:
5
+ push:
6
+ branches: [main]
7
+ pull_request:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ quality:
14
+ runs-on: ubuntu-24.04
15
+ {%- if package_manager != "bun" %}
16
+ strategy:
17
+ matrix:
18
+ node-version: [24, 26]
19
+ {%- endif %}
20
+ steps:
21
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
22
+ {%- if package_manager == "bun" %}
23
+ - name: Set up Bun
24
+ uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
25
+ {%- else %}
26
+ - name: Set up Node.js
27
+ uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
28
+ with:
29
+ node-version: {% raw %}${{ matrix.node-version }}{% endraw %}
30
+ package-manager-cache: false
31
+ {%- if package_manager in ("pnpm", "yarn") %}
32
+ - name: Enable Corepack
33
+ run: |
34
+ if ! command -v corepack >/dev/null; then
35
+ npm install --global corepack@0.36.0
36
+ fi
37
+ corepack enable
38
+ {%- endif %}
39
+ {%- endif %}
40
+ - name: Install dependencies
41
+ {%- if package_manager == "npm" %}
42
+ run: npm ci
43
+ {%- elif package_manager == "pnpm" %}
44
+ run: pnpm install --frozen-lockfile
45
+ {%- elif package_manager == "yarn" %}
46
+ run: yarn install --immutable
47
+ {%- else %}
48
+ run: bun install --frozen-lockfile
49
+ {%- endif %}
50
+ - name: Format check
51
+ run: {{ run }} format:check
52
+ - name: Lint
53
+ run: {{ run }} lint
54
+ {%- if typescript %}
55
+ - name: Type check
56
+ run: {{ run }} type-check
57
+ {%- endif %}
58
+ {%- if with_tests %}
59
+ - name: Test
60
+ run: {{ run }} test
61
+ {%- endif %}
62
+ - name: Build
63
+ run: {{ run }} build
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Smoke test for {{ project_name }}.
3
+ */
4
+
5
+ import { describe, expect, it } from "vitest";
6
+ import packageJson from "../package.json" with { type: "json" };
7
+
8
+ describe("{{ project_name }}", () => {
9
+ it("has a name matching the package manifest", () => {
10
+ expect(packageJson.name).toBe("{{ project_name }}");
11
+ });
12
+ });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Smoke test for {{ project_name }}.
3
+ */
4
+
5
+ import { describe, expect, it } from "vitest";
6
+ import packageJson from "../package.json" with { type: "json" };
7
+
8
+ describe("{{ project_name }}", () => {
9
+ it("has a name matching the package manifest", () => {
10
+ expect(packageJson.name).toBe("{{ project_name }}");
11
+ });
12
+ });
@@ -0,0 +1,4 @@
1
+ {%- set use_biome = framework != "vue" -%}
2
+ {
3
+ "recommendations": [{% if use_biome %}"biomejs.biome"{% else %}"dbaeumer.vscode-eslint", "esbenp.prettier-vscode"{% endif %}{% if framework == "vue" %}, "vue.volar"{% endif %}{% if with_tests %}, "vitest.explorer"{% endif %}]
4
+ }
@@ -0,0 +1,27 @@
1
+ {%- set use_biome = framework != "vue" -%}
2
+ {
3
+ "editor.codeActionsOnSave": {
4
+ {%- if use_biome %}
5
+ "source.fixAll.biome": "explicit",
6
+ "source.organizeImports.biome": "explicit"
7
+ {%- else %}
8
+ "source.fixAll.eslint": "explicit"
9
+ {%- endif %}
10
+ },
11
+ "editor.defaultFormatter": "{% if use_biome %}biomejs.biome{% else %}esbenp.prettier-vscode{% endif %}",
12
+ "editor.formatOnSave": true,
13
+ "editor.rulers": [100],
14
+ "files.exclude": {
15
+ "**/coverage": true,
16
+ "**/dist": true,
17
+ "**/node_modules": true
18
+ },
19
+ "files.insertFinalNewline": true,
20
+ "files.trimTrailingWhitespace": true,
21
+ "search.exclude": {
22
+ "**/coverage": true,
23
+ "**/dist": true,
24
+ "**/node_modules": true
25
+ },
26
+ "typescript.tsdk": "node_modules/typescript/lib"
27
+ }
@@ -0,0 +1,107 @@
1
+ _womm:
2
+ description: "Python project (optional Django)"
3
+ version: "2.0.0"
4
+ setup:
5
+ language: python
6
+
7
+ _subdirectory: template
8
+
9
+ project_name:
10
+ type: str
11
+ help: "Project name"
12
+
13
+ package_name:
14
+ type: str
15
+ help: "Importable package name"
16
+ default: "{{ project_name | lower | replace('-', '_') | replace(' ', '_') }}"
17
+
18
+ description:
19
+ type: str
20
+ help: "One-line project description"
21
+ default: "A Python project"
22
+
23
+ author_name:
24
+ type: str
25
+ help: "Author name"
26
+ default: ""
27
+
28
+ use_src_layout:
29
+ type: bool
30
+ help: "Use a src/ layout"
31
+ default: true
32
+
33
+ python_version:
34
+ type: str
35
+ help: "Minimum Python version"
36
+ choices:
37
+ - "3.13"
38
+ - "3.14"
39
+ default: "3.13"
40
+
41
+ use_uv:
42
+ type: bool
43
+ help: "Use uv for dependency management, venv and task running"
44
+ default: true
45
+
46
+ framework:
47
+ type: str
48
+ help: "Framework"
49
+ choices:
50
+ - none
51
+ - django
52
+ default: none
53
+
54
+ with_tests:
55
+ type: bool
56
+ help: "Include a pytest setup"
57
+ default: true
58
+
59
+ with_ci:
60
+ type: bool
61
+ help: "Include a GitHub Actions workflow"
62
+ default: true
63
+
64
+ with_vscode:
65
+ type: bool
66
+ help: "Include shared VS Code settings"
67
+ default: true
68
+
69
+ license:
70
+ type: str
71
+ help: "License"
72
+ choices:
73
+ - MIT
74
+ - Apache-2.0
75
+ - proprietary
76
+ default: MIT
77
+
78
+ # manage.py always sits at the project root, independent of use_src_layout.
79
+ # The package-level Django files mirror both possible layout roots; only the
80
+ # one matching use_src_layout ever exists at render time, so listing both is
81
+ # harmless when the other one wasn't rendered in the first place.
82
+ _exclude:
83
+ - "copier.yaml"
84
+ - "copier.yml"
85
+ - "~*"
86
+ - "*.py[co]"
87
+ - "__pycache__"
88
+ - ".git"
89
+ - ".DS_Store"
90
+ - ".svn"
91
+ - "{% if framework != 'django' %}manage.py{% endif %}"
92
+ - "{% if framework != 'django' %}src/{{ package_name }}/settings.py{% endif %}"
93
+ - "{% if framework != 'django' %}src/{{ package_name }}/urls.py{% endif %}"
94
+ - "{% if framework != 'django' %}src/{{ package_name }}/wsgi.py{% endif %}"
95
+ - "{% if framework != 'django' %}src/{{ package_name }}/asgi.py{% endif %}"
96
+ - "{% if framework != 'django' %}src/{{ package_name }}/core/__init__.py{% endif %}"
97
+ - "{% if framework != 'django' %}src/{{ package_name }}/core/apps.py{% endif %}"
98
+ - "{% if framework != 'django' %}src/{{ package_name }}/core/models.py{% endif %}"
99
+ - "{% if framework != 'django' %}src/{{ package_name }}/core/views.py{% endif %}"
100
+ - "{% if framework != 'django' %}{{ package_name }}/settings.py{% endif %}"
101
+ - "{% if framework != 'django' %}{{ package_name }}/urls.py{% endif %}"
102
+ - "{% if framework != 'django' %}{{ package_name }}/wsgi.py{% endif %}"
103
+ - "{% if framework != 'django' %}{{ package_name }}/asgi.py{% endif %}"
104
+ - "{% if framework != 'django' %}{{ package_name }}/core/__init__.py{% endif %}"
105
+ - "{% if framework != 'django' %}{{ package_name }}/core/apps.py{% endif %}"
106
+ - "{% if framework != 'django' %}{{ package_name }}/core/models.py{% endif %}"
107
+ - "{% if framework != 'django' %}{{ package_name }}/core/views.py{% endif %}"
@@ -0,0 +1,40 @@
1
+ # Byte-compiled files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Distribution and build artifacts
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ .eggs/
11
+
12
+ # Virtual environments
13
+ .venv/
14
+ venv/
15
+ env/
16
+
17
+ # Tooling caches
18
+ .mypy_cache/
19
+ .ruff_cache/
20
+ .pytest_cache/
21
+ .coverage
22
+ coverage.xml
23
+ htmlcov/
24
+
25
+ # Editors
26
+ .idea/
27
+ {%- if not with_vscode %}
28
+ .vscode/
29
+ {%- endif %}
30
+
31
+ # Environment files
32
+ .env
33
+ .env.local
34
+ {%- if framework == "django" %}
35
+
36
+ # Django
37
+ db.sqlite3
38
+ db.sqlite3-journal
39
+ staticfiles/
40
+ {%- endif %}
@@ -0,0 +1,19 @@
1
+ repos:
2
+ - repo: local
3
+ hooks:
4
+ - id: ruff-check
5
+ name: ruff check
6
+ entry: {% if use_uv %}uv run ruff check --fix{% else %}ruff check --fix{% endif %}
7
+ language: system
8
+ types: [python]
9
+ - id: ruff-format
10
+ name: ruff format
11
+ entry: {% if use_uv %}uv run ruff format{% else %}ruff format{% endif %}
12
+ language: system
13
+ types: [python]
14
+ - id: ty
15
+ name: ty check
16
+ entry: {% if use_uv %}uv run ty check{% else %}ty check{% endif %}
17
+ language: system
18
+ pass_filenames: false
19
+ types: [python]
@@ -0,0 +1 @@
1
+ {{ python_version }}
@@ -0,0 +1,83 @@
1
+ # {{ project_name }}
2
+
3
+ {{ description }}
4
+ {%- if author_name %}
5
+
6
+ Author: {{ author_name }}
7
+ {%- endif %}
8
+
9
+ ## Installation
10
+
11
+ {%- if use_uv %}
12
+
13
+ ```bash
14
+ uv sync --group dev
15
+ ```
16
+
17
+ Commit the generated `uv.lock` before pushing: CI checks that it matches
18
+ `pyproject.toml` and installs the locked dependencies.
19
+ {%- else %}
20
+
21
+ ```bash
22
+ python -m venv .venv
23
+ .venv/Scripts/activate # Windows
24
+ source .venv/bin/activate # Linux and macOS
25
+ python -m pip install --upgrade "pip>=25.1"
26
+ python -m pip install -e . --group dev
27
+ ```
28
+ {%- endif %}
29
+
30
+ {% if framework == "django" %}
31
+ ## Django configuration
32
+
33
+ Set `DJANGO_SECRET_KEY` to a unique secret in your environment before running
34
+ management commands. Set `DJANGO_DEBUG=1` only for local development; production
35
+ defaults to debug off. Set `DJANGO_ALLOWED_HOSTS` to a comma-separated list of
36
+ hostnames before deployment, then run `python manage.py check --deploy`.
37
+
38
+ {% endif %}
39
+
40
+ ## Layout
41
+
42
+ ```text
43
+ {%- if use_src_layout %}
44
+ src/{{ package_name }}/ Package source
45
+ {%- else %}
46
+ {{ package_name }}/ Package source
47
+ {%- endif %}
48
+ {%- if with_tests %}
49
+ tests/ Test suite
50
+ {%- endif %}
51
+ ```
52
+ {%- if with_tests %}
53
+
54
+ ## Tests
55
+
56
+ ```bash
57
+ {%- if use_uv %}
58
+ uv run pytest
59
+ {%- else %}
60
+ pytest
61
+ {%- endif %}
62
+ ```
63
+ {%- endif %}
64
+
65
+ ## Quality
66
+
67
+ ```bash
68
+ {%- if use_uv %}
69
+ uv run ruff check .
70
+ uv run ruff format --check .
71
+ uv run ty check .
72
+ uv run pre-commit install
73
+ {%- else %}
74
+ ruff check .
75
+ ruff format --check .
76
+ ty check .
77
+ pre-commit install
78
+ {%- endif %}
79
+ ```
80
+
81
+ ## License
82
+
83
+ {{ license }}
@@ -0,0 +1,114 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "{{ project_name }}"
7
+ dynamic = ["version"]
8
+ description = {{ description | tojson }}
9
+ readme = "README.md"
10
+ license = "{{ 'LicenseRef-Proprietary' if license == 'proprietary' else license }}"
11
+ {%- if author_name %}
12
+ authors = [{ name = "{{ author_name }}" }]
13
+ maintainers = [{ name = "{{ author_name }}" }]
14
+ {%- endif %}
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Developers",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: {{ python_version }}",
21
+ "Topic :: Software Development :: Libraries :: Python Modules",
22
+ ]
23
+ requires-python = ">={{ python_version }}"
24
+ dependencies = [
25
+ {%- if framework == "django" %}
26
+ "django>=5.2.8",
27
+ {%- endif %}
28
+ ]
29
+
30
+ [dependency-groups]
31
+ dev = [
32
+ "ruff>=0.5.0",
33
+ "ty>=0.0.13",
34
+ "pre-commit>=3.0.0",
35
+ {%- if with_tests %}
36
+ "pytest>=7.0.0",
37
+ "pytest-cov>=4.0.0",
38
+ {%- endif %}
39
+ {%- if with_tests and framework == "django" %}
40
+ "pytest-django>=4.8.0",
41
+ {%- endif %}
42
+ {%- if framework == "django" %}
43
+ "django-stubs>=5.0.0",
44
+ {%- endif %}
45
+ ]
46
+
47
+ [tool.hatch.version]
48
+ {%- if use_src_layout %}
49
+ path = "src/{{ package_name }}/__init__.py"
50
+ {%- else %}
51
+ path = "{{ package_name }}/__init__.py"
52
+ {%- endif %}
53
+
54
+ [tool.hatch.build.targets.wheel]
55
+ {%- if use_src_layout %}
56
+ packages = ["src/{{ package_name }}"]
57
+ {%- else %}
58
+ packages = ["{{ package_name }}"]
59
+ {%- endif %}
60
+
61
+ [tool.ruff]
62
+ target-version = "py{{ python_version | replace('.', '') }}"
63
+ line-length = 88
64
+
65
+ [tool.ruff.lint]
66
+ select = ["E", "W", "F", "I", "B", "C4", "UP", "SIM", "N", "ANN", "RUF"]
67
+ ignore = ["E501"]
68
+
69
+ [tool.ruff.format]
70
+ quote-style = "double"
71
+ docstring-code-format = true
72
+
73
+ [tool.ty.environment]
74
+ python-version = "{{ python_version }}"
75
+ {%- if use_src_layout %}
76
+ root = ["src"]
77
+ {%- else %}
78
+ root = ["."]
79
+ {%- endif %}
80
+
81
+ [tool.ty.src]
82
+ {%- if use_src_layout %}
83
+ include = ["src/{{ package_name }}"]
84
+ {%- else %}
85
+ include = ["{{ package_name }}"]
86
+ {%- endif %}
87
+ respect-ignore-files = true
88
+ {%- if with_tests %}
89
+
90
+ [tool.pytest.ini_options]
91
+ minversion = "7.0"
92
+ addopts = ["--strict-markers", "--strict-config"]
93
+ testpaths = ["tests"]
94
+ python_files = ["test_*.py"]
95
+ python_functions = ["test_*"]
96
+ {%- if framework == "django" %}
97
+ DJANGO_SETTINGS_MODULE = "{{ package_name }}.settings"
98
+ {%- endif %}
99
+
100
+ [tool.coverage.run]
101
+ {%- if use_src_layout %}
102
+ source = ["src/{{ package_name }}"]
103
+ {%- else %}
104
+ source = ["{{ package_name }}"]
105
+ {%- endif %}
106
+ branch = true
107
+
108
+ [tool.coverage.report]
109
+ exclude_lines = [
110
+ "pragma: no cover",
111
+ "if TYPE_CHECKING:",
112
+ "raise NotImplementedError",
113
+ ]
114
+ {%- endif %}
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env python
2
+ """Django's command-line utility for administrative tasks."""
3
+
4
+ import os
5
+ import sys
6
+
7
+
8
+ def main() -> None:
9
+ """Run administrative tasks."""
10
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ package_name }}.settings")
11
+ try:
12
+ from django.core.management import execute_from_command_line
13
+ except ImportError as exc:
14
+ raise ImportError(
15
+ "Couldn't import Django. Are you sure it's installed and "
16
+ "available on your PYTHONPATH environment variable? Did you "
17
+ "forget to activate a virtual environment?"
18
+ ) from exc
19
+ execute_from_command_line(sys.argv)
20
+
21
+
22
+ if __name__ == "__main__":
23
+ main()
@@ -0,0 +1,9 @@
1
+ """ASGI config for {{ project_name }}."""
2
+
3
+ import os
4
+
5
+ from django.core.asgi import get_asgi_application
6
+
7
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ package_name }}.settings")
8
+
9
+ application = get_asgi_application()
@@ -0,0 +1,10 @@
1
+ """App configuration for the core starter app."""
2
+
3
+ from django.apps import AppConfig
4
+
5
+
6
+ class CoreConfig(AppConfig):
7
+ """Configuration for the {{ package_name }}.core app."""
8
+
9
+ default_auto_field = "django.db.models.BigAutoField"
10
+ name = "{{ package_name }}.core"