simple-module-cli 0.0.41__tar.gz → 0.0.43__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.
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/.gitignore +3 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/PKG-INFO +3 -2
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/README.md +1 -1
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/pyproject.toml +2 -1
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/cli.py +17 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/docker_assets.py +1 -1
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/git_source.py +3 -87
- simple_module_cli-0.0.43/simple_module_cli/git_versions.py +114 -0
- simple_module_cli-0.0.43/simple_module_cli/migration_recipes/mail_settings.py +48 -0
- simple_module_cli-0.0.43/simple_module_cli/migration_recipes/users_tokens.py +34 -0
- simple_module_cli-0.0.43/simple_module_cli/migrations_cmd.py +66 -0
- simple_module_cli-0.0.43/simple_module_cli/package_update.py +189 -0
- simple_module_cli-0.0.43/simple_module_cli/package_update_deps.py +160 -0
- simple_module_cli-0.0.43/simple_module_cli/package_update_npm.py +126 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/pypi.py +12 -5
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/pyproject_edit.py +22 -6
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/requirements.py +50 -30
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-cli/SKILL.md +21 -3
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-database/SKILL.md +6 -3
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-inertia-pages/SKILL.md +2 -2
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-migrations/SKILL.md +2 -2
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-testing/SKILL.md +30 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/compose-base-postgres.yml.tpl +2 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/compose-base-sqlite.yml.tpl +1 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/compose-tasks-postgres.yml.tpl +4 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/dockerignore +11 -1
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/host-flat.Dockerfile +3 -2
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/host.Dockerfile +4 -2
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/worker.Dockerfile.tpl +3 -1
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/README.md.tpl +18 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/migrations/env.py +3 -2
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/templates/index.html +1 -1
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/update_cmd.py +11 -2
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/conftest.py +14 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_add_spec_parse.py +14 -1
- simple_module_cli-0.0.43/tests/test_cli_docker_persistence_secrets.py +94 -0
- simple_module_cli-0.0.43/tests/test_cli_package_update_groups.py +74 -0
- simple_module_cli-0.0.43/tests/test_cli_package_update_npm.py +220 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_package_update_pins.py +3 -3
- simple_module_cli-0.0.43/tests/test_cli_package_update_release_order.py +97 -0
- simple_module_cli-0.0.43/tests/test_cli_package_update_workspace_excludes.py +37 -0
- simple_module_cli-0.0.43/tests/test_cli_prepare_data_migrations.py +185 -0
- simple_module_cli-0.0.43/tests/test_cli_prepare_data_postgres.py +89 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_pyproject_edit.py +43 -0
- simple_module_cli-0.0.43/tests/test_cli_update_release_policy.py +99 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_update_sources.py +43 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_no_framework_deps.py +7 -4
- simple_module_cli-0.0.41/simple_module_cli/package_update.py +0 -262
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/LICENSE +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/__init__.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/_add_install.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/_add_sources.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/_app_project_manifests.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/_env.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/_local_env.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/_module_build.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/_module_host.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/_templating.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/add_cmd.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/app_project.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/case.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/catalog.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/docker_cmd.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/framework_repo.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/module_cmd.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/new.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/openapi_cmd.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/openapi_types.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/pins.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/plugins.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/recipes.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/scaffolding.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/skills/README.md +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-conventions/SKILL.md +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-creating/SKILL.md +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-doctor/SKILL.md +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-locales/SKILL.md +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/skills/simple-module-registries/SKILL.md +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/skills_cmd.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/Makefile.snippet +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/compose-tasks-sqlite.yml.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/docker/compose-worker.yml.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/.env.example +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/.gitignore +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/Makefile +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/_optional/background_tasks/Makefile.snippet +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/_optional/background_tasks/run_worker.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/alembic.ini +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/app.tsx +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/main.tsx +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/module-assets.ts +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/package.json.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/pages/Error.tsx +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/pages/Landing.tsx +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/pages.ts +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/styles.css +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/tsconfig.json +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/vite.config.ts +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/client_app/vite.dev-url.ts +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/main.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/migrations/script.py.mako +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/migrations/versions/.gitkeep +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/pyproject.toml.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/host/routes.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/.github/workflows/ci.yml +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/.github/workflows/publish.yml.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/.gitignore +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/README.md.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/__init__.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/constants.py.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/contracts/__init__.py.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/contracts/schemas.py.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/deps.py.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/endpoints/__init__.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/endpoints/api.py.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/endpoints/views.py.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/locales/en.json.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/models.py.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/module.py.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/pages/Browse.tsx.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/pages/Create.tsx.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/pages/Edit.tsx.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/pages/api.generated.ts.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/pages/api.ts.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/py.typed +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/service.py.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/services.py.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/__PACKAGE__/settings.py.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/framework_repo/LICENSE +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/framework_repo/README.md.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/framework_repo/__PACKAGE__/pages/Browse.tsx.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/framework_repo/__PACKAGE__/pages/Create.tsx.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/framework_repo/__PACKAGE__/pages/Edit.tsx.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/framework_repo/pyproject.toml.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/standalone/package.json.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/_optional/standalone/tsconfig.json.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/package.json.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/pyproject.toml.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/tests/test___PACKAGE__.py.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/module/tsconfig.json.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/workspace/.env.example +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/workspace/.gitignore +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/workspace/Makefile +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/workspace/README.md.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/workspace/package.json.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/templates/workspace/pyproject.toml.tpl +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/uv_workspace.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/simple_module_cli/wizard.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_build_packaging.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_case.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_add_cmd.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_add_workspace_member.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_asset_prerequisites.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_catalog.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_catalog_depends_on.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_docker_assets.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_docker_workers.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_gen_types_scaffold.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_git_scan.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_new.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_new_dest_tolerance.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_new_git_module.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_new_migration_bootstrap.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_new_regressions.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_new_scaffold_layout.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_openapi_export.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_openapi_gen_types.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_package_update.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_recipes.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_vite_port_env.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_wizard.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_cli_wizard_git.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_create_module_ci_skip.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_env_helper.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_framework_repo_wiring.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_module_cmd_build.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_module_cmd_e2e.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_module_cmd_verify.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_module_css_assets.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_module_css_build.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_module_css_subdir_sources.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_module_npm_aliases.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_module_pages_manifest.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_plugin_discovery.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_scaffold_app_tsx_spa_links.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_scaffold_rollback.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_scaffolded_host_setup_wizard.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_scaffolding_framework_repo.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_scaffolding_host.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_scaffolding_module.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_scaffolding_module_js.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_skills_cmd.py +0 -0
- {simple_module_cli-0.0.41 → simple_module_cli-0.0.43}/tests/test_template_requires_framework.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: simple_module_cli
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.43
|
|
4
4
|
Summary: Standalone scaffolder for the SimpleModule framework — `smpy new`, `smpy create-module`, plugin host.
|
|
5
5
|
Project-URL: Homepage, https://github.com/antosubash/simple_module_python
|
|
6
6
|
Project-URL: Repository, https://github.com/antosubash/simple_module_python
|
|
@@ -19,6 +19,7 @@ Classifier: Topic :: Software Development :: Code Generators
|
|
|
19
19
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
20
20
|
Classifier: Typing :: Typed
|
|
21
21
|
Requires-Python: >=3.12
|
|
22
|
+
Requires-Dist: packaging<27,>=23.0
|
|
22
23
|
Requires-Dist: tomlkit<0.16,>=0.13
|
|
23
24
|
Requires-Dist: typer<0.28,>=0.12
|
|
24
25
|
Description-Content-Type: text/markdown
|
|
@@ -37,7 +38,7 @@ pipx install simple_module_cli
|
|
|
37
38
|
uvx --from simple_module_cli smpy new my-app
|
|
38
39
|
```
|
|
39
40
|
|
|
40
|
-
The package depends only on `typer` and `
|
|
41
|
+
The package depends only on `typer`, `tomlkit` and `packaging` — installing it does **not** pull in FastAPI, SQLModel, or any other framework runtime.
|
|
41
42
|
|
|
42
43
|
## Usage
|
|
43
44
|
|
|
@@ -12,7 +12,7 @@ pipx install simple_module_cli
|
|
|
12
12
|
uvx --from simple_module_cli smpy new my-app
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
The package depends only on `typer` and `
|
|
15
|
+
The package depends only on `typer`, `tomlkit` and `packaging` — installing it does **not** pull in FastAPI, SQLModel, or any other framework runtime.
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "simple_module_cli"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.43"
|
|
4
4
|
description = "Standalone scaffolder for the SimpleModule framework — `smpy new`, `smpy create-module`, plugin host."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
@@ -20,6 +20,7 @@ classifiers = [
|
|
|
20
20
|
"Typing :: Typed",
|
|
21
21
|
]
|
|
22
22
|
dependencies = [
|
|
23
|
+
"packaging>=23.0,<27",
|
|
23
24
|
"typer>=0.12,<0.28",
|
|
24
25
|
"tomlkit>=0.13,<0.16",
|
|
25
26
|
]
|
|
@@ -23,6 +23,7 @@ import typer
|
|
|
23
23
|
from simple_module_cli.add_cmd import add_module, run_add
|
|
24
24
|
from simple_module_cli.case import to_kebab_case
|
|
25
25
|
from simple_module_cli.docker_cmd import docker_app
|
|
26
|
+
from simple_module_cli.migrations_cmd import migrations_app
|
|
26
27
|
from simple_module_cli.module_cmd import module_app
|
|
27
28
|
from simple_module_cli.new import new_project
|
|
28
29
|
from simple_module_cli.openapi_cmd import openapi_app
|
|
@@ -49,6 +50,22 @@ app.add_typer(docker_app, name="docker")
|
|
|
49
50
|
app.add_typer(skills_app, name="skills")
|
|
50
51
|
app.add_typer(module_app, name="module")
|
|
51
52
|
app.add_typer(openapi_app, name="openapi")
|
|
53
|
+
app.add_typer(migrations_app, name="migrations")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@app.command("doctor")
|
|
57
|
+
def doctor() -> None:
|
|
58
|
+
"""Check installed modules and their database compatibility."""
|
|
59
|
+
try:
|
|
60
|
+
from simple_module_core.__main__ import main as run_doctor
|
|
61
|
+
except ImportError:
|
|
62
|
+
# The CLI installs on its own (to scaffold); doctor needs a project's framework.
|
|
63
|
+
typer.echo(
|
|
64
|
+
"ERROR: smpy doctor needs simple_module_core; run it inside a project.", err=True
|
|
65
|
+
)
|
|
66
|
+
raise typer.Exit(1) from None
|
|
67
|
+
|
|
68
|
+
raise typer.Exit(run_doctor())
|
|
52
69
|
|
|
53
70
|
|
|
54
71
|
@app.command("create-host")
|
|
@@ -78,7 +78,7 @@ def scaffold_docker_assets(target: Path, ctx: ScaffoldCtx, *, flat: bool = False
|
|
|
78
78
|
.replace(_PG_DB_TOKEN, pg_db)
|
|
79
79
|
.replace(_APP_EXTRA_ENV_TOKEN, _APP_BROKER_ENV if with_tasks else "")
|
|
80
80
|
)
|
|
81
|
-
volumes = ["pgdata"] if db == "postgres" else ["appdata"]
|
|
81
|
+
volumes = ["appdata", "pgdata"] if db == "postgres" else ["appdata"]
|
|
82
82
|
if with_tasks:
|
|
83
83
|
compose += _read(templates / f"compose-tasks-{db}.yml.tpl").replace(_PG_DB_TOKEN, pg_db)
|
|
84
84
|
volumes.append("redisdata")
|
|
@@ -11,15 +11,16 @@ tomlkit alone (see test_no_framework_deps.py); clones are read with tomllib.
|
|
|
11
11
|
|
|
12
12
|
from __future__ import annotations
|
|
13
13
|
|
|
14
|
-
import re
|
|
15
14
|
import subprocess
|
|
16
15
|
import tomllib
|
|
17
|
-
from collections.abc import Callable
|
|
16
|
+
from collections.abc import Callable
|
|
18
17
|
from dataclasses import dataclass
|
|
19
18
|
from pathlib import Path
|
|
20
19
|
from typing import Literal
|
|
21
20
|
from urllib.parse import urlsplit
|
|
22
21
|
|
|
22
|
+
from simple_module_cli.git_versions import derive_range, pick_latest_tag, satisfies, version_tuple
|
|
23
|
+
|
|
23
24
|
__all__ = [
|
|
24
25
|
"FoundModule",
|
|
25
26
|
"GitAddSpec",
|
|
@@ -94,91 +95,6 @@ def _parse_git(raw: str) -> GitAddSpec:
|
|
|
94
95
|
return GitAddSpec(url=body, ref=ref, subdirectory=subdirectory)
|
|
95
96
|
|
|
96
97
|
|
|
97
|
-
# --- version helpers (no `packaging` dep — CLI depends on typer + tomlkit only) ---
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
def version_tuple(v: str) -> tuple[int, ...]:
|
|
101
|
-
parts: list[int] = []
|
|
102
|
-
for part in v.split("."):
|
|
103
|
-
digits = ""
|
|
104
|
-
for ch in part:
|
|
105
|
-
if ch.isdigit():
|
|
106
|
-
digits += ch
|
|
107
|
-
else:
|
|
108
|
-
break
|
|
109
|
-
parts.append(int(digits) if digits else 0)
|
|
110
|
-
return tuple(parts)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
def _cmp(a: str, b: str) -> int:
|
|
114
|
-
ta, tb = version_tuple(a), version_tuple(b)
|
|
115
|
-
width = max(len(ta), len(tb))
|
|
116
|
-
ta += (0,) * (width - len(ta))
|
|
117
|
-
tb += (0,) * (width - len(tb))
|
|
118
|
-
if ta != tb:
|
|
119
|
-
return (ta > tb) - (ta < tb)
|
|
120
|
-
pa, pb = _prerelease_key(a), _prerelease_key(b)
|
|
121
|
-
return (pa > pb) - (pa < pb)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
def _prerelease_key(version: str) -> tuple[int, int]:
|
|
125
|
-
# shortcut: handles Python a/b/rc suffixes; use a full parser for other version schemes.
|
|
126
|
-
match = re.search(r"(alpha|beta|a|b|rc)(\d*)$", version, re.IGNORECASE)
|
|
127
|
-
if match is None:
|
|
128
|
-
return (3, 0)
|
|
129
|
-
return (
|
|
130
|
-
{"a": 0, "alpha": 0, "b": 1, "beta": 1, "rc": 2}[match[1].lower()],
|
|
131
|
-
int(match[2] or "0"),
|
|
132
|
-
)
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
_OPS = ("<=", ">=", "==", "!=", "<", ">")
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
def satisfies(version: str, constraint: str) -> bool:
|
|
139
|
-
for clause in constraint.split(","):
|
|
140
|
-
clause = clause.strip()
|
|
141
|
-
if not clause:
|
|
142
|
-
continue
|
|
143
|
-
for op in _OPS:
|
|
144
|
-
if clause.startswith(op):
|
|
145
|
-
bound = clause[len(op) :].strip()
|
|
146
|
-
c = _cmp(version, bound)
|
|
147
|
-
ok = {
|
|
148
|
-
"<=": c <= 0,
|
|
149
|
-
">=": c >= 0,
|
|
150
|
-
"==": c == 0,
|
|
151
|
-
"!=": c != 0,
|
|
152
|
-
"<": c < 0,
|
|
153
|
-
">": c > 0,
|
|
154
|
-
}[op]
|
|
155
|
-
if not ok:
|
|
156
|
-
return False
|
|
157
|
-
break
|
|
158
|
-
else:
|
|
159
|
-
return False
|
|
160
|
-
return True
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
def derive_range(version: str) -> str:
|
|
164
|
-
major = version_tuple(version)[0]
|
|
165
|
-
upper = "1.0" if major == 0 else f"{major + 1}.0"
|
|
166
|
-
return f">={version},<{upper}"
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
def pick_latest_tag(tags: Iterable[str], constraint: str | None) -> str | None:
|
|
170
|
-
best: str | None = None
|
|
171
|
-
for tag in tags:
|
|
172
|
-
if not tag.startswith("v") or len(tag) < 2 or not tag[1].isdigit():
|
|
173
|
-
continue
|
|
174
|
-
ver = tag[1:]
|
|
175
|
-
if constraint and not satisfies(ver, constraint):
|
|
176
|
-
continue
|
|
177
|
-
if best is None or _cmp(ver, best[1:]) > 0:
|
|
178
|
-
best = tag
|
|
179
|
-
return best
|
|
180
|
-
|
|
181
|
-
|
|
182
98
|
# --- remote resolution + clone scanning ---
|
|
183
99
|
|
|
184
100
|
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"""Version policies and release-tag selection for git module sources."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
from collections.abc import Iterable
|
|
7
|
+
|
|
8
|
+
from packaging.version import InvalidVersion
|
|
9
|
+
|
|
10
|
+
from simple_module_cli.requirements import _compare as _cmp
|
|
11
|
+
from simple_module_cli.requirements import (
|
|
12
|
+
_compatible_band,
|
|
13
|
+
_matches_wildcard,
|
|
14
|
+
is_valid_version,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
# --- version helpers ---
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def version_tuple(v: str) -> tuple[int, ...]:
|
|
21
|
+
parts: list[int] = []
|
|
22
|
+
for part in v.split("."):
|
|
23
|
+
digits = ""
|
|
24
|
+
for ch in part:
|
|
25
|
+
if ch.isdigit():
|
|
26
|
+
digits += ch
|
|
27
|
+
else:
|
|
28
|
+
break
|
|
29
|
+
parts.append(int(digits) if digits else 0)
|
|
30
|
+
return tuple(parts)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _prerelease_key(version: str) -> tuple[int, int]:
|
|
34
|
+
# shortcut: handles Python a/b/rc suffixes; use a full parser for other version schemes.
|
|
35
|
+
match = re.search(r"(alpha|beta|a|b|rc)(\d*)$", version, re.IGNORECASE)
|
|
36
|
+
if match is None:
|
|
37
|
+
return (3, 0)
|
|
38
|
+
return (
|
|
39
|
+
{"a": 0, "alpha": 0, "b": 1, "beta": 1, "rc": 2}[match[1].lower()],
|
|
40
|
+
int(match[2] or "0"),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
_OPS = ("<=", ">=", "==", "!=", "~=", "<", ">")
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def satisfies(version: str, constraint: str) -> bool:
|
|
48
|
+
for clause in constraint.split(","):
|
|
49
|
+
clause = clause.strip()
|
|
50
|
+
if not clause:
|
|
51
|
+
continue
|
|
52
|
+
for op in _OPS:
|
|
53
|
+
if clause.startswith(op):
|
|
54
|
+
bound = clause[len(op) :].strip()
|
|
55
|
+
if op in ("==", "!=") and bound.endswith(".*"):
|
|
56
|
+
if (op == "==") != _matches_wildcard(version, bound):
|
|
57
|
+
return False
|
|
58
|
+
break
|
|
59
|
+
if op == "<" and _excluded_prerelease(version, bound):
|
|
60
|
+
return False
|
|
61
|
+
try:
|
|
62
|
+
c = _cmp(version, bound)
|
|
63
|
+
except InvalidVersion:
|
|
64
|
+
return False
|
|
65
|
+
if op == "~=":
|
|
66
|
+
band = _compatible_band(bound)
|
|
67
|
+
if c < 0 or band is None or not _matches_wildcard(version, band):
|
|
68
|
+
return False
|
|
69
|
+
break
|
|
70
|
+
ok = {
|
|
71
|
+
"<=": c <= 0,
|
|
72
|
+
">=": c >= 0,
|
|
73
|
+
"==": c == 0,
|
|
74
|
+
"!=": c != 0,
|
|
75
|
+
"<": c < 0,
|
|
76
|
+
">": c > 0,
|
|
77
|
+
}[op]
|
|
78
|
+
if not ok:
|
|
79
|
+
return False
|
|
80
|
+
break
|
|
81
|
+
else:
|
|
82
|
+
return False
|
|
83
|
+
return True
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def _excluded_prerelease(version: str, bound: str) -> bool:
|
|
87
|
+
"""PEP 440: ``<0.4`` excludes ``0.4.0rc1`` unless the bound is itself a pre-release."""
|
|
88
|
+
final = (3, 0)
|
|
89
|
+
if _prerelease_key(version) == final or _prerelease_key(bound) != final:
|
|
90
|
+
return False
|
|
91
|
+
width = max(len(version_tuple(version)), len(version_tuple(bound)))
|
|
92
|
+
pad = (0,) * width
|
|
93
|
+
return (version_tuple(version) + pad)[:width] == (version_tuple(bound) + pad)[:width]
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def derive_range(version: str) -> str:
|
|
97
|
+
major = version_tuple(version)[0]
|
|
98
|
+
upper = "1.0" if major == 0 else f"{major + 1}.0"
|
|
99
|
+
return f">={version},<{upper}"
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def pick_latest_tag(tags: Iterable[str], constraint: str | None) -> str | None:
|
|
103
|
+
best: str | None = None
|
|
104
|
+
for tag in tags:
|
|
105
|
+
if not tag.startswith("v") or len(tag) < 2 or not tag[1].isdigit():
|
|
106
|
+
continue
|
|
107
|
+
ver = tag[1:]
|
|
108
|
+
if not is_valid_version(ver):
|
|
109
|
+
continue
|
|
110
|
+
if constraint and not satisfies(ver, constraint):
|
|
111
|
+
continue
|
|
112
|
+
if best is None or _cmp(ver, best[1:]) > 0:
|
|
113
|
+
best = tag
|
|
114
|
+
return best
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Frozen system mail-settings move from d7b3a9e5c1f2 (#711).
|
|
2
|
+
|
|
3
|
+
An existing target value wins; the obsolete source row is removed.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import sqlalchemy as sa
|
|
7
|
+
from alembic import op
|
|
8
|
+
|
|
9
|
+
_TABLE = "settings_setting"
|
|
10
|
+
_SCOPE_SYSTEM = "system"
|
|
11
|
+
_SYSTEM_SCOPE_ID = ""
|
|
12
|
+
|
|
13
|
+
_KEY_PAIRS = (
|
|
14
|
+
("users.mailer", "mail.backend"),
|
|
15
|
+
*((f"users.smtp_{f}", f"mail.smtp_{f}") for f in ("host", "port", "username", "password")),
|
|
16
|
+
("users.smtp_from", "mail.smtp_from"),
|
|
17
|
+
("users.smtp_tls", "mail.smtp_tls"),
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _rename(old: str, new: str) -> None:
|
|
22
|
+
scope = {"scope": _SCOPE_SYSTEM, "scope_id": _SYSTEM_SCOPE_ID, "old": old, "new": new}
|
|
23
|
+
bind = op.get_bind()
|
|
24
|
+
bind.execute(
|
|
25
|
+
sa.text(
|
|
26
|
+
f"DELETE FROM {_TABLE} WHERE scope = :scope AND scope_id = :scope_id AND key = :old"
|
|
27
|
+
f" AND EXISTS (SELECT 1 FROM {_TABLE} AS t WHERE t.scope = :scope"
|
|
28
|
+
" AND t.scope_id = :scope_id AND t.key = :new)"
|
|
29
|
+
),
|
|
30
|
+
scope,
|
|
31
|
+
)
|
|
32
|
+
bind.execute(
|
|
33
|
+
sa.text(
|
|
34
|
+
f"UPDATE {_TABLE} SET key = :new"
|
|
35
|
+
" WHERE scope = :scope AND scope_id = :scope_id AND key = :old"
|
|
36
|
+
),
|
|
37
|
+
scope,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def upgrade() -> None:
|
|
42
|
+
for old, new in _KEY_PAIRS:
|
|
43
|
+
_rename(old, new)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def downgrade() -> None:
|
|
47
|
+
for old, new in _KEY_PAIRS:
|
|
48
|
+
_rename(new, old)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""Frozen token-storage upgrade from a626b1c8d023 (#711).
|
|
2
|
+
|
|
3
|
+
Upgrade and downgrade invalidate all access/refresh credentials. Stop all old
|
|
4
|
+
application workers before upgrading; clients must sign in again.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import sqlalchemy as sa
|
|
8
|
+
from alembic import op
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _clear_tokens() -> None:
|
|
12
|
+
for table in ("users_refresh_token", "users_access_token"):
|
|
13
|
+
op.execute(sa.table(table).delete())
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def upgrade() -> None:
|
|
17
|
+
_clear_tokens()
|
|
18
|
+
with op.batch_alter_table("users_refresh_token") as batch:
|
|
19
|
+
batch.alter_column(
|
|
20
|
+
"token", existing_type=sa.Uuid(), type_=sa.String(64), postgresql_using="token::text"
|
|
21
|
+
)
|
|
22
|
+
with op.batch_alter_table("users_access_token") as batch:
|
|
23
|
+
batch.alter_column("token", existing_type=sa.String(43), type_=sa.String(64))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def downgrade() -> None:
|
|
27
|
+
# Digests cannot be restored to UUIDs or bearer secrets.
|
|
28
|
+
_clear_tokens()
|
|
29
|
+
with op.batch_alter_table("users_refresh_token") as batch:
|
|
30
|
+
batch.alter_column(
|
|
31
|
+
"token", existing_type=sa.String(64), type_=sa.Uuid(), postgresql_using="token::uuid"
|
|
32
|
+
)
|
|
33
|
+
with op.batch_alter_table("users_access_token") as batch:
|
|
34
|
+
batch.alter_column("token", existing_type=sa.String(64), type_=sa.String(43))
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""Prepare frozen framework upgrades in a consuming host's own Alembic graph."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
from importlib.resources import files
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Annotated
|
|
9
|
+
from uuid import uuid4
|
|
10
|
+
|
|
11
|
+
import typer
|
|
12
|
+
|
|
13
|
+
migrations_app = typer.Typer(help="Prepare host-owned framework upgrade revisions.")
|
|
14
|
+
_RECIPES = {
|
|
15
|
+
"mail.settings_namespace_v1": ("mail", "mail_settings.py"),
|
|
16
|
+
"users.hashed_bearer_tokens_v1": ("users", "users_tokens.py"),
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@migrations_app.command("prepare")
|
|
21
|
+
def prepare(
|
|
22
|
+
upgrade_id: Annotated[str, typer.Argument(help="Stable framework upgrade id.")],
|
|
23
|
+
head: Annotated[str, typer.Option("--head", help="Explicit host head or label@head.")],
|
|
24
|
+
config: Annotated[Path | None, typer.Option("--config", help="Host alembic.ini.")] = None,
|
|
25
|
+
) -> None:
|
|
26
|
+
"""Write a self-contained revision; never connect to or migrate the database."""
|
|
27
|
+
if upgrade_id not in _RECIPES:
|
|
28
|
+
raise typer.BadParameter(f"Unknown upgrade {upgrade_id!r}; choose {', '.join(_RECIPES)}")
|
|
29
|
+
try:
|
|
30
|
+
from alembic.config import Config
|
|
31
|
+
from alembic.script import ScriptDirectory
|
|
32
|
+
from alembic.util.exc import CommandError
|
|
33
|
+
except ImportError as exc:
|
|
34
|
+
raise typer.BadParameter(
|
|
35
|
+
"Run this command in the host environment with Alembic installed"
|
|
36
|
+
) from exc
|
|
37
|
+
|
|
38
|
+
root = Path(os.environ.get("SM_PROJECT_ROOT", Path.cwd()))
|
|
39
|
+
if config is None:
|
|
40
|
+
config = root / "alembic.ini"
|
|
41
|
+
if not config.is_file():
|
|
42
|
+
config = root / "host/alembic.ini"
|
|
43
|
+
if not config.is_file():
|
|
44
|
+
raise typer.BadParameter(f"Host Alembic config not found: {config}")
|
|
45
|
+
try:
|
|
46
|
+
script = ScriptDirectory.from_config(Config(str(config)))
|
|
47
|
+
parent = script.get_revision(head)
|
|
48
|
+
if parent is None or not parent.is_head:
|
|
49
|
+
raise typer.BadParameter("--head must resolve to one existing host head")
|
|
50
|
+
label, recipe = _RECIPES[upgrade_id]
|
|
51
|
+
existing = {name for rev in script.walk_revisions() for name in rev.branch_labels}
|
|
52
|
+
except CommandError as exc:
|
|
53
|
+
raise typer.BadParameter(str(exc)) from exc
|
|
54
|
+
|
|
55
|
+
# Frozen source is copied, so future package changes cannot change this revision.
|
|
56
|
+
source = files("simple_module_cli").joinpath("migration_recipes", recipe).read_text()
|
|
57
|
+
revision = uuid4().hex[:12]
|
|
58
|
+
branch_labels = None if label in existing else (label,)
|
|
59
|
+
identifiers = (
|
|
60
|
+
f"\nrevision = {revision!r}\ndown_revision = {parent.revision!r}\n"
|
|
61
|
+
f"branch_labels = {branch_labels!r}\ndepends_on = None\n"
|
|
62
|
+
)
|
|
63
|
+
path = Path(script.versions) / f"{revision}_{upgrade_id.replace('.', '_')}.py"
|
|
64
|
+
with path.open("x") as output:
|
|
65
|
+
output.write(source + identifiers)
|
|
66
|
+
typer.echo(f"Prepared {upgrade_id}: {path}. Review it, then run alembic upgrade heads.")
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"""``smpy package-update`` — bump simple_module_* deps to latest PyPI versions.
|
|
2
|
+
|
|
3
|
+
Walks the project's ``pyproject.toml`` (and any ``[tool.uv.workspace]`` members),
|
|
4
|
+
finds every dependency whose distribution name starts with ``simple_module_`` /
|
|
5
|
+
``simple-module-``, queries PyPI for the latest non-yanked release, and points
|
|
6
|
+
the constraint at it. Includes optional dependencies and dependency groups.
|
|
7
|
+
Matching npm packages use the selected core release when published on npm.
|
|
8
|
+
|
|
9
|
+
The rewrite preserves the pin style you wrote: ``==0.0.32`` becomes
|
|
10
|
+
``==0.0.33``, ``>=0.0.32`` becomes ``>=0.0.33``, and an upper bound that
|
|
11
|
+
excludes the latest release skips the dependency instead of being dropped.
|
|
12
|
+
``--loosen`` restores the older behaviour of rewriting every constraint to
|
|
13
|
+
``name>=<latest>``.
|
|
14
|
+
|
|
15
|
+
Dependencies whose ``[tool.uv.sources]`` entry points at a workspace member, a
|
|
16
|
+
local path, a git ref, or a URL are left untouched — those aren't installed
|
|
17
|
+
from PyPI.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
23
|
+
from pathlib import Path
|
|
24
|
+
from typing import Annotated
|
|
25
|
+
|
|
26
|
+
import tomlkit
|
|
27
|
+
import typer
|
|
28
|
+
|
|
29
|
+
from simple_module_cli.package_update_deps import (
|
|
30
|
+
Change,
|
|
31
|
+
Skip,
|
|
32
|
+
collect_sm_deps,
|
|
33
|
+
local_sources,
|
|
34
|
+
normalize,
|
|
35
|
+
process_file,
|
|
36
|
+
source_map,
|
|
37
|
+
workspace_member_dirs,
|
|
38
|
+
)
|
|
39
|
+
from simple_module_cli.package_update_npm import load_manifests, plan_npm
|
|
40
|
+
from simple_module_cli.pypi import Fetcher, default_fetcher, fetch_latest
|
|
41
|
+
|
|
42
|
+
__all__ = ["package_update", "run_update"]
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
_CORE = "simple-module-core"
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _npm_target(cache: dict[str, str | None], skips: list[Skip]) -> tuple[str | None, str | None]:
|
|
49
|
+
"""The core version npm pins follow, or why there is none.
|
|
50
|
+
|
|
51
|
+
npm pins move in lockstep with the Python core pin, so when this run left
|
|
52
|
+
that pin alone (an upper bound, a local source) the npm pins stay too.
|
|
53
|
+
"""
|
|
54
|
+
for skip in skips:
|
|
55
|
+
if normalize(skip.package) == _CORE:
|
|
56
|
+
return None, f"simple_module_core not updated ({skip.reason})"
|
|
57
|
+
latest = next((v for n, v in cache.items() if normalize(n) == _CORE), None)
|
|
58
|
+
return latest, None if latest else "simple_module_core has no eligible release on PyPI"
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _print_summary(changes: list[Change], skips: list[Skip], dry_run: bool) -> None:
|
|
62
|
+
if not changes and not skips:
|
|
63
|
+
typer.echo("No simple_module_* or @simple-module-py/* dependencies found.")
|
|
64
|
+
return
|
|
65
|
+
by_file: dict[Path, list[str]] = {}
|
|
66
|
+
for c in changes:
|
|
67
|
+
by_file.setdefault(c.file, []).append(f" {c.package}: {c.old} → {c.new}")
|
|
68
|
+
for s in skips:
|
|
69
|
+
by_file.setdefault(s.file, []).append(f" {s.package}: skipped ({s.reason})")
|
|
70
|
+
for file, lines in by_file.items():
|
|
71
|
+
typer.echo(f"\n{file}")
|
|
72
|
+
for line in lines:
|
|
73
|
+
typer.echo(line)
|
|
74
|
+
if changes:
|
|
75
|
+
verb = "Would update" if dry_run else "Updated"
|
|
76
|
+
file_count = len({c.file for c in changes})
|
|
77
|
+
typer.echo(f"\n{verb} {len(changes)} dependency(ies) across {file_count} file(s).")
|
|
78
|
+
if not dry_run:
|
|
79
|
+
if any(c.file.suffix == ".toml" for c in changes):
|
|
80
|
+
typer.echo("Run `uv sync` to apply Python changes.")
|
|
81
|
+
for directory in sorted(
|
|
82
|
+
{c.file.parent for c in changes if c.file.name == "package.json"}
|
|
83
|
+
):
|
|
84
|
+
typer.echo(f"Run `npm install` in {directory} to apply npm changes.")
|
|
85
|
+
elif skips:
|
|
86
|
+
typer.echo("\nNo updates applied.")
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def run_update(
|
|
90
|
+
path: Path,
|
|
91
|
+
*,
|
|
92
|
+
dry_run: bool = False,
|
|
93
|
+
include_pre: bool = False,
|
|
94
|
+
loosen: bool = False,
|
|
95
|
+
fetcher: Fetcher | None = None,
|
|
96
|
+
) -> None:
|
|
97
|
+
"""Programmatic entry point — separated from the Typer command for testing."""
|
|
98
|
+
path = path.resolve()
|
|
99
|
+
root = path if path.name == "pyproject.toml" else path / "pyproject.toml"
|
|
100
|
+
if not root.is_file():
|
|
101
|
+
typer.echo(f"ERROR: {root} not found.", err=True)
|
|
102
|
+
raise typer.Exit(code=1)
|
|
103
|
+
|
|
104
|
+
fetch = fetcher or default_fetcher
|
|
105
|
+
root_doc = tomlkit.parse(root.read_bytes().decode("utf-8"))
|
|
106
|
+
files: list[tuple[Path, tomlkit.TOMLDocument]] = [(root, root_doc)]
|
|
107
|
+
for member in workspace_member_dirs(root, root_doc):
|
|
108
|
+
if member == root:
|
|
109
|
+
continue
|
|
110
|
+
files.append((member, tomlkit.parse(member.read_bytes().decode("utf-8"))))
|
|
111
|
+
|
|
112
|
+
npm_manifests = load_manifests([file.parent for file, _ in files])
|
|
113
|
+
inherited = source_map(root_doc)
|
|
114
|
+
locals_by_file = {file: local_sources(doc, inherited) for file, doc in files}
|
|
115
|
+
|
|
116
|
+
# Pre-fetch all unique sm packages in parallel — PyPI calls dominate runtime.
|
|
117
|
+
names = {n for file, doc in files for n in collect_sm_deps(doc, locals_by_file[file])}
|
|
118
|
+
if any(manifest.packages for manifest in npm_manifests) and not any(
|
|
119
|
+
normalize(n) == _CORE for n in names
|
|
120
|
+
):
|
|
121
|
+
names.add("simple_module_core")
|
|
122
|
+
unique_names = sorted(names)
|
|
123
|
+
cache: dict[str, str | None] = {}
|
|
124
|
+
if unique_names:
|
|
125
|
+
with ThreadPoolExecutor(max_workers=min(8, len(unique_names))) as pool:
|
|
126
|
+
results = pool.map(
|
|
127
|
+
lambda n: (n, fetch_latest(n, include_pre=include_pre, fetcher=fetch)),
|
|
128
|
+
unique_names,
|
|
129
|
+
)
|
|
130
|
+
cache = dict(results)
|
|
131
|
+
|
|
132
|
+
all_changes: list[Change] = []
|
|
133
|
+
all_skips: list[Skip] = []
|
|
134
|
+
pending: list[tuple[Path, str]] = []
|
|
135
|
+
|
|
136
|
+
for file, doc in files:
|
|
137
|
+
changes, skips, new_doc = process_file(
|
|
138
|
+
file, doc, cache=cache, loosen=loosen, local=locals_by_file[file]
|
|
139
|
+
)
|
|
140
|
+
all_changes.extend(changes)
|
|
141
|
+
all_skips.extend(skips)
|
|
142
|
+
if new_doc is not None:
|
|
143
|
+
pending.append((file, tomlkit.dumps(new_doc)))
|
|
144
|
+
|
|
145
|
+
target, blocked = _npm_target(cache, all_skips)
|
|
146
|
+
changes, skips, npm_pending = plan_npm(npm_manifests, target, fetch, blocked=blocked)
|
|
147
|
+
all_changes.extend(changes)
|
|
148
|
+
all_skips.extend(skips)
|
|
149
|
+
pending.extend(npm_pending)
|
|
150
|
+
|
|
151
|
+
if not dry_run:
|
|
152
|
+
for file, content in pending:
|
|
153
|
+
# newline="" keeps each file's own line endings (CRLF must not become CRCRLF).
|
|
154
|
+
file.write_text(content, encoding="utf-8", newline="")
|
|
155
|
+
|
|
156
|
+
_print_summary(all_changes, all_skips, dry_run)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def package_update(
|
|
160
|
+
path: Annotated[
|
|
161
|
+
Path,
|
|
162
|
+
typer.Option("--path", help="Project root or pyproject.toml. Defaults to cwd."),
|
|
163
|
+
] = Path(),
|
|
164
|
+
dry_run: Annotated[
|
|
165
|
+
bool,
|
|
166
|
+
typer.Option("--dry-run", help="Show planned changes without writing."),
|
|
167
|
+
] = False,
|
|
168
|
+
include_pre: Annotated[
|
|
169
|
+
bool,
|
|
170
|
+
typer.Option("--include-pre", help="Include pre-release versions."),
|
|
171
|
+
] = False,
|
|
172
|
+
loosen: Annotated[
|
|
173
|
+
bool,
|
|
174
|
+
typer.Option(
|
|
175
|
+
"--loosen",
|
|
176
|
+
help="Rewrite Python constraints to `>=<latest>` instead of keeping their operator.",
|
|
177
|
+
),
|
|
178
|
+
] = False,
|
|
179
|
+
) -> None:
|
|
180
|
+
"""Update simple_module_* dependencies and lockstep @simple-module-py/* pins.
|
|
181
|
+
|
|
182
|
+
Each constraint keeps the operator it already has — `==0.0.32` becomes
|
|
183
|
+
`==0.0.33`, `>=0.0.32` becomes `>=0.0.33` — so bumping versions never
|
|
184
|
+
silently changes a project's pinning policy. A dependency whose upper
|
|
185
|
+
bound excludes the latest release is reported and left alone. Pass
|
|
186
|
+
`--loosen` to rewrite Python constraints to `>=<latest>` instead.
|
|
187
|
+
npm pins keep exact, caret or tilde style and skip unpublished core versions.
|
|
188
|
+
"""
|
|
189
|
+
run_update(path, dry_run=dry_run, include_pre=include_pre, loosen=loosen)
|