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.
- womm/__init__.py +53 -0
- womm/__main__.py +48 -0
- womm/_version.py +10 -0
- womm/assets/copier/meta/copier.yml +15 -0
- womm/assets/copier/meta/template/README.md.jinja +32 -0
- womm/assets/copier/meta/template/copier.yml.jinja +13 -0
- womm/assets/copier/meta/template/template/.gitkeep +0 -0
- womm/assets/copier/official/javascript/copier.yml +104 -0
- womm/assets/copier/official/javascript/template/.gitignore.jinja +35 -0
- womm/assets/copier/official/javascript/template/.nvmrc.jinja +1 -0
- womm/assets/copier/official/javascript/template/.prettierignore.jinja +10 -0
- womm/assets/copier/official/javascript/template/README.md.jinja +81 -0
- womm/assets/copier/official/javascript/template/biome.json.jinja +54 -0
- womm/assets/copier/official/javascript/template/eslint.config.mjs.jinja +51 -0
- womm/assets/copier/official/javascript/template/index.html.jinja +12 -0
- womm/assets/copier/official/javascript/template/package.json.jinja +88 -0
- womm/assets/copier/official/javascript/template/prettier.config.mjs.jinja +8 -0
- womm/assets/copier/official/javascript/template/src/App.jsx.jinja +10 -0
- womm/assets/copier/official/javascript/template/src/App.tsx.jinja +10 -0
- womm/assets/copier/official/javascript/template/src/App.vue.jinja +18 -0
- womm/assets/copier/official/javascript/template/src/index.jsx.jinja +10 -0
- womm/assets/copier/official/javascript/template/src/index.tsx.jinja +11 -0
- womm/assets/copier/official/javascript/template/src/main.js.jinja +21 -0
- womm/assets/copier/official/javascript/template/src/main.ts.jinja +21 -0
- womm/assets/copier/official/javascript/template/tsconfig.json.jinja +35 -0
- womm/assets/copier/official/javascript/template/vite.config.mjs.jinja +10 -0
- womm/assets/copier/official/javascript/template/{% if with_ci %}.github{% endif %}/workflows/ci.yml.jinja +63 -0
- womm/assets/copier/official/javascript/template/{% if with_tests %}tests{% endif %}/smoke.test.js.jinja +12 -0
- womm/assets/copier/official/javascript/template/{% if with_tests %}tests{% endif %}/smoke.test.ts.jinja +12 -0
- womm/assets/copier/official/javascript/template/{% if with_vscode %}.vscode{% endif %}/extensions.json.jinja +4 -0
- womm/assets/copier/official/javascript/template/{% if with_vscode %}.vscode{% endif %}/settings.json.jinja +27 -0
- womm/assets/copier/official/python/copier.yml +107 -0
- womm/assets/copier/official/python/template/.gitignore.jinja +40 -0
- womm/assets/copier/official/python/template/.pre-commit-config.yaml.jinja +19 -0
- womm/assets/copier/official/python/template/.python-version.jinja +1 -0
- womm/assets/copier/official/python/template/README.md.jinja +83 -0
- womm/assets/copier/official/python/template/pyproject.toml.jinja +114 -0
- womm/assets/copier/official/python/template/{% if framework == 'django' %}manage.py{% endif %}.jinja +23 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/__init__.py.jinja +3 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/asgi.py.jinja +9 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/core/__init__.py.jinja +0 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/core/apps.py.jinja +10 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/core/models.py.jinja +1 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/core/views.py.jinja +8 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/py.typed +0 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/settings.py.jinja +81 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/urls.py.jinja +11 -0
- womm/assets/copier/official/python/template/{% if not use_src_layout %}{{ package_name }}{% endif %}/wsgi.py.jinja +9 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/__init__.py.jinja +3 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/asgi.py.jinja +9 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/core/__init__.py.jinja +0 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/core/apps.py.jinja +10 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/core/models.py.jinja +1 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/core/views.py.jinja +8 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/py.typed +0 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/settings.py.jinja +81 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/urls.py.jinja +11 -0
- womm/assets/copier/official/python/template/{% if use_src_layout %}src{% endif %}/{{ package_name }}/wsgi.py.jinja +9 -0
- womm/assets/copier/official/python/template/{% if with_ci %}.github{% endif %}/workflows/ci.yml.jinja +78 -0
- womm/assets/copier/official/python/template/{% if with_tests %}tests{% endif %}/test_smoke.py.jinja +16 -0
- womm/assets/copier/official/python/template/{% if with_vscode %}.vscode{% endif %}/extensions.json.jinja +8 -0
- womm/assets/copier/official/python/template/{% if with_vscode %}.vscode{% endif %}/settings.json.jinja +28 -0
- womm/bin/refresh_env.cmd +130 -0
- womm/cli.py +111 -0
- womm/commands/__init__.py +30 -0
- womm/commands/core/__init__.py +29 -0
- womm/commands/core/doctor.py +52 -0
- womm/commands/core/path.py +337 -0
- womm/commands/project/__init__.py +31 -0
- womm/commands/project/create.py +128 -0
- womm/commands/project/setup.py +438 -0
- womm/commands/project/template.py +160 -0
- womm/commands/system/__init__.py +31 -0
- womm/commands/system/context/__init__.py +82 -0
- womm/commands/system/context/backup.py +344 -0
- womm/commands/system/context/inventory.py +111 -0
- womm/commands/system/context/registration.py +290 -0
- womm/commands/system/deps.py +165 -0
- womm/commands/system/system.py +130 -0
- womm/exceptions/__init__.py +69 -0
- womm/exceptions/common/__init__.py +55 -0
- womm/exceptions/common/command_service.py +91 -0
- womm/exceptions/common/file_service.py +60 -0
- womm/exceptions/common/security_service.py +44 -0
- womm/exceptions/common/validation_service.py +70 -0
- womm/exceptions/context/__init__.py +27 -0
- womm/exceptions/context/context_service.py +55 -0
- womm/exceptions/project/__init__.py +29 -0
- womm/exceptions/project/project_service.py +59 -0
- womm/exceptions/system/__init__.py +25 -0
- womm/exceptions/system/system_service.py +53 -0
- womm/interfaces/__init__.py +71 -0
- womm/interfaces/context/__init__.py +34 -0
- womm/interfaces/context/menu_interface.py +686 -0
- womm/interfaces/context/registry_interface.py +562 -0
- womm/interfaces/context/script_detector_interface.py +208 -0
- womm/interfaces/context/script_registrar.py +264 -0
- womm/interfaces/core/__init__.py +26 -0
- womm/interfaces/core/doctor_interface.py +102 -0
- womm/interfaces/dependencies/__init__.py +28 -0
- womm/interfaces/dependencies/deps_interface.py +160 -0
- womm/interfaces/project/__init__.py +36 -0
- womm/interfaces/project/create_interface.py +162 -0
- womm/interfaces/project/detection_interface.py +181 -0
- womm/interfaces/project/manager_interface.py +99 -0
- womm/interfaces/project/setup_interface.py +477 -0
- womm/interfaces/project/template_store_interface.py +196 -0
- womm/interfaces/system/__init__.py +32 -0
- womm/interfaces/system/detector_interface.py +84 -0
- womm/interfaces/system/environment_interface.py +110 -0
- womm/interfaces/system/path_interface.py +570 -0
- womm/services/__init__.py +70 -0
- womm/services/common/__init__.py +33 -0
- womm/services/common/base_validation_service.py +450 -0
- womm/services/common/command_runner_service.py +647 -0
- womm/services/common/file_scanner_service.py +483 -0
- womm/services/common/security_validator_service.py +348 -0
- womm/services/context/__init__.py +37 -0
- womm/services/context/backup_entries.py +148 -0
- womm/services/context/parameters.py +515 -0
- womm/services/context/registry_paths.py +56 -0
- womm/services/context/registry_service.py +573 -0
- womm/services/context/validation_service.py +691 -0
- womm/services/dependencies/__init__.py +29 -0
- womm/services/dependencies/probe.py +102 -0
- womm/services/project/__init__.py +48 -0
- womm/services/project/copier_project_creation_service.py +111 -0
- womm/services/project/destination_guard.py +96 -0
- womm/services/project/detection_service.py +354 -0
- womm/services/project/env_utils.py +333 -0
- womm/services/project/javascript_environment_service.py +348 -0
- womm/services/project/python_environment_service.py +245 -0
- womm/services/project/setup_profile_resolver.py +146 -0
- womm/services/project/template_store_service.py +344 -0
- womm/services/project/validation_service.py +418 -0
- womm/services/system/__init__.py +32 -0
- womm/services/system/detector_service.py +704 -0
- womm/services/system/environment_service.py +494 -0
- womm/services/system/path_service.py +642 -0
- womm/shared/__init__.py +30 -0
- womm/shared/configs/__init__.py +51 -0
- womm/shared/configs/context/__init__.py +43 -0
- womm/shared/configs/context/context_config.py +125 -0
- womm/shared/configs/context/context_file_types_config.py +159 -0
- womm/shared/configs/context/context_limits_config.py +187 -0
- womm/shared/configs/context/context_paths_config.py +115 -0
- womm/shared/configs/context/context_types_config.py +65 -0
- womm/shared/configs/context/script_config.py +219 -0
- womm/shared/configs/dependencies/__init__.py +32 -0
- womm/shared/configs/dependencies/runtime_config.py +46 -0
- womm/shared/configs/dependencies/runtime_package_manager_config.py +48 -0
- womm/shared/configs/logging_config.py +89 -0
- womm/shared/configs/project/__init__.py +33 -0
- womm/shared/configs/project/project_config.py +109 -0
- womm/shared/configs/project/project_structure_config.py +88 -0
- womm/shared/configs/project/python_project_config.py +165 -0
- womm/shared/configs/security/__init__.py +26 -0
- womm/shared/configs/security/security_patterns_config.py +242 -0
- womm/shared/configs/system/__init__.py +28 -0
- womm/shared/configs/system/system_detector_config.py +210 -0
- womm/shared/configs/system/system_environment_config.py +101 -0
- womm/shared/models/__init__.py +13 -0
- womm/shared/models/template_source.py +65 -0
- womm/shared/paths.py +192 -0
- womm/shared/results/__init__.py +138 -0
- womm/shared/results/base.py +85 -0
- womm/shared/results/command_results.py +61 -0
- womm/shared/results/context_results.py +345 -0
- womm/shared/results/dependency_results.py +110 -0
- womm/shared/results/doctor_results.py +41 -0
- womm/shared/results/file_results.py +97 -0
- womm/shared/results/project_results.py +163 -0
- womm/shared/results/security_results.py +128 -0
- womm/shared/results/system_results.py +268 -0
- womm/shared/results/template_results.py +43 -0
- womm/shared/runtime.py +36 -0
- womm/ui/__init__.py +31 -0
- womm/ui/common/__init__.py +39 -0
- womm/ui/common/interactive_menu.py +246 -0
- womm/ui/common/logging.py +184 -0
- womm/ui/common/prompts.py +93 -0
- womm/ui/context/__init__.py +31 -0
- womm/ui/context/display.py +485 -0
- womm/ui/context/menu_display.py +189 -0
- womm/ui/context/wizard.py +557 -0
- womm/ui/project/__init__.py +42 -0
- womm/ui/project/create/create_completion_summaries.py +55 -0
- womm/ui/project/project_wizard.py +174 -0
- womm/ui/project/setup/setup_completion_summaries.py +111 -0
- womm/ui/project/templates/template_store_display.py +128 -0
- womm/ui/system/__init__.py +60 -0
- womm/ui/system/display.py +531 -0
- womm/ui/system/path_display.py +387 -0
- womm/utils/__init__.py +23 -0
- womm/utils/common/__init__.py +49 -0
- womm/utils/common/file_scanner_utils.py +110 -0
- womm/utils/common/path_resolver_utils.py +127 -0
- womm/utils/common/safe_fs_utils.py +135 -0
- womm/utils/context/__init__.py +54 -0
- womm/utils/context/core_utils.py +345 -0
- womm/utils/context/icon_utils.py +259 -0
- womm/utils/project/__init__.py +106 -0
- womm/utils/project/asset_utils.py +154 -0
- womm/utils/project/core_utils.py +391 -0
- womm/utils/project/file_utils.py +494 -0
- womm/utils/project/platform_utils.py +170 -0
- womm/utils/project/validation_utils.py +273 -0
- womm/utils/security/__init__.py +46 -0
- womm/utils/security/security_validation_utils.py +258 -0
- womm/utils/system/__init__.py +69 -0
- womm/utils/system/detector_utils.py +299 -0
- womm/utils/system/environment_utils.py +172 -0
- womm/utils/system/path_utils.py +101 -0
- womm_cli-4.0.0.dist-info/METADATA +203 -0
- womm_cli-4.0.0.dist-info/RECORD +218 -0
- womm_cli-4.0.0.dist-info/WHEEL +4 -0
- womm_cli-4.0.0.dist-info/entry_points.txt +2 -0
- womm_cli-4.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Models for the core starter app."""
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"""Views for the core starter app."""
|
|
2
|
+
|
|
3
|
+
from django.http import HttpRequest, HttpResponse
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def index(request: HttpRequest) -> HttpResponse:
|
|
7
|
+
"""Render a minimal landing page confirming the project is running."""
|
|
8
|
+
return HttpResponse("{{ project_name }} is running.")
|
|
File without changes
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"""Django settings for {{ project_name }}."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
7
|
+
|
|
8
|
+
SECRET_KEY = os.environ["DJANGO_SECRET_KEY"]
|
|
9
|
+
|
|
10
|
+
DEBUG = os.environ.get("DJANGO_DEBUG") == "1"
|
|
11
|
+
|
|
12
|
+
ALLOWED_HOSTS = [
|
|
13
|
+
host.strip()
|
|
14
|
+
for host in os.environ.get("DJANGO_ALLOWED_HOSTS", "").split(",")
|
|
15
|
+
if host.strip()
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
INSTALLED_APPS = [
|
|
19
|
+
"django.contrib.admin",
|
|
20
|
+
"django.contrib.auth",
|
|
21
|
+
"django.contrib.contenttypes",
|
|
22
|
+
"django.contrib.sessions",
|
|
23
|
+
"django.contrib.messages",
|
|
24
|
+
"django.contrib.staticfiles",
|
|
25
|
+
"{{ package_name }}.core",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
MIDDLEWARE = [
|
|
29
|
+
"django.middleware.security.SecurityMiddleware",
|
|
30
|
+
"django.contrib.sessions.middleware.SessionMiddleware",
|
|
31
|
+
"django.middleware.common.CommonMiddleware",
|
|
32
|
+
"django.middleware.csrf.CsrfViewMiddleware",
|
|
33
|
+
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
|
34
|
+
"django.contrib.messages.middleware.MessageMiddleware",
|
|
35
|
+
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
ROOT_URLCONF = "{{ package_name }}.urls"
|
|
39
|
+
|
|
40
|
+
TEMPLATES = [
|
|
41
|
+
{
|
|
42
|
+
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
43
|
+
"DIRS": [],
|
|
44
|
+
"APP_DIRS": True,
|
|
45
|
+
"OPTIONS": {
|
|
46
|
+
"context_processors": [
|
|
47
|
+
"django.template.context_processors.debug",
|
|
48
|
+
"django.template.context_processors.request",
|
|
49
|
+
"django.contrib.auth.context_processors.auth",
|
|
50
|
+
"django.contrib.messages.context_processors.messages",
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
WSGI_APPLICATION = "{{ package_name }}.wsgi.application"
|
|
57
|
+
|
|
58
|
+
DATABASES = {
|
|
59
|
+
"default": {
|
|
60
|
+
"ENGINE": "django.db.backends.sqlite3",
|
|
61
|
+
"NAME": BASE_DIR / "db.sqlite3",
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
AUTH_PASSWORD_VALIDATORS = [
|
|
66
|
+
{
|
|
67
|
+
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
|
68
|
+
},
|
|
69
|
+
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
|
|
70
|
+
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
|
|
71
|
+
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
LANGUAGE_CODE = "en-us"
|
|
75
|
+
TIME_ZONE = "UTC"
|
|
76
|
+
USE_I18N = True
|
|
77
|
+
USE_TZ = True
|
|
78
|
+
|
|
79
|
+
STATIC_URL = "static/"
|
|
80
|
+
|
|
81
|
+
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""URL configuration for {{ project_name }}."""
|
|
2
|
+
|
|
3
|
+
from django.contrib import admin
|
|
4
|
+
from django.urls import path
|
|
5
|
+
|
|
6
|
+
from {{ package_name }}.core.views import index
|
|
7
|
+
|
|
8
|
+
urlpatterns = [
|
|
9
|
+
path("admin/", admin.site.urls),
|
|
10
|
+
path("", index, name="index"),
|
|
11
|
+
]
|
|
File without changes
|
|
@@ -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"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Models for the core starter app."""
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"""Views for the core starter app."""
|
|
2
|
+
|
|
3
|
+
from django.http import HttpRequest, HttpResponse
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def index(request: HttpRequest) -> HttpResponse:
|
|
7
|
+
"""Render a minimal landing page confirming the project is running."""
|
|
8
|
+
return HttpResponse("{{ project_name }} is running.")
|
|
File without changes
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"""Django settings for {{ project_name }}."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
|
7
|
+
|
|
8
|
+
SECRET_KEY = os.environ["DJANGO_SECRET_KEY"]
|
|
9
|
+
|
|
10
|
+
DEBUG = os.environ.get("DJANGO_DEBUG") == "1"
|
|
11
|
+
|
|
12
|
+
ALLOWED_HOSTS = [
|
|
13
|
+
host.strip()
|
|
14
|
+
for host in os.environ.get("DJANGO_ALLOWED_HOSTS", "").split(",")
|
|
15
|
+
if host.strip()
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
INSTALLED_APPS = [
|
|
19
|
+
"django.contrib.admin",
|
|
20
|
+
"django.contrib.auth",
|
|
21
|
+
"django.contrib.contenttypes",
|
|
22
|
+
"django.contrib.sessions",
|
|
23
|
+
"django.contrib.messages",
|
|
24
|
+
"django.contrib.staticfiles",
|
|
25
|
+
"{{ package_name }}.core",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
MIDDLEWARE = [
|
|
29
|
+
"django.middleware.security.SecurityMiddleware",
|
|
30
|
+
"django.contrib.sessions.middleware.SessionMiddleware",
|
|
31
|
+
"django.middleware.common.CommonMiddleware",
|
|
32
|
+
"django.middleware.csrf.CsrfViewMiddleware",
|
|
33
|
+
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
|
34
|
+
"django.contrib.messages.middleware.MessageMiddleware",
|
|
35
|
+
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
ROOT_URLCONF = "{{ package_name }}.urls"
|
|
39
|
+
|
|
40
|
+
TEMPLATES = [
|
|
41
|
+
{
|
|
42
|
+
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
43
|
+
"DIRS": [],
|
|
44
|
+
"APP_DIRS": True,
|
|
45
|
+
"OPTIONS": {
|
|
46
|
+
"context_processors": [
|
|
47
|
+
"django.template.context_processors.debug",
|
|
48
|
+
"django.template.context_processors.request",
|
|
49
|
+
"django.contrib.auth.context_processors.auth",
|
|
50
|
+
"django.contrib.messages.context_processors.messages",
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
WSGI_APPLICATION = "{{ package_name }}.wsgi.application"
|
|
57
|
+
|
|
58
|
+
DATABASES = {
|
|
59
|
+
"default": {
|
|
60
|
+
"ENGINE": "django.db.backends.sqlite3",
|
|
61
|
+
"NAME": BASE_DIR / "db.sqlite3",
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
AUTH_PASSWORD_VALIDATORS = [
|
|
66
|
+
{
|
|
67
|
+
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
|
68
|
+
},
|
|
69
|
+
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
|
|
70
|
+
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
|
|
71
|
+
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
LANGUAGE_CODE = "en-us"
|
|
75
|
+
TIME_ZONE = "UTC"
|
|
76
|
+
USE_I18N = True
|
|
77
|
+
USE_TZ = True
|
|
78
|
+
|
|
79
|
+
STATIC_URL = "static/"
|
|
80
|
+
|
|
81
|
+
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""URL configuration for {{ project_name }}."""
|
|
2
|
+
|
|
3
|
+
from django.contrib import admin
|
|
4
|
+
from django.urls import path
|
|
5
|
+
|
|
6
|
+
from {{ package_name }}.core.views import index
|
|
7
|
+
|
|
8
|
+
urlpatterns = [
|
|
9
|
+
path("admin/", admin.site.urls),
|
|
10
|
+
path("", index, name="index"),
|
|
11
|
+
]
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
permissions:
|
|
4
|
+
contents: read
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [main]
|
|
9
|
+
pull_request:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ubuntu-24.04
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
python-version: [{% if python_version == "3.13" %}"3.13", {% endif %}"3.14"]
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
19
|
+
{%- if use_uv %}
|
|
20
|
+
- name: Set up uv
|
|
21
|
+
uses: astral-sh/setup-uv@18d369b23da25a81e9458561248e1aafff6a70fa # v10.3.1
|
|
22
|
+
with:
|
|
23
|
+
python-version: {% raw %}${{ matrix.python-version }}{% endraw %}
|
|
24
|
+
enable-cache: true
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: uv sync --locked --group dev
|
|
27
|
+
- name: Lint
|
|
28
|
+
run: uv run --no-sync ruff check .
|
|
29
|
+
- name: Format check
|
|
30
|
+
run: uv run --no-sync ruff format --check .
|
|
31
|
+
- name: Type check
|
|
32
|
+
run: uv run --no-sync ty check .
|
|
33
|
+
{%- if framework == "django" %}
|
|
34
|
+
- name: Set Django secret key
|
|
35
|
+
run: echo "DJANGO_SECRET_KEY=$(python -c 'import secrets; print(secrets.token_urlsafe(50))')" >> "$GITHUB_ENV"
|
|
36
|
+
{%- endif %}
|
|
37
|
+
{%- if with_tests %}
|
|
38
|
+
- name: Test
|
|
39
|
+
run: uv run --no-sync pytest
|
|
40
|
+
{%- endif %}
|
|
41
|
+
{%- if framework == "django" %}
|
|
42
|
+
- name: Django check
|
|
43
|
+
run: uv run --no-sync python manage.py check
|
|
44
|
+
{%- endif %}
|
|
45
|
+
- name: Build
|
|
46
|
+
run: uv build
|
|
47
|
+
{%- else %}
|
|
48
|
+
- name: Set up Python
|
|
49
|
+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
50
|
+
with:
|
|
51
|
+
python-version: {% raw %}${{ matrix.python-version }}{% endraw %}
|
|
52
|
+
- name: Install dependencies
|
|
53
|
+
run: |
|
|
54
|
+
python -m pip install --upgrade "pip>=25.1"
|
|
55
|
+
python -m pip install -e . --group dev
|
|
56
|
+
- name: Lint
|
|
57
|
+
run: ruff check .
|
|
58
|
+
- name: Format check
|
|
59
|
+
run: ruff format --check .
|
|
60
|
+
- name: Type check
|
|
61
|
+
run: ty check .
|
|
62
|
+
{%- if framework == "django" %}
|
|
63
|
+
- name: Set Django secret key
|
|
64
|
+
run: echo "DJANGO_SECRET_KEY=$(python -c 'import secrets; print(secrets.token_urlsafe(50))')" >> "$GITHUB_ENV"
|
|
65
|
+
{%- endif %}
|
|
66
|
+
{%- if with_tests %}
|
|
67
|
+
- name: Test
|
|
68
|
+
run: pytest
|
|
69
|
+
{%- endif %}
|
|
70
|
+
{%- if framework == "django" %}
|
|
71
|
+
- name: Django check
|
|
72
|
+
run: python manage.py check
|
|
73
|
+
{%- endif %}
|
|
74
|
+
- name: Build
|
|
75
|
+
run: |
|
|
76
|
+
python -m pip install "build>=1.2"
|
|
77
|
+
python -m build
|
|
78
|
+
{%- endif %}
|
womm/assets/copier/official/python/template/{% if with_tests %}tests{% endif %}/test_smoke.py.jinja
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Smoke tests for {{ project_name }}."""
|
|
2
|
+
|
|
3
|
+
from {{ package_name }} import __version__
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_version_is_defined() -> None:
|
|
7
|
+
"""The package exposes a non-empty ``__version__`` string."""
|
|
8
|
+
assert __version__ is not None
|
|
9
|
+
assert isinstance(__version__, str)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_package_is_importable() -> None:
|
|
13
|
+
"""The package imports without raising."""
|
|
14
|
+
import {{ package_name }}
|
|
15
|
+
|
|
16
|
+
assert {{ package_name }} is not None
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"[python]": {
|
|
3
|
+
"editor.codeActionsOnSave": {
|
|
4
|
+
"source.fixAll.ruff": "explicit",
|
|
5
|
+
"source.organizeImports.ruff": "explicit"
|
|
6
|
+
},
|
|
7
|
+
"editor.defaultFormatter": "charliermarsh.ruff",
|
|
8
|
+
"editor.formatOnSave": true,
|
|
9
|
+
"editor.rulers": [88]
|
|
10
|
+
},
|
|
11
|
+
"files.exclude": {
|
|
12
|
+
"**/.pytest_cache": true,
|
|
13
|
+
"**/.ruff_cache": true,
|
|
14
|
+
"**/__pycache__": true,
|
|
15
|
+
"**/.venv": true
|
|
16
|
+
},
|
|
17
|
+
"search.exclude": {
|
|
18
|
+
"**/.pytest_cache": true,
|
|
19
|
+
"**/.ruff_cache": true,
|
|
20
|
+
"**/__pycache__": true
|
|
21
|
+
},
|
|
22
|
+
"files.insertFinalNewline": true,
|
|
23
|
+
"files.trimTrailingWhitespace": true,
|
|
24
|
+
"python.analysis.typeCheckingMode": "off",
|
|
25
|
+
"python.defaultInterpreterPath": "${workspaceFolder}/.venv",
|
|
26
|
+
"python.testing.pytestEnabled": {{ "true" if with_tests else "false" }},
|
|
27
|
+
"python.testing.unittestEnabled": false
|
|
28
|
+
}
|
womm/bin/refresh_env.cmd
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
:: Code generously provided by @beatcracker: https://github.com/beatcracker/detect-batch-subshell
|
|
2
|
+
@echo off
|
|
3
|
+
|
|
4
|
+
setlocal EnableDelayedExpansion
|
|
5
|
+
|
|
6
|
+
:: Dequote path to command processor and this script path
|
|
7
|
+
set ScriptPath=%~0
|
|
8
|
+
set CmdPath=%COMSPEC:"=%
|
|
9
|
+
|
|
10
|
+
:: Get command processor filename and filename with extension
|
|
11
|
+
for %%c in (!CmdPath!) do (
|
|
12
|
+
set CmdExeName=%%~nxc
|
|
13
|
+
set CmdName=%%~nc
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
:: Get this process' PID
|
|
17
|
+
:: Adapted from: http://www.dostips.com/forum/viewtopic.php?p=22675#p22675
|
|
18
|
+
set "uid="
|
|
19
|
+
for /l %%i in (1 1 128) do (
|
|
20
|
+
set /a "bit=!random!&1"
|
|
21
|
+
set "uid=!uid!!bit!"
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
for /f "tokens=2 delims==" %%i in (
|
|
25
|
+
'wmic Process WHERE "Name='!CmdExeName!' AND CommandLine LIKE '%%!uid!%%'" GET ParentProcessID /value'
|
|
26
|
+
) do (
|
|
27
|
+
rem Get commandline of parent
|
|
28
|
+
for /f "tokens=1,2,*" %%j in (
|
|
29
|
+
'wmic Process WHERE "Handle='%%i'" GET CommandLine /value'
|
|
30
|
+
) do (
|
|
31
|
+
|
|
32
|
+
rem Strip extra CR's from wmic output
|
|
33
|
+
rem http://www.dostips.com/forum/viewtopic.php?t=4266
|
|
34
|
+
for /f "delims=" %%x in ("%%l") do (
|
|
35
|
+
rem Dequote path to batch file, if any (3rd argument)
|
|
36
|
+
set ParentScriptPath=%%x
|
|
37
|
+
set ParentScriptPath=!ParentScriptPath:"=!
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
rem Get parent process path
|
|
41
|
+
for /f "tokens=2 delims==" %%y in ("%%j") do (
|
|
42
|
+
rem Dequote parent path
|
|
43
|
+
set ParentPath=%%y
|
|
44
|
+
set ParentPath=!ParentPath:"=!
|
|
45
|
+
|
|
46
|
+
rem Handle different invocations: C:\Windows\system32\cmd.exe , cmd.exe , cmd
|
|
47
|
+
for %%p in (!CmdPath! !CmdExeName! !CmdName!) do (
|
|
48
|
+
if !ParentPath!==%%p set IsCmdParent=1
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
rem Check if we're running in cmd.exe with /c switch and this script path as argument
|
|
52
|
+
if !IsCmdParent!==1 if %%k==/c if "!ParentScriptPath!"=="%ScriptPath%" set IsExternal=1
|
|
53
|
+
)
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
if !IsExternal!==1 (
|
|
58
|
+
echo %~nx0 does not work when run from this process. If you're in PowerShell, please 'Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1' and try again.
|
|
59
|
+
exit 1
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
endlocal
|
|
63
|
+
:: End code from @beatcracker
|
|
64
|
+
@echo off
|
|
65
|
+
::
|
|
66
|
+
:: RefreshEnv.cmd
|
|
67
|
+
::
|
|
68
|
+
:: Batch file to read environment variables from registry and
|
|
69
|
+
:: set session variables to these values.
|
|
70
|
+
::
|
|
71
|
+
:: With this batch file, there should be no need to reload command
|
|
72
|
+
:: environment every time you want environment changes to propagate
|
|
73
|
+
|
|
74
|
+
::echo "RefreshEnv.cmd only works from cmd.exe, please install the Chocolatey Profile to take advantage of refreshenv from PowerShell"
|
|
75
|
+
echo | set /p dummy="Refreshing environment variables from registry for cmd.exe. Please wait..."
|
|
76
|
+
|
|
77
|
+
goto main
|
|
78
|
+
|
|
79
|
+
:: Set one environment variable from registry key
|
|
80
|
+
:SetFromReg
|
|
81
|
+
"%WinDir%\System32\Reg" QUERY "%~1" /v "%~2" > "%TEMP%\_envset.tmp" 2>NUL
|
|
82
|
+
for /f "usebackq skip=2 tokens=2,*" %%A IN ("%TEMP%\_envset.tmp") do (
|
|
83
|
+
echo/set "%~3=%%B"
|
|
84
|
+
)
|
|
85
|
+
goto :EOF
|
|
86
|
+
|
|
87
|
+
:: Get a list of environment variables from registry
|
|
88
|
+
:GetRegEnv
|
|
89
|
+
"%WinDir%\System32\Reg" QUERY "%~1" > "%TEMP%\_envget.tmp"
|
|
90
|
+
for /f "usebackq skip=2" %%A IN ("%TEMP%\_envget.tmp") do (
|
|
91
|
+
if /I not "%%~A"=="Path" (
|
|
92
|
+
call :SetFromReg "%~1" "%%~A" "%%~A"
|
|
93
|
+
)
|
|
94
|
+
)
|
|
95
|
+
goto :EOF
|
|
96
|
+
|
|
97
|
+
:main
|
|
98
|
+
echo/@echo off >"%TEMP%\_env.cmd"
|
|
99
|
+
|
|
100
|
+
:: Slowly generating final file
|
|
101
|
+
call :GetRegEnv "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" >> "%TEMP%\_env.cmd"
|
|
102
|
+
call :GetRegEnv "HKCU\Environment" >> "%TEMP%\_env.cmd"
|
|
103
|
+
|
|
104
|
+
:: Special handling for PATH - mix both User and System
|
|
105
|
+
call :SetFromReg "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" Path Path_HKLM >> "%TEMP%\_env.cmd"
|
|
106
|
+
call :SetFromReg "HKCU\Environment" Path Path_HKCU >> "%TEMP%\_env.cmd"
|
|
107
|
+
|
|
108
|
+
:: Caution: do not insert space-chars before >> redirection sign
|
|
109
|
+
echo/set "Path=%%Path_HKLM%%;%%Path_HKCU%%" >> "%TEMP%\_env.cmd"
|
|
110
|
+
|
|
111
|
+
:: Cleanup
|
|
112
|
+
del /f /q "%TEMP%\_envset.tmp" 2>nul
|
|
113
|
+
del /f /q "%TEMP%\_envget.tmp" 2>nul
|
|
114
|
+
|
|
115
|
+
:: capture user / architecture
|
|
116
|
+
SET "OriginalUserName=%USERNAME%"
|
|
117
|
+
SET "OriginalArchitecture=%PROCESSOR_ARCHITECTURE%"
|
|
118
|
+
|
|
119
|
+
:: Set these variables
|
|
120
|
+
call "%TEMP%\_env.cmd"
|
|
121
|
+
|
|
122
|
+
:: Cleanup
|
|
123
|
+
del /f /q "%TEMP%\_env.cmd" 2>nul
|
|
124
|
+
|
|
125
|
+
:: reset user / architecture
|
|
126
|
+
SET "USERNAME=%OriginalUserName%"
|
|
127
|
+
SET "PROCESSOR_ARCHITECTURE=%OriginalArchitecture%"
|
|
128
|
+
|
|
129
|
+
echo | set /p dummy="Finished."
|
|
130
|
+
echo .
|
womm/cli.py
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# ///////////////////////////////////////////////////////////////
|
|
3
|
+
# WOMM CLI - Main CLI Entry Point
|
|
4
|
+
# Project: works-on-my-machine
|
|
5
|
+
# ///////////////////////////////////////////////////////////////
|
|
6
|
+
|
|
7
|
+
"""Click entry point for Works On My Machine."""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
# ///////////////////////////////////////////////////////////////
|
|
12
|
+
# IMPORTS
|
|
13
|
+
# ///////////////////////////////////////////////////////////////
|
|
14
|
+
# Standard library imports
|
|
15
|
+
import os
|
|
16
|
+
import sys
|
|
17
|
+
|
|
18
|
+
# Third-party imports
|
|
19
|
+
import click
|
|
20
|
+
|
|
21
|
+
# Local imports
|
|
22
|
+
from ._version import __version__
|
|
23
|
+
from .commands.core import doctor_cmd, path_group
|
|
24
|
+
from .commands.project import create_command, setup_group, template_group
|
|
25
|
+
from .commands.system import context_group, deps_group, system_group
|
|
26
|
+
from .ui.common import ezprinter
|
|
27
|
+
|
|
28
|
+
# ///////////////////////////////////////////////////////////////
|
|
29
|
+
# CONSOLE CONFIGURATION
|
|
30
|
+
# ///////////////////////////////////////////////////////////////
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _configure_windows_console() -> None:
|
|
34
|
+
"""Configure existing Windows console streams for UTF-8 output."""
|
|
35
|
+
if sys.platform != "win32":
|
|
36
|
+
return
|
|
37
|
+
|
|
38
|
+
os.environ["PYTHONIOENCODING"] = "utf-8"
|
|
39
|
+
for stream in (sys.stdout, sys.stderr):
|
|
40
|
+
reconfigure = getattr(stream, "reconfigure", None)
|
|
41
|
+
if reconfigure is not None:
|
|
42
|
+
reconfigure(encoding="utf-8")
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
_configure_windows_console()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# ///////////////////////////////////////////////////////////////
|
|
49
|
+
# MAIN CLI FUNCTION
|
|
50
|
+
# ///////////////////////////////////////////////////////////////
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@click.group(invoke_without_command=True)
|
|
54
|
+
@click.help_option("-h", "--help")
|
|
55
|
+
@click.version_option(version=__version__)
|
|
56
|
+
@click.pass_context
|
|
57
|
+
def womm(ctx: click.Context) -> None:
|
|
58
|
+
"""🛠️ Works On My Machine - Universal development tools."""
|
|
59
|
+
if ctx.invoked_subcommand is None:
|
|
60
|
+
ezprinter.console.print(r"""
|
|
61
|
+
================================================================================
|
|
62
|
+
__ _____ __ __ __ __
|
|
63
|
+
\ \ / / _ \| \/ | \/ |
|
|
64
|
+
\ \/\/ / (_) | |\/| | |\/| |
|
|
65
|
+
\_/\_/ \___/|_| |_|_| |_|
|
|
66
|
+
================================================================================
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
""")
|
|
70
|
+
panel = ezprinter.create_info_panel(
|
|
71
|
+
"Welcome",
|
|
72
|
+
"\n".join(
|
|
73
|
+
[
|
|
74
|
+
"Universal development tools for Python and JavaScript projects.",
|
|
75
|
+
"",
|
|
76
|
+
"Features:",
|
|
77
|
+
"• Cross-platform project setup and configuration",
|
|
78
|
+
"• Security validation and safe execution",
|
|
79
|
+
"• Beautiful terminal interface with Rich",
|
|
80
|
+
"• Global command access",
|
|
81
|
+
]
|
|
82
|
+
),
|
|
83
|
+
)
|
|
84
|
+
ezprinter.console.print(panel)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
# ///////////////////////////////////////////////////////////////
|
|
88
|
+
# COMMAND REGISTRATION
|
|
89
|
+
# ///////////////////////////////////////////////////////////////
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
for command in (
|
|
93
|
+
doctor_cmd,
|
|
94
|
+
path_group,
|
|
95
|
+
create_command,
|
|
96
|
+
system_group,
|
|
97
|
+
context_group,
|
|
98
|
+
setup_group,
|
|
99
|
+
template_group,
|
|
100
|
+
deps_group,
|
|
101
|
+
):
|
|
102
|
+
womm.add_command(command)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def main() -> None:
|
|
106
|
+
"""Run the WOMM command-line interface."""
|
|
107
|
+
womm()
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
if __name__ == "__main__":
|
|
111
|
+
main()
|