moltpy 0.1.0__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.
- moltpy-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
- moltpy-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- moltpy-0.1.0/.github/ISSUE_TEMPLATE/module_proposal.md +26 -0
- moltpy-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +30 -0
- moltpy-0.1.0/.github/workflows/ci.yml +71 -0
- moltpy-0.1.0/.github/workflows/release.yml +36 -0
- moltpy-0.1.0/.gitignore +62 -0
- moltpy-0.1.0/.hypothesis/.gitignore +9 -0
- moltpy-0.1.0/.hypothesis/constants/04ccad45c547ba0d +4 -0
- moltpy-0.1.0/.hypothesis/constants/32d48f415bb3914c +4 -0
- moltpy-0.1.0/.hypothesis/constants/34257138be99f921 +4 -0
- moltpy-0.1.0/.hypothesis/constants/34a945045c8f5e1c +4 -0
- moltpy-0.1.0/.hypothesis/constants/67b0a8ccf18bf5d2 +4 -0
- moltpy-0.1.0/.hypothesis/constants/7333d4e14de2dcfe +4 -0
- moltpy-0.1.0/.hypothesis/constants/79232dc5a8b150ab +4 -0
- moltpy-0.1.0/.hypothesis/constants/7fa87bd09966148a +4 -0
- moltpy-0.1.0/.hypothesis/constants/86a2776199f98a65 +4 -0
- moltpy-0.1.0/.hypothesis/constants/90804030db72529a +4 -0
- moltpy-0.1.0/.hypothesis/constants/94a22bcc563fcd2c +4 -0
- moltpy-0.1.0/.hypothesis/constants/dcfc11e80df68bc7 +4 -0
- moltpy-0.1.0/.hypothesis/constants/f7f0660e4e4feaa9 +4 -0
- moltpy-0.1.0/.hypothesis/unicode_data/15.0.0/charmap.json.gz +0 -0
- moltpy-0.1.0/.hypothesis/unicode_data/15.0.0/codec-utf-8.json.gz +0 -0
- moltpy-0.1.0/AGENTS.md +103 -0
- moltpy-0.1.0/CHANGELOG.md +33 -0
- moltpy-0.1.0/CODE_OF_CONDUCT.md +132 -0
- moltpy-0.1.0/CONTRIBUTING.md +108 -0
- moltpy-0.1.0/LICENSE +21 -0
- moltpy-0.1.0/PKG-INFO +322 -0
- moltpy-0.1.0/README.md +281 -0
- moltpy-0.1.0/SECURITY.md +48 -0
- moltpy-0.1.0/docs/README.md +75 -0
- moltpy-0.1.0/docs/development/architecture.md +189 -0
- moltpy-0.1.0/docs/development/contributing.md +101 -0
- moltpy-0.1.0/docs/getting-started/installation.md +75 -0
- moltpy-0.1.0/docs/getting-started/quickstart.md +206 -0
- moltpy-0.1.0/docs/index.md +35 -0
- moltpy-0.1.0/docs/usage/cli-reference.md +255 -0
- moltpy-0.1.0/docs/usage/custom-modules.md +232 -0
- moltpy-0.1.0/docs/usage/faq.md +183 -0
- moltpy-0.1.0/docs/usage/modules.md +154 -0
- moltpy-0.1.0/docs/usage/presets.md +119 -0
- moltpy-0.1.0/mkdocs.yml +67 -0
- moltpy-0.1.0/moltpy.yaml +98 -0
- moltpy-0.1.0/pyproject.toml +116 -0
- moltpy-0.1.0/site/404.html +880 -0
- moltpy-0.1.0/site/assets/images/favicon.png +0 -0
- moltpy-0.1.0/site/assets/javascripts/bundle.79ae519e.min.js +16 -0
- moltpy-0.1.0/site/assets/javascripts/bundle.79ae519e.min.js.map +7 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.ar.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.da.min.js +18 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.de.min.js +18 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.du.min.js +18 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.el.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.es.min.js +18 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.fi.min.js +18 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.fr.min.js +18 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.he.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.hi.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.hu.min.js +18 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.hy.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.it.min.js +18 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.ja.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.jp.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.kn.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.ko.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.multi.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.nl.min.js +18 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.no.min.js +18 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.pt.min.js +18 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.ro.min.js +18 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.ru.min.js +18 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.sa.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.sv.min.js +18 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.ta.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.te.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.th.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.tr.min.js +18 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.vi.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/min/lunr.zh.min.js +1 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/tinyseg.js +206 -0
- moltpy-0.1.0/site/assets/javascripts/lunr/wordcut.js +6708 -0
- moltpy-0.1.0/site/assets/javascripts/workers/search.2c215733.min.js +42 -0
- moltpy-0.1.0/site/assets/javascripts/workers/search.2c215733.min.js.map +7 -0
- moltpy-0.1.0/site/assets/stylesheets/main.484c7ddc.min.css +1 -0
- moltpy-0.1.0/site/assets/stylesheets/main.484c7ddc.min.css.map +1 -0
- moltpy-0.1.0/site/assets/stylesheets/palette.ab4e12ef.min.css +1 -0
- moltpy-0.1.0/site/assets/stylesheets/palette.ab4e12ef.min.css.map +1 -0
- moltpy-0.1.0/site/development/architecture/index.html +1458 -0
- moltpy-0.1.0/site/development/contributing/index.html +1261 -0
- moltpy-0.1.0/site/getting-started/installation/index.html +1276 -0
- moltpy-0.1.0/site/getting-started/quickstart/index.html +1386 -0
- moltpy-0.1.0/site/index.html +1098 -0
- moltpy-0.1.0/site/search/search_index.json +1 -0
- moltpy-0.1.0/site/sitemap.xml +43 -0
- moltpy-0.1.0/site/sitemap.xml.gz +0 -0
- moltpy-0.1.0/site/usage/cli-reference/index.html +1847 -0
- moltpy-0.1.0/site/usage/custom-modules/index.html +1651 -0
- moltpy-0.1.0/site/usage/faq/index.html +1811 -0
- moltpy-0.1.0/site/usage/modules/index.html +1807 -0
- moltpy-0.1.0/site/usage/presets/index.html +1317 -0
- moltpy-0.1.0/src/moltpy/__init__.py +4 -0
- moltpy-0.1.0/src/moltpy/builder.py +341 -0
- moltpy-0.1.0/src/moltpy/cli.py +446 -0
- moltpy-0.1.0/src/moltpy/config.py +230 -0
- moltpy-0.1.0/src/moltpy/external.py +176 -0
- moltpy-0.1.0/src/moltpy/generator.py +551 -0
- moltpy-0.1.0/src/moltpy/generator_templates/model.py.j2 +36 -0
- moltpy-0.1.0/src/moltpy/generator_templates/router.py.j2 +56 -0
- moltpy-0.1.0/src/moltpy/generator_templates/schema.py.j2 +38 -0
- moltpy-0.1.0/src/moltpy/generator_templates/service.py.j2 +65 -0
- moltpy-0.1.0/src/moltpy/generator_templates/test_api.py.j2 +86 -0
- moltpy-0.1.0/src/moltpy/modules/admin/manifest.json +20 -0
- moltpy-0.1.0/src/moltpy/modules/admin/templates/app/admin.py.j2 +29 -0
- moltpy-0.1.0/src/moltpy/modules/api_versioning/manifest.json +9 -0
- moltpy-0.1.0/src/moltpy/modules/api_versioning/templates/app/routers/v1/__init__.py +1 -0
- moltpy-0.1.0/src/moltpy/modules/api_versioning/templates/app/routers/v1/api.py.j2 +13 -0
- moltpy-0.1.0/src/moltpy/modules/arq/manifest.json +17 -0
- moltpy-0.1.0/src/moltpy/modules/arq/templates/app/arq.py.j2 +228 -0
- moltpy-0.1.0/src/moltpy/modules/arq/templates/app/routers/tasks.py.j2 +70 -0
- moltpy-0.1.0/src/moltpy/modules/arq/templates/app/tasks.py.j2 +26 -0
- moltpy-0.1.0/src/moltpy/modules/arq/templates/scripts/worker.py.j2 +79 -0
- moltpy-0.1.0/src/moltpy/modules/auth/manifest.json +26 -0
- moltpy-0.1.0/src/moltpy/modules/auth/templates/app/routers/auth.py.j2 +295 -0
- moltpy-0.1.0/src/moltpy/modules/auth/templates/tests/test_auth.py +52 -0
- moltpy-0.1.0/src/moltpy/modules/auth_social/manifest.json +30 -0
- moltpy-0.1.0/src/moltpy/modules/auth_social/templates/app/models/social_account.py.j2 +38 -0
- moltpy-0.1.0/src/moltpy/modules/auth_social/templates/app/routers/oauth.py.j2 +76 -0
- moltpy-0.1.0/src/moltpy/modules/auth_social/templates/app/schemas/oauth.py.j2 +44 -0
- moltpy-0.1.0/src/moltpy/modules/auth_social/templates/app/services/oauth.py.j2 +260 -0
- moltpy-0.1.0/src/moltpy/modules/base.py +51 -0
- moltpy-0.1.0/src/moltpy/modules/celery/manifest.json +29 -0
- moltpy-0.1.0/src/moltpy/modules/celery/templates/app/celery.py.j2 +43 -0
- moltpy-0.1.0/src/moltpy/modules/celery/templates/app/celerybeat_schedule.py +14 -0
- moltpy-0.1.0/src/moltpy/modules/celery/templates/app/tasks.py +64 -0
- moltpy-0.1.0/src/moltpy/modules/cors/manifest.json +9 -0
- moltpy-0.1.0/src/moltpy/modules/database/manifest.json +22 -0
- moltpy-0.1.0/src/moltpy/modules/database/templates/alembic/env.py.j2 +82 -0
- moltpy-0.1.0/src/moltpy/modules/database/templates/alembic.ini +53 -0
- moltpy-0.1.0/src/moltpy/modules/database/templates/app/database.py.j2 +96 -0
- moltpy-0.1.0/src/moltpy/modules/docker/manifest.json +16 -0
- moltpy-0.1.0/src/moltpy/modules/docker/templates/.dockerignore +40 -0
- moltpy-0.1.0/src/moltpy/modules/docker/templates/Dockerfile.j2 +61 -0
- moltpy-0.1.0/src/moltpy/modules/docker/templates/docker-compose.yml.j2 +112 -0
- moltpy-0.1.0/src/moltpy/modules/docs/manifest.json +9 -0
- moltpy-0.1.0/src/moltpy/modules/docs/templates/docs/api.md.j2 +58 -0
- moltpy-0.1.0/src/moltpy/modules/docs/templates/docs/development.md.j2 +53 -0
- moltpy-0.1.0/src/moltpy/modules/docs/templates/docs/index.md.j2 +42 -0
- moltpy-0.1.0/src/moltpy/modules/docs/templates/mkdocs.yml.j2 +50 -0
- moltpy-0.1.0/src/moltpy/modules/email/manifest.json +20 -0
- moltpy-0.1.0/src/moltpy/modules/email/templates/app/core/email.py.j2 +131 -0
- moltpy-0.1.0/src/moltpy/modules/email/templates/app/templates/email/password_reset.html.j2 +54 -0
- moltpy-0.1.0/src/moltpy/modules/email/templates/app/templates/email/password_reset.txt.j2 +17 -0
- moltpy-0.1.0/src/moltpy/modules/email/templates/app/templates/email/receipt.html.j2 +71 -0
- moltpy-0.1.0/src/moltpy/modules/email/templates/app/templates/email/receipt.txt.j2 +20 -0
- moltpy-0.1.0/src/moltpy/modules/email/templates/app/templates/email/welcome.html.j2 +52 -0
- moltpy-0.1.0/src/moltpy/modules/email/templates/app/templates/email/welcome.txt.j2 +15 -0
- moltpy-0.1.0/src/moltpy/modules/events/manifest.json +9 -0
- moltpy-0.1.0/src/moltpy/modules/events/templates/app/core/events.py.j2 +52 -0
- moltpy-0.1.0/src/moltpy/modules/events/templates/app/events/__init__.py.j2 +3 -0
- moltpy-0.1.0/src/moltpy/modules/events/templates/app/events/handlers.py.j2 +24 -0
- moltpy-0.1.0/src/moltpy/modules/github_actions/manifest.json +9 -0
- moltpy-0.1.0/src/moltpy/modules/github_actions/templates/.github/workflows/ci.yml.j2 +107 -0
- moltpy-0.1.0/src/moltpy/modules/graphql/manifest.json +32 -0
- moltpy-0.1.0/src/moltpy/modules/graphql/templates/app/graphql/__init__.py.j2 +3 -0
- moltpy-0.1.0/src/moltpy/modules/graphql/templates/app/graphql/resolvers.py.j2 +3 -0
- moltpy-0.1.0/src/moltpy/modules/graphql/templates/app/graphql/schema.py.j2 +160 -0
- moltpy-0.1.0/src/moltpy/modules/grpc/manifest.json +15 -0
- moltpy-0.1.0/src/moltpy/modules/grpc/templates/app/grpc/__init__.py.j2 +3 -0
- moltpy-0.1.0/src/moltpy/modules/grpc/templates/app/grpc/server.py.j2 +43 -0
- moltpy-0.1.0/src/moltpy/modules/grpc/templates/protos/service.proto +19 -0
- moltpy-0.1.0/src/moltpy/modules/health/manifest.json +9 -0
- moltpy-0.1.0/src/moltpy/modules/kubernetes/manifest.json +31 -0
- moltpy-0.1.0/src/moltpy/modules/kubernetes/templates/k8s/00-namespace.yml.j2 +5 -0
- moltpy-0.1.0/src/moltpy/modules/kubernetes/templates/k8s/01-secrets.yml.j2 +41 -0
- moltpy-0.1.0/src/moltpy/modules/kubernetes/templates/k8s/02-configmap.yml.j2 +34 -0
- moltpy-0.1.0/src/moltpy/modules/kubernetes/templates/k8s/03-deployment.yml.j2 +74 -0
- moltpy-0.1.0/src/moltpy/modules/kubernetes/templates/k8s/04-service.yml.j2 +17 -0
- moltpy-0.1.0/src/moltpy/modules/kubernetes/templates/k8s/05-ingress.yml.j2 +58 -0
- moltpy-0.1.0/src/moltpy/modules/kubernetes/templates/k8s/06-postgres.yml.j2 +81 -0
- moltpy-0.1.0/src/moltpy/modules/kubernetes/templates/k8s/07-redis.yml.j2 +59 -0
- moltpy-0.1.0/src/moltpy/modules/kubernetes/templates/k8s/README.md.j2 +104 -0
- moltpy-0.1.0/src/moltpy/modules/logging/manifest.json +9 -0
- moltpy-0.1.0/src/moltpy/modules/makefile/manifest.json +9 -0
- moltpy-0.1.0/src/moltpy/modules/makefile/templates/Makefile.j2 +86 -0
- moltpy-0.1.0/src/moltpy/modules/notifications/manifest.json +21 -0
- moltpy-0.1.0/src/moltpy/modules/notifications/snippets/app/arq.py.j2 +19 -0
- moltpy-0.1.0/src/moltpy/modules/notifications/snippets/app/tasks.py.j2 +24 -0
- moltpy-0.1.0/src/moltpy/modules/notifications/templates/app/api/v1/endpoints/notifications.py.j2 +63 -0
- moltpy-0.1.0/src/moltpy/modules/notifications/templates/app/core/notifications.py.j2 +58 -0
- moltpy-0.1.0/src/moltpy/modules/notifications/templates/app/schemas/notification.py.j2 +21 -0
- moltpy-0.1.0/src/moltpy/modules/notifications/templates/app/services/notification_service.py.j2 +31 -0
- moltpy-0.1.0/src/moltpy/modules/observability/manifest.json +20 -0
- moltpy-0.1.0/src/moltpy/modules/observability/templates/app/middleware/telemetry.py.j2 +72 -0
- moltpy-0.1.0/src/moltpy/modules/observability/templates/app/routers/metrics.py.j2 +50 -0
- moltpy-0.1.0/src/moltpy/modules/observability/templates/grafana/dashboards/fastapi-overview.json +258 -0
- moltpy-0.1.0/src/moltpy/modules/observability/templates/grafana/provisioning/dashboards/dashboards.yml +12 -0
- moltpy-0.1.0/src/moltpy/modules/observability/templates/grafana/provisioning/datasources/prometheus.yml +9 -0
- moltpy-0.1.0/src/moltpy/modules/openapi/manifest.json +16 -0
- moltpy-0.1.0/src/moltpy/modules/openapi/templates/app/core/openapi.py +39 -0
- moltpy-0.1.0/src/moltpy/modules/pagination/manifest.json +9 -0
- moltpy-0.1.0/src/moltpy/modules/payments/manifest.json +21 -0
- moltpy-0.1.0/src/moltpy/modules/payments/templates/app/api/v1/endpoints/payments.py.j2 +91 -0
- moltpy-0.1.0/src/moltpy/modules/payments/templates/app/core/payments.py.j2 +39 -0
- moltpy-0.1.0/src/moltpy/modules/payments/templates/app/schemas/payment.py.j2 +27 -0
- moltpy-0.1.0/src/moltpy/modules/pre_commit/manifest.json +9 -0
- moltpy-0.1.0/src/moltpy/modules/pre_commit/templates/.pre-commit-config.yaml +13 -0
- moltpy-0.1.0/src/moltpy/modules/rate_limit/manifest.json +16 -0
- moltpy-0.1.0/src/moltpy/modules/rate_limit/templates/app/middleware/rate_limit.py.j2 +31 -0
- moltpy-0.1.0/src/moltpy/modules/redis/manifest.json +9 -0
- moltpy-0.1.0/src/moltpy/modules/redis/templates/app/redis.py +55 -0
- moltpy-0.1.0/src/moltpy/modules/scheduler/manifest.json +21 -0
- moltpy-0.1.0/src/moltpy/modules/scheduler/templates/app/core/scheduler.py.j2 +15 -0
- moltpy-0.1.0/src/moltpy/modules/scheduler/templates/app/jobs/__init__.py.j2 +3 -0
- moltpy-0.1.0/src/moltpy/modules/scheduler/templates/app/jobs/example_job.py.j2 +68 -0
- moltpy-0.1.0/src/moltpy/modules/search/manifest.json +15 -0
- moltpy-0.1.0/src/moltpy/modules/search/snippets/docker-compose.yml.j2 +13 -0
- moltpy-0.1.0/src/moltpy/modules/search/templates/app/core/search.py.j2 +15 -0
- moltpy-0.1.0/src/moltpy/modules/search/templates/app/routers/search.py.j2 +18 -0
- moltpy-0.1.0/src/moltpy/modules/search/templates/app/services/search_service.py.j2 +37 -0
- moltpy-0.1.0/src/moltpy/modules/seeding/manifest.json +15 -0
- moltpy-0.1.0/src/moltpy/modules/seeding/templates/scripts/seed.py.j2 +153 -0
- moltpy-0.1.0/src/moltpy/modules/sentry/manifest.json +9 -0
- moltpy-0.1.0/src/moltpy/modules/sentry/templates/app/core/sentry.py +30 -0
- moltpy-0.1.0/src/moltpy/modules/storage/manifest.json +16 -0
- moltpy-0.1.0/src/moltpy/modules/storage/templates/app/routers/storage.py.j2 +205 -0
- moltpy-0.1.0/src/moltpy/modules/storage/templates/app/schemas/storage.py.j2 +70 -0
- moltpy-0.1.0/src/moltpy/modules/storage/templates/app/services/storage.py.j2 +270 -0
- moltpy-0.1.0/src/moltpy/modules/terraform/manifest.json +16 -0
- moltpy-0.1.0/src/moltpy/modules/terraform/templates/terraform/main.tf.j2 +527 -0
- moltpy-0.1.0/src/moltpy/modules/terraform/templates/terraform/outputs.tf.j2 +55 -0
- moltpy-0.1.0/src/moltpy/modules/terraform/templates/terraform/variables.tf.j2 +52 -0
- moltpy-0.1.0/src/moltpy/modules/testing/manifest.json +9 -0
- moltpy-0.1.0/src/moltpy/modules/users/manifest.json +9 -0
- moltpy-0.1.0/src/moltpy/modules/users/templates/app/models/__init__.py +3 -0
- moltpy-0.1.0/src/moltpy/modules/users/templates/app/models/user.py +33 -0
- moltpy-0.1.0/src/moltpy/modules/users/templates/app/routers/users.py +54 -0
- moltpy-0.1.0/src/moltpy/modules/users/templates/app/schemas/__init__.py +3 -0
- moltpy-0.1.0/src/moltpy/modules/users/templates/app/schemas/user.py +36 -0
- moltpy-0.1.0/src/moltpy/modules/users/templates/app/services/__init__.py +3 -0
- moltpy-0.1.0/src/moltpy/modules/users/templates/app/services/user.py +64 -0
- moltpy-0.1.0/src/moltpy/modules/websockets/manifest.json +16 -0
- moltpy-0.1.0/src/moltpy/modules/websockets/templates/app/routers/websockets.py.j2 +168 -0
- moltpy-0.1.0/src/moltpy/modules/websockets/templates/app/websockets.py.j2 +307 -0
- moltpy-0.1.0/src/moltpy/presets.py +168 -0
- moltpy-0.1.0/src/moltpy/registry.py +241 -0
- moltpy-0.1.0/src/moltpy/renderer.py +421 -0
- moltpy-0.1.0/src/moltpy/templates/.env.example.j2 +130 -0
- moltpy-0.1.0/src/moltpy/templates/.gitignore +73 -0
- moltpy-0.1.0/src/moltpy/templates/CONTRIBUTING.md.j2 +126 -0
- moltpy-0.1.0/src/moltpy/templates/README.md.j2 +154 -0
- moltpy-0.1.0/src/moltpy/templates/__init__.py +1 -0
- moltpy-0.1.0/src/moltpy/templates/app/__init__.py.j2 +3 -0
- moltpy-0.1.0/src/moltpy/templates/app/config.py.j2 +154 -0
- moltpy-0.1.0/src/moltpy/templates/app/dependencies.py.j2 +37 -0
- moltpy-0.1.0/src/moltpy/templates/app/main.py.j2 +223 -0
- moltpy-0.1.0/src/moltpy/templates/app/routers/__init__.py +1 -0
- moltpy-0.1.0/src/moltpy/templates/app/routers/example.py +48 -0
- moltpy-0.1.0/src/moltpy/templates/app/routers/health.py +34 -0
- moltpy-0.1.0/src/moltpy/templates/app/utils/__init__.py +1 -0
- moltpy-0.1.0/src/moltpy/templates/app/utils/logging.py +43 -0
- moltpy-0.1.0/src/moltpy/templates/app/utils/pagination.py +38 -0
- moltpy-0.1.0/src/moltpy/templates/docs/modules.md.j2 +40 -0
- moltpy-0.1.0/src/moltpy/templates/pyproject.toml.j2 +159 -0
- moltpy-0.1.0/src/moltpy/templates/tests/__init__.py +1 -0
- moltpy-0.1.0/src/moltpy/templates/tests/conftest.py.j2 +67 -0
- moltpy-0.1.0/src/moltpy/templates/tests/test_example.py +37 -0
- moltpy-0.1.0/src/moltpy/wizard.py +243 -0
- moltpy-0.1.0/tests/__init__.py +1 -0
- moltpy-0.1.0/tests/__snapshots__/test_end_to_end.ambr +6793 -0
- moltpy-0.1.0/tests/__snapshots__/test_snapshots.ambr +9958 -0
- moltpy-0.1.0/tests/_helpers.py +99 -0
- moltpy-0.1.0/tests/conftest.py +13 -0
- moltpy-0.1.0/tests/test_builder.py +1242 -0
- moltpy-0.1.0/tests/test_cli.py +1501 -0
- moltpy-0.1.0/tests/test_config.py +641 -0
- moltpy-0.1.0/tests/test_end_to_end.py +1475 -0
- moltpy-0.1.0/tests/test_external.py +323 -0
- moltpy-0.1.0/tests/test_generator.py +576 -0
- moltpy-0.1.0/tests/test_hypothesis.py +133 -0
- moltpy-0.1.0/tests/test_modules.py +1691 -0
- moltpy-0.1.0/tests/test_presets.py +320 -0
- moltpy-0.1.0/tests/test_registry.py +638 -0
- moltpy-0.1.0/tests/test_renderer.py +991 -0
- moltpy-0.1.0/tests/test_snapshots.py +52 -0
- moltpy-0.1.0/tests/test_wizard.py +757 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve MoltPy
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the behavior:
|
|
15
|
+
1. Run command '...'
|
|
16
|
+
2. Select modules '....'
|
|
17
|
+
3. See error
|
|
18
|
+
|
|
19
|
+
**Expected behavior**
|
|
20
|
+
A clear and concise description of what you expected to happen.
|
|
21
|
+
|
|
22
|
+
**Generated project structure**
|
|
23
|
+
If applicable, share the relevant parts of the generated project.
|
|
24
|
+
|
|
25
|
+
**Environment (please complete the following information):**
|
|
26
|
+
- OS: [e.g. Ubuntu 22.04, macOS 14]
|
|
27
|
+
- Python version: [e.g. 3.12]
|
|
28
|
+
- MoltPy version: [e.g. 0.1.0]
|
|
29
|
+
- Installation method: [e.g. pip, uv]
|
|
30
|
+
|
|
31
|
+
**Additional context**
|
|
32
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for MoltPy
|
|
4
|
+
title: '[FEATURE] '
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Module proposal
|
|
3
|
+
about: Propose a new module for MoltPy
|
|
4
|
+
title: '[MODULE] '
|
|
5
|
+
labels: module
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Module name**
|
|
11
|
+
A short, descriptive name for the module.
|
|
12
|
+
|
|
13
|
+
**What does this module provide?**
|
|
14
|
+
Describe the functionality this module adds to generated projects.
|
|
15
|
+
|
|
16
|
+
**Why should this be built-in?**
|
|
17
|
+
Explain why this module is generally useful for FastAPI projects.
|
|
18
|
+
|
|
19
|
+
**Dependencies**
|
|
20
|
+
List any modules this module implies or conflicts with.
|
|
21
|
+
|
|
22
|
+
**Example usage**
|
|
23
|
+
Show how a generated project would use this module.
|
|
24
|
+
|
|
25
|
+
**Additional context**
|
|
26
|
+
Add any other context, links, or examples here.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
|
|
3
|
+
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
|
|
4
|
+
|
|
5
|
+
Fixes # (issue)
|
|
6
|
+
|
|
7
|
+
## Type of change
|
|
8
|
+
|
|
9
|
+
Please delete options that are not relevant.
|
|
10
|
+
|
|
11
|
+
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
12
|
+
- [ ] New feature (non-breaking change which adds functionality)
|
|
13
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
14
|
+
- [ ] Documentation update
|
|
15
|
+
- [ ] New module
|
|
16
|
+
|
|
17
|
+
## Checklist
|
|
18
|
+
|
|
19
|
+
- [ ] My code follows the style guidelines of this project (run `uv run ruff check .` and `uv run ruff format .`)
|
|
20
|
+
- [ ] I have performed a self-review of my code
|
|
21
|
+
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
22
|
+
- [ ] I have made corresponding changes to the documentation
|
|
23
|
+
- [ ] My changes generate no new warnings
|
|
24
|
+
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
25
|
+
- [ ] New and existing unit tests pass locally with my changes (`uv run pytest`)
|
|
26
|
+
- [ ] Any dependent changes have been merged and published
|
|
27
|
+
|
|
28
|
+
## Testing
|
|
29
|
+
|
|
30
|
+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- uses: astral-sh/setup-uv@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: ${{ matrix.python-version }}
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: uv sync --extra dev
|
|
24
|
+
|
|
25
|
+
- name: Lint with ruff
|
|
26
|
+
run: uv run ruff check .
|
|
27
|
+
|
|
28
|
+
- name: Type check with mypy
|
|
29
|
+
run: uv run mypy src/
|
|
30
|
+
|
|
31
|
+
- name: Run fast tests with coverage
|
|
32
|
+
run: uv run pytest -m "not slow" --cov=moltpy --cov-report=term-missing
|
|
33
|
+
|
|
34
|
+
- name: Build wheel
|
|
35
|
+
run: uv build
|
|
36
|
+
|
|
37
|
+
e2e-presets:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
needs: test
|
|
40
|
+
strategy:
|
|
41
|
+
fail-fast: false
|
|
42
|
+
matrix:
|
|
43
|
+
preset: [minimal, standard, full-stack, microservice]
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v4
|
|
46
|
+
|
|
47
|
+
- uses: astral-sh/setup-uv@v5
|
|
48
|
+
with:
|
|
49
|
+
python-version: "3.12"
|
|
50
|
+
|
|
51
|
+
- name: Install dependencies
|
|
52
|
+
run: uv sync --extra dev
|
|
53
|
+
|
|
54
|
+
- name: Run E2E tests for ${{ matrix.preset }} preset
|
|
55
|
+
run: uv run pytest -m slow -k "test_preset_passes_full_toolchain and ${{ matrix.preset }}" -v
|
|
56
|
+
|
|
57
|
+
e2e-other:
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
needs: test
|
|
60
|
+
steps:
|
|
61
|
+
- uses: actions/checkout@v4
|
|
62
|
+
|
|
63
|
+
- uses: astral-sh/setup-uv@v5
|
|
64
|
+
with:
|
|
65
|
+
python-version: "3.12"
|
|
66
|
+
|
|
67
|
+
- name: Install dependencies
|
|
68
|
+
run: uv sync --extra dev
|
|
69
|
+
|
|
70
|
+
- name: Run other slow E2E tests
|
|
71
|
+
run: uv run pytest -m slow -k "not test_preset_passes_full_toolchain" -v
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
release:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
id-token: write
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- uses: astral-sh/setup-uv@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: "3.12"
|
|
20
|
+
|
|
21
|
+
- name: Install dependencies
|
|
22
|
+
run: uv sync --extra dev
|
|
23
|
+
|
|
24
|
+
- name: Run tests
|
|
25
|
+
run: uv run pytest
|
|
26
|
+
|
|
27
|
+
- name: Build wheel
|
|
28
|
+
run: uv build
|
|
29
|
+
|
|
30
|
+
- name: Publish to PyPI
|
|
31
|
+
run: uv publish --trusted-publishing always
|
|
32
|
+
|
|
33
|
+
- name: Create GitHub Release
|
|
34
|
+
uses: softprops/action-gh-release@v2
|
|
35
|
+
with:
|
|
36
|
+
generate_release_notes: true
|
moltpy-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Generated by Moltpy
|
|
2
|
+
.venv/
|
|
3
|
+
__pycache__/
|
|
4
|
+
*.py[cod]
|
|
5
|
+
*$py.class
|
|
6
|
+
*.so
|
|
7
|
+
.Python
|
|
8
|
+
build/
|
|
9
|
+
develop-eggs/
|
|
10
|
+
dist/
|
|
11
|
+
downloads/
|
|
12
|
+
eggs/
|
|
13
|
+
.eggs/
|
|
14
|
+
lib/
|
|
15
|
+
lib64/
|
|
16
|
+
parts/
|
|
17
|
+
sdist/
|
|
18
|
+
var/
|
|
19
|
+
wheels/
|
|
20
|
+
*.egg-info/
|
|
21
|
+
.installed.cfg
|
|
22
|
+
*.egg
|
|
23
|
+
|
|
24
|
+
# Environment
|
|
25
|
+
.env
|
|
26
|
+
.venv
|
|
27
|
+
env/
|
|
28
|
+
venv/
|
|
29
|
+
|
|
30
|
+
# IDE
|
|
31
|
+
.idea/
|
|
32
|
+
.vscode/
|
|
33
|
+
*.swp
|
|
34
|
+
*.swo
|
|
35
|
+
*~
|
|
36
|
+
|
|
37
|
+
# Testing
|
|
38
|
+
.pytest_cache/
|
|
39
|
+
.coverage
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
|
|
43
|
+
# Database
|
|
44
|
+
*.db
|
|
45
|
+
*.sqlite3
|
|
46
|
+
|
|
47
|
+
# Logs
|
|
48
|
+
*.log
|
|
49
|
+
|
|
50
|
+
# OS
|
|
51
|
+
.DS_Store
|
|
52
|
+
Thumbs.db
|
|
53
|
+
|
|
54
|
+
# Docker
|
|
55
|
+
.dockerignore
|
|
56
|
+
!src/moltpy/modules/docker/templates/.dockerignore
|
|
57
|
+
|
|
58
|
+
# Generated test projects
|
|
59
|
+
test_*/
|
|
60
|
+
*.lock
|
|
61
|
+
digest.txt
|
|
62
|
+
ROADMAP*.md
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# This .gitignore file was automatically created by Hypothesis. Hypothesis gitignores
|
|
2
|
+
# .hypothesis by default, because we generally recommend that .hypothesis not be checked
|
|
3
|
+
# into version control.
|
|
4
|
+
#
|
|
5
|
+
# If you *would* like to check .hypothesis into version control, you should delete this
|
|
6
|
+
# file. Hypothesis will not re-create this .gitignore unless .hypothesis is deleted (and
|
|
7
|
+
# if it does, that's a bug - please report it!)
|
|
8
|
+
|
|
9
|
+
*
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/moltpy/moltpy/src/moltpy/presets.py
|
|
2
|
+
# hypothesis_version: 6.152.5
|
|
3
|
+
|
|
4
|
+
['*.json', '.config', '3.12', 'admin', 'api_versioning', 'auth', 'auth_social', 'celery', 'cors', 'database', 'docker', 'docs', 'email', 'events', 'full-stack', 'github_actions', 'graphql', 'grpc', 'health', 'kubernetes', 'logging', 'makefile', 'microservice', 'minimal', 'moltpy', 'notifications', 'observability', 'openapi', 'pagination', 'payments', 'pre_commit', 'presets', 'project', 'rate_limit', 'redis', 'scheduler', 'search', 'seeding', 'sentry', 'standard', 'storage', 'terraform', 'testing', 'users', 'websockets']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/moltpy/moltpy/src/moltpy/wizard.py
|
|
2
|
+
# hypothesis_version: 6.152.5
|
|
3
|
+
|
|
4
|
+
['3.10', '3.11', '3.12', '3.13', 'Choose a preset', 'Project description', 'Python version', '[dim](auto)[/dim]', '[green]✓[/green]', '_', 'blue', 'bool', 'choice', 'custom', 'git_init', 'int', 'pre_commit_install', 'uv_sync']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/moltpy/moltpy/src/moltpy/builder.py
|
|
2
|
+
# hypothesis_version: 6.152.5
|
|
3
|
+
|
|
4
|
+
[1024, ' make run-dev', ' uv sync', '*.py', '-m', '.', '.env', '.env.example', 'File', 'POSTGRES_PASSWORD=.*', 'PYTHONPATH', 'Running uv sync...', 'SECRET_KEY=.*', 'Size', 'Source', 'VIRTUAL_ENV', 'add', 'commit', 'cyan', 'dim', 'docker', 'email', 'git', 'git_init', 'green', 'init', 'install', 'observability', 'openapi', 'pre-commit', 'pre_commit_install', 'right', 'run', 'sync', 'terraform', 'uv', 'uv_sync']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/moltpy/moltpy/src/moltpy/external.py
|
|
2
|
+
# hypothesis_version: 6.152.5
|
|
3
|
+
|
|
4
|
+
[120, '#', '--branch', '--depth', '.cache', '.config', '/', '1', '@', 'XDG_CACHE_HOME', 'XDG_CONFIG_HOME', 'clone', 'git', 'github:', 'github_modules', 'main', 'manifest.json', 'modules', 'moltpy']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/moltpy/moltpy/src/moltpy/cli.py
|
|
2
|
+
# hypothesis_version: 6.152.5
|
|
3
|
+
|
|
4
|
+
[',', ', ', '--config-file', '--description', '--dry-run', '--force', '--modules', '--name', '--no-interactive', '--output', '--preset', '--python-version', '--refresh-modules', '--skip-alembic', '--target', '--template-dir', '-d', '-f', '-m', '-n', '-o', '-p', '-t', '3.12', 'Output file path', 'Preset description', 'Preset name', 'Project description', 'Project name', 'Python version', 'Target directory', '[dim](custom)[/dim]', '_', '__main__', 'delete', 'fields', 'full-stack', 'github:', 'info', 'init-config', 'list', 'microservice', 'minimal', 'model_name', 'modules', 'moltpy', 'moltpy.yaml', 'my_project', 'name', 'project', 'resource', 'save', 'standard']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/moltpy/moltpy/src/moltpy/config.py
|
|
2
|
+
# hypothesis_version: 6.152.5
|
|
3
|
+
|
|
4
|
+
[' []', ' {}', '# Modules to include', '.json', '.yaml', '.yml', '3.10', '3.11', '3.12', '3.13', 'Default value', 'Preset configuration', 'Preset description', 'Preset name', 'Project description', '^[a-z][a-z0-9_]*$', 'after', 'choice', 'external_modules:', 'forbid', 'git_init', 'module_variables:', 'modules:', 'name', 'post_generation:', 'pre_commit_install', 'python_version', 'uv_sync']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/moltpy/moltpy/src/moltpy/generator.py
|
|
2
|
+
# hypothesis_version: 6.152.5
|
|
3
|
+
|
|
4
|
+
['""', '"Long text content"', '"Test value"', '"Updated long text"', '"Updated value"', '(.)([A-Z][a-z]+)', '([a-z0-9])([A-Z])', ', ', '-', '--autogenerate', '--fix', '-m', '.py', '3.14', '42', '6.28', '99', ':', 'Boolean', 'False', 'Float', 'Integer', 'JSON', 'String(255)', 'Text', 'True', 'UUID', '\\1_\\2', '_', '__init__.py', 'aeiou', 'alembic', 'alembic.ini', 'api', 'api.py', 'app', 'app/', 'bool', 'ch', 'check', 'child', 'children', 'database.py', 'datetime', 'dict[str, Any]', 'es', 'exec', 'feet', 'fields', 'float', 'foot', 'format', 'geese', 'generator_templates', 'goose', 'ies', 'int', 'json', 'main.py', 'man', 'men', 'mice', 'model.py.j2', 'models', 'mouse', 'ox', 'oxen', 'pascal_name', 'people', 'person', 'plural_name', 'python_imports', 'return app', 'revision', 'router.py.j2', 'routers', 'ruff', 'run', 's', 'schema.py.j2', 'schemas', 'service.py.j2', 'services', 'sh', 'snake_name', 'sqlalchemy_imports', 'str', 'teeth', 'test_api.py.j2', 'tests', 'tests/', 'text', 'tooth', 'uuid', 'uv', 'v1', 'woman', 'women', 'x', 'y', 'z', '{"key": "value"}', '{"updated": true}']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/moltpy/moltpy/src/moltpy/renderer.py
|
|
2
|
+
# hypothesis_version: 6.152.5
|
|
3
|
+
|
|
4
|
+
['# moltpy:SNIPPETS', '(.)([A-Z][a-z]+)', '([a-z0-9])([A-Z])', '*', '*.j2', '-', '.j2', '\\1-\\2', '\\1_\\2', '_', '__init__.py', 'config', 'core', 'description', 'has_module', 'manifest', 'modules', 'modules_info', 'name', 'project', 'python_version', 'snippet', 'snippets', 'static', 'templates', 'to_kebab_case', 'to_pascal_case', 'to_snake_case', 'utf-8', 'variables']
|
|
Binary file
|
|
Binary file
|
moltpy-0.1.0/AGENTS.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# MoltPy — Agent Context
|
|
2
|
+
|
|
3
|
+
Moltpy is a Python CLI tool (`moltpy`) that generates production-ready FastAPI project templates from Jinja2 modules.
|
|
4
|
+
|
|
5
|
+
## Developer Commands
|
|
6
|
+
|
|
7
|
+
Always use `uv`, never `pip`:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Install dependencies
|
|
11
|
+
uv sync --extra dev
|
|
12
|
+
|
|
13
|
+
# Run tests (fast)
|
|
14
|
+
uv run pytest
|
|
15
|
+
|
|
16
|
+
# Run with coverage
|
|
17
|
+
uv run pytest --cov=moltpy --cov-report=term-missing
|
|
18
|
+
|
|
19
|
+
# Lint → format → typecheck (CI order)
|
|
20
|
+
uv run ruff check .
|
|
21
|
+
uv run ruff format .
|
|
22
|
+
uv run mypy src/
|
|
23
|
+
|
|
24
|
+
# Build wheel
|
|
25
|
+
uv build
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Running Tests Selectively
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Exclude slow E2E tests that run full toolchain inside generated projects
|
|
32
|
+
uv run pytest -m "not slow"
|
|
33
|
+
|
|
34
|
+
# Run only slow golden-path tests
|
|
35
|
+
uv run pytest -m slow
|
|
36
|
+
|
|
37
|
+
# Run a single test file
|
|
38
|
+
uv run pytest tests/test_builder.py
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Architecture
|
|
42
|
+
|
|
43
|
+
- **Entry point**: `src/moltpy/cli.py:main` — Click CLI with subcommands `new`, `generate`, `modules`, `preset`, `init-config`
|
|
44
|
+
- **Builder**: `src/moltpy/builder.py` — orchestrates render → validate → .env generation → post-generation hooks
|
|
45
|
+
- **Renderer**: `src/moltpy/renderer.py` — Jinja2 sandboxed environment; renders `templates/`, module `templates/`, `snippets/`, and `static/`
|
|
46
|
+
- **Registry**: `src/moltpy/registry.py` — discovers modules, resolves `implies` dependencies topologically, validates `conflicts`
|
|
47
|
+
- **Generator**: `src/moltpy/generator.py` — day-2 CRUD resource scaffolding (`moltpy generate resource`)
|
|
48
|
+
- **Config**: `src/moltpy/config.py` — Pydantic models for `ProjectConfig`, `ModuleManifest`, `Preset`
|
|
49
|
+
|
|
50
|
+
### Module Layout
|
|
51
|
+
|
|
52
|
+
Each module lives in `src/moltpy/modules/<name>/`:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
<name>/
|
|
56
|
+
manifest.json # name, description, category, implies, conflicts, variables
|
|
57
|
+
module.py # Optional BaseModule subclass with pre_render / post_render hooks
|
|
58
|
+
templates/ # Jinja2 files rendered into the project (.j2 suffix stripped)
|
|
59
|
+
snippets/ # Small fragments injected into shared files via MOLTPY:SNIPPETS markers
|
|
60
|
+
static/ # Copied as-is
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Core templates (always rendered) are in `src/moltpy/templates/`.
|
|
64
|
+
|
|
65
|
+
## Key Conventions & Gotchas
|
|
66
|
+
|
|
67
|
+
- **Template syntax**: All templates use `.j2` extension; output name has `.j2` stripped. Static files have no `.j2`.
|
|
68
|
+
- **Snippet markers**: Snippets inject at `<!-- MOLTPY:SNIPPETS -->` or `# MOLTPY:SNIPPETS`. The builder runs `_cleanup_markers` to remove any leftovers. Tests enforce no leftover markers via `assert_no_leftover_markers`.
|
|
69
|
+
- **Python validation**: Every generated `.py` file is compiled with `py_compile` before the build finishes. Syntax errors fail the build.
|
|
70
|
+
- **`.env` generation**: `.env.example` is rendered first; then the builder replaces `SECRET_KEY=...` and `POSTGRES_PASSWORD=...` with cryptographically secure random values and writes `.env`. Existing `.env` is never overwritten.
|
|
71
|
+
- **Post-generation hooks**: Controlled by `post_generation` in config (`uv_sync`, `git_init`, `pre_commit_install`). The builder strips `VIRTUAL_ENV` and `PYTHONPATH` from the environment before running subprocess hooks to avoid contaminating the generated project.
|
|
72
|
+
- **External modules**: Load from `github:user/repo#module-name` or `~/.config/moltpy/modules/`. GitHub modules are cloned to a cache dir and reloaded with `--refresh-modules`.
|
|
73
|
+
- **Template overrides**: `--template-dir` provides user templates that override built-ins. Override templates are validated with Jinja2 parse at load time.
|
|
74
|
+
- **Presets**: Built-ins are `minimal`, `standard`, `full-stack`, `microservice`. User presets are stored in `~/.config/moltpy/presets/` as JSON and can override built-ins.
|
|
75
|
+
- **Custom Jinja filters**: `to_snake_case`, `to_pascal_case`, `to_kebab_case` are available in all templates.
|
|
76
|
+
|
|
77
|
+
## Testing Patterns
|
|
78
|
+
|
|
79
|
+
- **Unit tests**: `tests/test_*.py` — test individual components in isolation.
|
|
80
|
+
- **Snapshot tests**: `tests/test_snapshots.py` uses `syrupy` to snapshot the full generated file tree. Use `scrub_snapshot()` to redact non-deterministic secrets before snapshot comparison.
|
|
81
|
+
- **E2E tests**: `tests/test_end_to_end.py` generates full projects and asserts:
|
|
82
|
+
- File existence and valid Python syntax (`compile()`)
|
|
83
|
+
- Valid `pyproject.toml` (TOML parse)
|
|
84
|
+
- Valid YAML, JSON, Makefile, Dockerfile, Terraform, INI, proto, and HTML email templates
|
|
85
|
+
- **Dynamic execution**: For `standard` preset, the test runs `uv sync`, `ruff format`, `ruff check --fix`, `mypy app/`, and `pytest` inside the generated project. Set `DATABASE_URL=sqlite+aiosqlite:///:memory:` for these.
|
|
86
|
+
- **Resource generator E2E**: Generates a `standard` project, injects a new resource, runs `uv sync` and `ruff check`, then runs the generated project's `pytest`.
|
|
87
|
+
- **Slow marker**: Tests that invoke `uv sync` or subprocess toolchains inside generated projects are marked `@pytest.mark.slow`. CI runs all tests; local dev usually skips slow with `-m "not slow"`.
|
|
88
|
+
- **Helpers**: `tests/_helpers.py` provides `read_project_tree()`, `scrub_snapshot()`, `assert_no_leftover_markers()`.
|
|
89
|
+
|
|
90
|
+
## Style & Tooling
|
|
91
|
+
|
|
92
|
+
- **Ruff**: `line-length = 100`, target Python 3.10+. Rules: E, F, I, N, W, UP, B, C4, SIM.
|
|
93
|
+
- **MyPy**: `strict = true`, target Python 3.10.
|
|
94
|
+
- **pytest**: `testpaths = ["tests"]`.
|
|
95
|
+
|
|
96
|
+
## CI
|
|
97
|
+
|
|
98
|
+
`.github/workflows/ci.yml` runs on Python 3.10–3.13:
|
|
99
|
+
1. `uv sync --extra dev`
|
|
100
|
+
2. `uv run ruff check .`
|
|
101
|
+
3. `uv run mypy src/`
|
|
102
|
+
4. `uv run pytest --cov=moltpy --cov-report=term-missing`
|
|
103
|
+
5. `uv build`
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Initial project scaffolding with module-based architecture
|
|
12
|
+
- CLI commands: `new`, `generate`, `modules`, `preset`, `init-config`
|
|
13
|
+
- 36 built-in modules covering auth, database, infrastructure, observability, and more
|
|
14
|
+
- Preset system: `minimal`, `standard`, `full-stack`, `microservice`
|
|
15
|
+
- External module support from GitHub and local paths
|
|
16
|
+
- Interactive configuration wizard
|
|
17
|
+
- Day-2 CRUD resource generator
|
|
18
|
+
- Sandboxed Jinja2 template rendering with snippet injection
|
|
19
|
+
- Post-generation hooks: `uv_sync`, `git_init`, `pre_commit_install`
|
|
20
|
+
- Comprehensive test suite: unit, snapshot, and E2E tests
|
|
21
|
+
|
|
22
|
+
## [0.1.0] - 2026-05-02
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
- Beta release.
|
|
26
|
+
- Production-ready FastAPI project generator via CLI.
|
|
27
|
+
- Module dependency resolution with topological sorting.
|
|
28
|
+
- Conflict detection between mutually exclusive modules.
|
|
29
|
+
- Secure `.env` generation with cryptographically random secrets.
|
|
30
|
+
- Python syntax validation via `py_compile` for all generated files.
|
|
31
|
+
|
|
32
|
+
[Unreleased]: https://github.com/iolimat/moltpy/compare/v0.1.0...HEAD
|
|
33
|
+
[0.1.0]: https://github.com/iolimat/moltpy/releases/tag/v0.1.0
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
10
|
+
identity and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
- Demonstrating empathy and kindness toward other people
|
|
21
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
- Giving and gracefully accepting constructive feedback
|
|
23
|
+
- Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
- Focusing on what is best not just for us as individuals, but for the overall
|
|
26
|
+
community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
- The use of sexualized language or imagery, and sexual attention or advances of
|
|
31
|
+
any kind
|
|
32
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
- Public or private harassment
|
|
34
|
+
- Publishing others' private information, such as a physical or email address,
|
|
35
|
+
without their explicit permission
|
|
36
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official email address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement at
|
|
63
|
+
[your-email@example.com]. All complaints will be reviewed and investigated
|
|
64
|
+
promptly and fairly.
|
|
65
|
+
|
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
+
reporter of any incident.
|
|
68
|
+
|
|
69
|
+
## Enforcement Guidelines
|
|
70
|
+
|
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
+
|
|
74
|
+
### 1. Correction
|
|
75
|
+
|
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
+
unprofessional or unwelcome in the community.
|
|
78
|
+
|
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
|
82
|
+
|
|
83
|
+
### 2. Warning
|
|
84
|
+
|
|
85
|
+
**Community Impact**: A violation through a single incident or series of
|
|
86
|
+
actions.
|
|
87
|
+
|
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
+
like social media. Violating these terms may lead to a temporary or permanent
|
|
93
|
+
ban.
|
|
94
|
+
|
|
95
|
+
### 3. Temporary Ban
|
|
96
|
+
|
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
|
98
|
+
sustained inappropriate behavior.
|
|
99
|
+
|
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
+
communication with the community for a specified period of time. No public or
|
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
+
Violating these terms may lead to a permanent ban.
|
|
105
|
+
|
|
106
|
+
### 4. Permanent Ban
|
|
107
|
+
|
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
+
|
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within the
|
|
113
|
+
community.
|
|
114
|
+
|
|
115
|
+
## Attribution
|
|
116
|
+
|
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
+
version 2.1, available at
|
|
119
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
120
|
+
|
|
121
|
+
Community Impact Guidelines were inspired by
|
|
122
|
+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
123
|
+
|
|
124
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
125
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
126
|
+
[https://www.contributor-covenant.org/translations][translations].
|
|
127
|
+
|
|
128
|
+
[homepage]: https://www.contributor-covenant.org
|
|
129
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
130
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
131
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
132
|
+
[translations]: https://www.contributor-covenant.org/translations
|