git-repokit 0.10.3__tar.gz → 0.10.4__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.
- {git_repokit-0.10.3/git_repokit.egg-info → git_repokit-0.10.4}/PKG-INFO +1 -1
- {git_repokit-0.10.3 → git_repokit-0.10.4/git_repokit.egg-info}/PKG-INFO +1 -1
- {git_repokit-0.10.3 → git_repokit-0.10.4}/git_repokit.egg-info/SOURCES.txt +1 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/pyproject.toml +1 -1
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/__version__.py +1 -1
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/branch_utils.py +2 -6
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/cli.py +85 -23
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/config.py +12 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/github_create.py +88 -39
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/github_setup.py +99 -7
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/remote_integration.py +30 -1
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/repo_manager.py +3 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_github_setup.py +9 -3
- git_repokit-0.10.4/tests/test_github_setup_publish.py +343 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/LICENSE +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/MANIFEST.in +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/README.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/git_repokit.egg-info/dependency_links.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/git_repokit.egg-info/entry_points.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/git_repokit.egg-info/requires.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/git_repokit.egg-info/top_level.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/__init__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/__main__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/_vendor/__init__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/_vendor/ailib/__init__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/_vendor/ailib/analyzer.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/_vendor/ailib/backend.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/_vendor/ailib/cache.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/_vendor/ailib/parsers.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/_vendor/ailib/transports/__init__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/_vendor/ailib/transports/cli.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/_vendor/ailib/transports/openai_compat.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/_vendor/ailib/transports/prompt_file.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/_vendor/ailib/types.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/auth_integration.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/badges.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/common_kit.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/defaults.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/directory_analyzer.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/directory_profiles.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/git_config.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/guardrails.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/history_cleaner.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/history_protection.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/hooks/pre-commit-guardrails +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/hooks/pre-commit-template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/layers.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/0bsd.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/LICENSES.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/__init__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/agpl-3.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/all-rights-reserved.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/apache-2.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/bsd-2-clause.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/bsd-3-clause.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/bsl-1.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/cc-by-4.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/cc-by-sa-4.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/cc0-1.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/epl-2.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/gpl-2.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/gpl-3.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/isc.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/lgpl-2.1.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/lgpl-3.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/mit.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/mpl-2.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/proprietary-evaluation.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/licenses/unlicense.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/readme_blocks.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/template_engine.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/ai/claude/CLAUDE-nested.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/ai/claude/CLAUDE.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/ai/claude/instructions/step1_context_rebuilder.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/ai/claude/instructions/step2_dev_workflow_process.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/ai/claude/instructions/step3_context_bridge.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/common/CHANGELOG.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/common/CONTRIBUTING.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/common/README.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/common/gitattributes.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/common/gitignore.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/extras/FUNDING.yml.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/extras/ROADMAP.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/extras/dependabot.yml.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/extras/one-offs-README.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/extras/platform-support.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/extras/pull_request_template.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/extras/release-template.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/extras/settings.json.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/extras/stale.yml.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/github/CODEOWNERS.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/github/ISSUE_TEMPLATE/bug-report.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/github/ISSUE_TEMPLATE/feature-request.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/github/issues/notes.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/github/issues/roadmap.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/hooks/pre-commit.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/any/claude-plugin/.claude-plugin/marketplace.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/any/claude-plugin/plugin/.claude-plugin/plugin.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/any/claude-plugin/plugin/README.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/cmake-app/.github/workflows/ci-c-cpp.yml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/cmake-app/.repokit-common.toml.rkappend +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/cmake-app/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/cmake-app/.vscode/tasks.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/cmake-app/CMakeLists.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/cmake-app/CMakePresets.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/cmake-app/cmake/GenerateStamp.cmake +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/cmake-app/src/main.cpp +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/cmake-app/tests/test_version.cpp +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/cmake-app/vcpkg.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/minimal/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/minimal/Makefile +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/minimal/build.bat +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/minimal/src/__RK_SNAKE__.c +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/msbuild/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/msbuild/.vscode/tasks.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/msbuild/__RK_PROJECT__.sln +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/msbuild/__RK_PROJECT__.vcxproj +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/c-cpp/msbuild/src/main.cpp +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/claude-plugin/.repokit-common.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/claude-plugin/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/claude-plugin/plugin/hooks/hooks.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/claude-plugin/plugin/hooks/scripts/session-start.mjs +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/claude-plugin/plugin/tests/manifest.test.js +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/node/.repokit-common.toml.rkappend +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/node/package.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/node-package/.github/workflows/release.yml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/node-package/package.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/node-package/src/index.ts +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/node-package/tests/index.test.ts +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/script/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/script/__RK_PROJECT__.js +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/script/tests/version.test.js +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/ts/package.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/js-ts/ts/tsconfig.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/paradox/ck3/.repokit-common.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/paradox/ck3/mod/descriptor.mod +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/paradox/clausewitz/mod/localisation/english/__RK_SNAKE___l_english.yml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/paradox/descriptor-mod/mod/descriptor.mod +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/paradox/descriptor-mod/mod/thumbnail.png +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/paradox/jomini/mod/localization/english/__RK_SNAKE___l_english.yml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/claude-plugin/.github/workflows/ci-python.yml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/claude-plugin/.repokit-common.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/claude-plugin/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/claude-plugin/VERSION +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/claude-plugin/plugin/hooks/hooks.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/claude-plugin/plugin/hooks/scripts/run-hook.mjs +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/claude-plugin/plugin/hooks/scripts/session_start.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/claude-plugin/plugin/tests/test_manifest.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/pypi/.github/workflows/release.yml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/pypi/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/__init__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/__main__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/_version.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/cli.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/pypi/pyproject.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/pypi/tests/conftest.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/pypi/tests/test_version.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/script/.github/workflows/ci-python.yml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/script/.repokit-common.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/script/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/script/VERSION +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/script/__RK_PROJECT__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/script/tests/test_version.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/setuppy/requirements.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/archetypes/python/setuppy/setup.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/c-cpp/.gitignore.rkappend +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/c-cpp/.repokit-common.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/c-cpp/include/__RK_SNAKE__/version.h +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/c-cpp/src/app.rc +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/js-ts/.editorconfig +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/js-ts/.github/workflows/ci-js-ts.yml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/js-ts/.gitignore.rkappend +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/js-ts/.repokit-common.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/js-ts/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/js-ts/VERSION +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/paradox/.gitattributes.rkappend +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/paradox/.repokit-common.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/paradox/VERSION +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/paradox/docs/modding.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/python/.github/workflows/ci-python.yml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/python/.gitignore.rkappend +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/languages/python/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/layers/manifest.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/vault/CLAUDE.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/vault/claude/_maps/MOC-project.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/vault/claude/_oracle/backlinks.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/vault/claude/_oracle/concepts.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/vault/claude/_oracle/manifest.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/vault/claude/_todo/ACTIVE-WORK.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/templates/vault/claude/_todo/OPEN-LOOPS.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/utils.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/repokit/vault.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/setup.cfg +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/setup.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_badges.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_branch_strategies.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_cli_examples.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_cli_integration.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_common_guard.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_core_functionality.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_deployment_scenarios.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_directory_profiles.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_docs_links.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_extras_cli.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_github_create.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_github_integration.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_github_owner.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_guardrails.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_hermetic.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_hook_encoding.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_hook_patterns.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_languages_setting.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_layer_action_pins.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_layers.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_layers_c_cpp.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_layers_claude_plugin.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_layers_cli.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_layers_compositions.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_layers_js_ts.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_layers_vscode.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_legacy_smoke.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_license_adopt.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_license_cli.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_licenses.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_list_templates.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_new_default.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_packaging.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_paradox.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_private_branch_create.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_private_modes.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_readme_blocks.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_run_tests_driver.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_template_parity.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_utils.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_vault_bootstrap.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.4}/tests/test_vendored_ailib.py +0 -0
|
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
|
|
|
8
8
|
# PyPI's trusted publisher is registered for this name (DazzleTools/git-repokit,
|
|
9
9
|
# publish.yml, environment pypi); the command stays `repokit`
|
|
10
10
|
name = "git-repokit"
|
|
11
|
-
version = "0.10.
|
|
11
|
+
version = "0.10.4"
|
|
12
12
|
description = "Create standardized Git repositories: language presets, licenses, GitHub setup, and a private notes vault"
|
|
13
13
|
readme = "README.md"
|
|
14
14
|
license = "MIT"
|
|
@@ -5,5 +5,5 @@ off for this project); tests/test_packaging.py fails when the two differ, as
|
|
|
5
5
|
they did at 0.10.0 and 0.10.1, whose `repokit --version` printed 0.9.12.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = "0.10.
|
|
8
|
+
__version__ = "0.10.4"
|
|
9
9
|
__version_info__ = tuple(int(part) for part in __version__.split("."))
|
|
@@ -26,13 +26,9 @@ def promoted_folders(repo_path: str) -> List[str]:
|
|
|
26
26
|
"""The folders this project tracks on its private branch (0.10.3), from
|
|
27
27
|
its record: .repokit.json's private_mode and private_exposure. Empty for
|
|
28
28
|
a nested project or one with no record."""
|
|
29
|
-
import
|
|
29
|
+
from .config import read_project_record
|
|
30
30
|
from .defaults import BRANCH_MODES
|
|
31
|
-
|
|
32
|
-
with open(os.path.join(repo_path, ".repokit.json"), encoding="utf-8") as f:
|
|
33
|
-
record = json.load(f)
|
|
34
|
-
except (OSError, ValueError):
|
|
35
|
-
return []
|
|
31
|
+
record = read_project_record(repo_path)
|
|
36
32
|
mode = record.get("private_mode")
|
|
37
33
|
if mode not in BRANCH_MODES:
|
|
38
34
|
return []
|
|
@@ -11,7 +11,7 @@ import json
|
|
|
11
11
|
import argparse
|
|
12
12
|
import logging
|
|
13
13
|
import subprocess
|
|
14
|
-
from typing import Dict, Any, Optional
|
|
14
|
+
from typing import Dict, Any, List, Optional, Tuple
|
|
15
15
|
|
|
16
16
|
from .config import ConfigManager
|
|
17
17
|
from .defaults import BRANCH_STRATEGIES, DEFAULT_ADOPT_STRATEGY, PRIVATE_BRANCH_STRATEGIES, PRIVATE_MODES
|
|
@@ -213,21 +213,7 @@ Recipe: Microservice
|
|
|
213
213
|
help="Write none of the extras, whatever the global config says"
|
|
214
214
|
)
|
|
215
215
|
|
|
216
|
-
create_parser
|
|
217
|
-
"--github-setup",
|
|
218
|
-
dest="github_setup",
|
|
219
|
-
action="append",
|
|
220
|
-
metavar="STEP[,STEP...]",
|
|
221
|
-
help="With --github, what to set up on the new repository: labels, issues (the Roadmap and "
|
|
222
|
-
"Quick Notes as #1 and #2, before the first push), pin, discussions, topics, "
|
|
223
|
-
"pypi-environment, traffic (prints ghtraf's commands), or all. Off unless named here "
|
|
224
|
-
"or in the global config's `github_setup` list."
|
|
225
|
-
)
|
|
226
|
-
create_parser.add_argument(
|
|
227
|
-
"--topics",
|
|
228
|
-
metavar="TOPIC[,TOPIC...]",
|
|
229
|
-
help="Repository topics for --github-setup topics"
|
|
230
|
-
)
|
|
216
|
+
_add_github_setup_args(create_parser)
|
|
231
217
|
create_parser.add_argument(
|
|
232
218
|
"--badges",
|
|
233
219
|
metavar="TEMPLATE|BADGE[,BADGE...]",
|
|
@@ -921,6 +907,7 @@ For more detailed documentation, see: docs/Adoption-Guide.md
|
|
|
921
907
|
action="store_true",
|
|
922
908
|
help="Don't push branches after creating remote repository"
|
|
923
909
|
)
|
|
910
|
+
_add_github_setup_args(adopt_remote_group)
|
|
924
911
|
|
|
925
912
|
# Authentication
|
|
926
913
|
adopt_auth_group = adopt_parser.add_argument_group("Authentication")
|
|
@@ -1058,6 +1045,7 @@ Examples:
|
|
|
1058
1045
|
nargs="+",
|
|
1059
1046
|
help="Exclude these branches from publishing (in addition to private)"
|
|
1060
1047
|
)
|
|
1048
|
+
_add_github_setup_args(publish_parser)
|
|
1061
1049
|
|
|
1062
1050
|
# BOOTSTRAP command
|
|
1063
1051
|
bootstrap_parser = subparsers.add_parser(
|
|
@@ -1637,6 +1625,67 @@ def _known_language_names():
|
|
|
1637
1625
|
return ["generic"]
|
|
1638
1626
|
|
|
1639
1627
|
|
|
1628
|
+
|
|
1629
|
+
def _add_github_setup_args(parser) -> None:
|
|
1630
|
+
"""--github-setup, --topics and --no-github-setup (create, adopt, publish)."""
|
|
1631
|
+
parser.add_argument(
|
|
1632
|
+
"--github-setup", dest="github_setup", action="append", metavar="STEP[,STEP...]",
|
|
1633
|
+
help="With --github or --publish-to github, what to set up on the repository: labels, issues "
|
|
1634
|
+
"(the Roadmap and Quick Notes as #1 and #2, before the first push), pin, discussions, "
|
|
1635
|
+
"topics, pypi-environment, traffic (prints ghtraf's commands), or all. Default: the "
|
|
1636
|
+
"global config's `github_setup` list; none when it names none."
|
|
1637
|
+
)
|
|
1638
|
+
parser.add_argument("--topics", metavar="TOPIC[,TOPIC...]", help="Repository topics for --github-setup topics")
|
|
1639
|
+
parser.add_argument(
|
|
1640
|
+
"--no-github-setup", action="store_true",
|
|
1641
|
+
help="Set nothing up on GitHub, whatever the config's `github_setup` says"
|
|
1642
|
+
)
|
|
1643
|
+
|
|
1644
|
+
|
|
1645
|
+
def _publish_setup(args, config: Dict[str, Any], repo_root: str, service: str,
|
|
1646
|
+
report: List[str]) -> Tuple[Dict[str, Any], Optional[str]]:
|
|
1647
|
+
"""The GitHub setup for a --publish-to run: the hooks to hand
|
|
1648
|
+
setup_remote_repository, or what is wrong. Steps come from --github-setup,
|
|
1649
|
+
else the config's `github_setup`; --no-github-setup empties them. The
|
|
1650
|
+
project's own .repokit.json supplies its name, extras, archetype and topics."""
|
|
1651
|
+
if service != "github":
|
|
1652
|
+
if getattr(args, "github_setup", None):
|
|
1653
|
+
return {}, "--github-setup works with --publish-to github only"
|
|
1654
|
+
return {}, None
|
|
1655
|
+
from . import github_setup
|
|
1656
|
+
from .config import read_project_record
|
|
1657
|
+
from .github_create import publish_hooks
|
|
1658
|
+
try:
|
|
1659
|
+
steps = github_setup.setup_names(config.get("github_setup"))
|
|
1660
|
+
except ValueError as e:
|
|
1661
|
+
return {}, str(e)
|
|
1662
|
+
if not steps:
|
|
1663
|
+
return {}, None
|
|
1664
|
+
facts = read_project_record(repo_root)
|
|
1665
|
+
setup_config = dict(config)
|
|
1666
|
+
for key in ("project_name", "extras", "archetype"):
|
|
1667
|
+
if facts.get(key):
|
|
1668
|
+
setup_config[key] = facts[key]
|
|
1669
|
+
if not setup_config.get("topics") and facts.get("topics"):
|
|
1670
|
+
setup_config["topics"] = facts["topics"]
|
|
1671
|
+
after_create, after_push = publish_hooks(repo_root, setup_config, steps, report)
|
|
1672
|
+
return {"after_create": after_create, "after_push": after_push}, None
|
|
1673
|
+
|
|
1674
|
+
|
|
1675
|
+
def _publish_with_setup(args, config: Dict[str, Any], repo_root: str, service: str,
|
|
1676
|
+
remote_integration, **remote) -> bool:
|
|
1677
|
+
"""setup_remote_repository with the GitHub setup's hooks, the setup's
|
|
1678
|
+
report printed afterwards. False on a refused setup or a failed publish."""
|
|
1679
|
+
report: List[str] = []
|
|
1680
|
+
hooks, problem = _publish_setup(args, config, repo_root, service, report)
|
|
1681
|
+
if problem:
|
|
1682
|
+
logging.getLogger("repokit").error(problem)
|
|
1683
|
+
return False
|
|
1684
|
+
ok = remote_integration.setup_remote_repository(service=service, **remote, **hooks)
|
|
1685
|
+
for line in report:
|
|
1686
|
+
print(f"GitHub: {line}")
|
|
1687
|
+
return ok
|
|
1688
|
+
|
|
1640
1689
|
def args_to_config(args: argparse.Namespace) -> Dict[str, Any]:
|
|
1641
1690
|
"""
|
|
1642
1691
|
Convert command-line arguments to configuration dictionary.
|
|
@@ -1680,8 +1729,11 @@ def args_to_config(args: argparse.Namespace) -> Dict[str, Any]:
|
|
|
1680
1729
|
if getattr(args, "github_setup", None):
|
|
1681
1730
|
from .layers import parse_languages as _split_steps
|
|
1682
1731
|
cli_config["github_setup"] = _split_steps(args.github_setup)
|
|
1732
|
+
if getattr(args, "no_github_setup", False):
|
|
1733
|
+
cli_config["github_setup"] = []
|
|
1683
1734
|
if getattr(args, "topics", None):
|
|
1684
|
-
|
|
1735
|
+
from .layers import parse_languages as _split_topics
|
|
1736
|
+
cli_config["topics"] = _split_topics(args.topics)
|
|
1685
1737
|
if getattr(args, "badges", None):
|
|
1686
1738
|
cli_config["badges"] = args.badges.strip()
|
|
1687
1739
|
if getattr(args, "no_extras", False):
|
|
@@ -2795,8 +2847,8 @@ def main() -> int:
|
|
|
2795
2847
|
if hasattr(args, 'token') and args.token and not token_cmd:
|
|
2796
2848
|
token_cmd = f"echo {args.token}"
|
|
2797
2849
|
|
|
2798
|
-
publish_success =
|
|
2799
|
-
|
|
2850
|
+
publish_success = _publish_with_setup(
|
|
2851
|
+
args, adopt_config, dir_path, publish_to, remote_integration,
|
|
2800
2852
|
remote_name=getattr(args, 'remote_name', None) or adopt_config.get('remote_name', 'origin'),
|
|
2801
2853
|
private=getattr(args, 'private_repo', None) or adopt_config.get('private_repo', False),
|
|
2802
2854
|
push_branches=not getattr(args, 'no_push', False),
|
|
@@ -2865,6 +2917,13 @@ def main() -> int:
|
|
|
2865
2917
|
if problem:
|
|
2866
2918
|
logger.error(problem)
|
|
2867
2919
|
return 1
|
|
2920
|
+
# Unknown --github-setup steps, likewise
|
|
2921
|
+
from .github_setup import setup_names
|
|
2922
|
+
try:
|
|
2923
|
+
setup_names(config.get("github_setup"))
|
|
2924
|
+
except ValueError as e:
|
|
2925
|
+
logger.error(str(e))
|
|
2926
|
+
return 1
|
|
2868
2927
|
|
|
2869
2928
|
# The GitHub login, before any file is written: the files' URLs,
|
|
2870
2929
|
# CODEOWNERS and FUNDING name it (0.9.6; before, they carried the
|
|
@@ -2922,8 +2981,8 @@ def main() -> int:
|
|
|
2922
2981
|
verbose=args.verbose,
|
|
2923
2982
|
)
|
|
2924
2983
|
|
|
2925
|
-
publish_success =
|
|
2926
|
-
|
|
2984
|
+
publish_success = _publish_with_setup(
|
|
2985
|
+
args, repo_manager.config, repo_manager.repo_root, args.publish_to, remote_integration,
|
|
2927
2986
|
remote_name=args.remote_name,
|
|
2928
2987
|
private=args.private_repo,
|
|
2929
2988
|
push_branches=not args.no_push,
|
|
@@ -2989,8 +3048,11 @@ def main() -> int:
|
|
|
2989
3048
|
if args.token and not token_cmd:
|
|
2990
3049
|
token_cmd = f"echo {args.token}"
|
|
2991
3050
|
|
|
2992
|
-
|
|
2993
|
-
|
|
3051
|
+
# update_existing: a project already on GitHub is pushed and set
|
|
3052
|
+
# up, nothing created (publish only; adopt still creates)
|
|
3053
|
+
publish_success = _publish_with_setup(
|
|
3054
|
+
args, config, repo_path, args.publish_to, remote_integration,
|
|
3055
|
+
update_existing=True,
|
|
2994
3056
|
remote_name=args.remote_name,
|
|
2995
3057
|
private=args.private_repo,
|
|
2996
3058
|
push_branches=not args.no_push,
|
|
@@ -14,6 +14,18 @@ from pathlib import Path
|
|
|
14
14
|
from typing import Dict, Any, Optional, List, Union
|
|
15
15
|
|
|
16
16
|
from .directory_profiles import DirectoryProfileManager
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def read_project_record(repo_root: str) -> Dict[str, Any]:
|
|
20
|
+
"""A project's own .repokit.json, read from its root (not the current
|
|
21
|
+
directory, which is what ConfigManager reads), or {} when absent or
|
|
22
|
+
unreadable."""
|
|
23
|
+
try:
|
|
24
|
+
with open(os.path.join(repo_root, ".repokit.json"), encoding="utf-8") as f:
|
|
25
|
+
record = json.load(f)
|
|
26
|
+
except (OSError, ValueError):
|
|
27
|
+
return {}
|
|
28
|
+
return record if isinstance(record, dict) else {}
|
|
17
29
|
from .defaults import (
|
|
18
30
|
DEFAULT_PRIVATE_DIRS,
|
|
19
31
|
DEFAULT_PRIVATE_DIR_SETS,
|
|
@@ -13,10 +13,11 @@ explicitly.
|
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
15
|
import os
|
|
16
|
+
import re
|
|
16
17
|
import shutil
|
|
17
18
|
import subprocess
|
|
18
19
|
import sys
|
|
19
|
-
from typing import List, Optional, Tuple
|
|
20
|
+
from typing import Callable, List, Optional, Tuple
|
|
20
21
|
|
|
21
22
|
from .defaults import strategy_push_branches
|
|
22
23
|
|
|
@@ -48,9 +49,14 @@ def gh_login(cwd: str) -> Optional[str]:
|
|
|
48
49
|
gh = gh_command()
|
|
49
50
|
if gh is None:
|
|
50
51
|
return None
|
|
52
|
+
return _read_login(gh, cwd)[0]
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def _read_login(gh: List[str], cwd: str) -> Tuple[Optional[str], str]:
|
|
56
|
+
"""(the account gh is logged into or None, gh's raw answer)."""
|
|
51
57
|
rc, out = _run(gh + ["api", "user", "-q", ".login"], cwd)
|
|
52
58
|
login = out.splitlines()[-1].strip() if rc == 0 and out else ""
|
|
53
|
-
return login or None
|
|
59
|
+
return login or None, out
|
|
54
60
|
|
|
55
61
|
|
|
56
62
|
def branches_to_push(config: dict, private_branch: Optional[str], existing: List[str]) -> List[str]:
|
|
@@ -59,6 +65,75 @@ def branches_to_push(config: dict, private_branch: Optional[str], existing: List
|
|
|
59
65
|
return [b for b in wanted if b in existing and b != private_branch]
|
|
60
66
|
|
|
61
67
|
|
|
68
|
+
def gh_ready(repo_root: str, config: dict,
|
|
69
|
+
organization: Optional[str] = None) -> Tuple[Optional[List[str]], Optional[str], Optional[str]]:
|
|
70
|
+
"""(gh, login, problem): gh is installed, logged in, and logged into the
|
|
71
|
+
account the config names (0.9.3: refuse on another account)."""
|
|
72
|
+
gh = gh_command()
|
|
73
|
+
if gh is None:
|
|
74
|
+
return None, None, "gh (the GitHub CLI) is not installed; see https://cli.github.com"
|
|
75
|
+
rc, out = _run(gh + ["auth", "status"], repo_root)
|
|
76
|
+
if rc != 0:
|
|
77
|
+
return gh, None, f"gh is not logged in (run `gh auth login`): {out}"
|
|
78
|
+
login, out = _read_login(gh, repo_root)
|
|
79
|
+
if not organization and not login:
|
|
80
|
+
return gh, None, f"could not read the GitHub user from gh: {out}"
|
|
81
|
+
github_cfg = config.get("github") if isinstance(config.get("github"), dict) else {}
|
|
82
|
+
configured = (github_cfg or {}).get("username")
|
|
83
|
+
if configured and login and configured.lower() != login.lower():
|
|
84
|
+
return gh, login, (f"gh is logged into {login!r} but the config's github.username is {configured!r}; "
|
|
85
|
+
"switch with `gh auth switch` or fix the config")
|
|
86
|
+
return gh, login, None
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
_GITHUB_URL = re.compile(r"github\.com[:/]+([^/\s]+)/([^/\s]+?)(?:\.git)?/?$")
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def github_repo_of(url: Optional[str]) -> Optional[str]:
|
|
93
|
+
"""'owner/name' from a GitHub https or ssh URL, else None."""
|
|
94
|
+
m = _GITHUB_URL.search((url or "").strip())
|
|
95
|
+
return f"{m.group(1)}/{m.group(2)}" if m else None
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def publish_hooks(repo_root: str, config: dict, steps: List[str], report: List[str],
|
|
99
|
+
ask=None) -> Tuple[Callable[[str], bool], Callable[[str], None]]:
|
|
100
|
+
"""The GitHub setup for the token route (`--publish-to github`): the first
|
|
101
|
+
hook runs in the window between the repository's creation and its first
|
|
102
|
+
push, the second after the push. Both take the repository's URL. When gh
|
|
103
|
+
cannot act (absent, logged out, another account) the setup is skipped with
|
|
104
|
+
one line saying how to run it later, and the publish goes on. The first
|
|
105
|
+
hook returns False when the person aborted at a conflict: stop before the
|
|
106
|
+
push."""
|
|
107
|
+
from . import github_setup
|
|
108
|
+
state: dict = {}
|
|
109
|
+
project = config.get("project_name") or config.get("name") or os.path.basename(repo_root)
|
|
110
|
+
|
|
111
|
+
def after_create(url: str) -> bool:
|
|
112
|
+
repo = github_repo_of(url)
|
|
113
|
+
if not steps or not repo:
|
|
114
|
+
return True
|
|
115
|
+
gh, _login, problem = gh_ready(repo_root, config, organization=repo.split("/")[0])
|
|
116
|
+
if problem:
|
|
117
|
+
report.append(f"setup not run: {problem}. Once gh is ready: "
|
|
118
|
+
f"`repokit publish {repo_root} --publish-to github` finishes it")
|
|
119
|
+
return True
|
|
120
|
+
setup = github_setup.GhSetup(gh, repo, lambda cmd: _run(cmd, repo_root),
|
|
121
|
+
ask=ask or github_setup.ask_conflict)
|
|
122
|
+
state["setup"] = setup
|
|
123
|
+
try:
|
|
124
|
+
report.extend(github_setup.run_before_push(setup, steps, project, repo_root))
|
|
125
|
+
except github_setup.SetupAborted as stop:
|
|
126
|
+
report.append(f"stopped before the push: {stop}")
|
|
127
|
+
return False
|
|
128
|
+
return True
|
|
129
|
+
|
|
130
|
+
def after_push(url: str) -> None:
|
|
131
|
+
if state.get("setup"):
|
|
132
|
+
report.extend(github_setup.run_after_push(state["setup"], steps, config, project))
|
|
133
|
+
|
|
134
|
+
return after_create, after_push
|
|
135
|
+
|
|
136
|
+
|
|
62
137
|
def create_on_github(repo_root: str, name: str, config: dict, private_branch: Optional[str],
|
|
63
138
|
organization: Optional[str] = None, public: bool = False,
|
|
64
139
|
logger=None, report: Optional[List[str]] = None) -> Optional[str]:
|
|
@@ -73,25 +148,9 @@ def create_on_github(repo_root: str, name: str, config: dict, private_branch: Op
|
|
|
73
148
|
steps = github_setup.setup_names(config.get("github_setup"))
|
|
74
149
|
report = report if report is not None else []
|
|
75
150
|
|
|
76
|
-
gh =
|
|
77
|
-
if
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
rc, out = _run(gh + ["auth", "status"], repo_root)
|
|
81
|
-
if rc != 0:
|
|
82
|
-
return f"gh is not logged in (run `gh auth login`): {out}"
|
|
83
|
-
|
|
84
|
-
rc, out = _run(gh + ["api", "user", "-q", ".login"], repo_root)
|
|
85
|
-
login = out.splitlines()[-1].strip() if rc == 0 and out else None
|
|
86
|
-
if not organization and not login:
|
|
87
|
-
return f"could not read the GitHub user from gh: {out}"
|
|
88
|
-
# Refuse on another account: the config names the person's handle, and gh
|
|
89
|
-
# is logged into someone else (0.9.3).
|
|
90
|
-
github_cfg = config.get("github") if isinstance(config.get("github"), dict) else {}
|
|
91
|
-
configured = (github_cfg or {}).get("username")
|
|
92
|
-
if configured and login and configured.lower() != login.lower():
|
|
93
|
-
return (f"gh is logged into {login!r} but the config's github.username is {configured!r}; "
|
|
94
|
-
"switch with `gh auth switch` or fix the config")
|
|
151
|
+
gh, login, problem = gh_ready(repo_root, config, organization)
|
|
152
|
+
if problem:
|
|
153
|
+
return problem
|
|
95
154
|
owner = organization or login
|
|
96
155
|
|
|
97
156
|
create = gh + ["repo", "create", f"{owner}/{name}",
|
|
@@ -107,15 +166,14 @@ def create_on_github(repo_root: str, name: str, config: dict, private_branch: Op
|
|
|
107
166
|
logger.info(f"Created {owner}/{name} on GitHub ({'public' if public else 'private'})")
|
|
108
167
|
|
|
109
168
|
# Before the first push: the labels and the two issues, so they are #1 and #2.
|
|
110
|
-
setup = github_setup.GhSetup(gh, f"{owner}/{name}", lambda cmd: _run(cmd, repo_root)
|
|
169
|
+
setup = github_setup.GhSetup(gh, f"{owner}/{name}", lambda cmd: _run(cmd, repo_root),
|
|
170
|
+
ask=github_setup.ask_conflict)
|
|
111
171
|
project = config.get("name") or name
|
|
112
|
-
|
|
113
|
-
report +=
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if "pin" in steps:
|
|
118
|
-
report += setup.pin()
|
|
172
|
+
try:
|
|
173
|
+
report += github_setup.run_before_push(setup, steps, project, repo_root)
|
|
174
|
+
except github_setup.SetupAborted as stop:
|
|
175
|
+
return (f"stopped before the push: {stop}. {owner}/{name} exists on GitHub; "
|
|
176
|
+
"`repokit publish <path> --publish-to github` pushes and finishes the setup")
|
|
119
177
|
|
|
120
178
|
rc, out = _run(["git", "for-each-ref", "--format=%(refname:short)", "refs/heads"], repo_root)
|
|
121
179
|
existing = out.split()
|
|
@@ -129,14 +187,5 @@ def create_on_github(repo_root: str, name: str, config: dict, private_branch: Op
|
|
|
129
187
|
logger.info(f"Pushed: {', '.join(pushed) or 'nothing'}")
|
|
130
188
|
|
|
131
189
|
# After the push: the settings that need the repository's content or no ordering.
|
|
132
|
-
|
|
133
|
-
report += setup.discussions()
|
|
134
|
-
if "topics" in steps:
|
|
135
|
-
report += setup.topics(list(config.get("topics") or []))
|
|
136
|
-
if "pypi-environment" in steps:
|
|
137
|
-
report += setup.pypi_environment(config.get("archetype"))
|
|
138
|
-
if "traffic" in steps:
|
|
139
|
-
report += setup.traffic(project)
|
|
140
|
-
if steps:
|
|
141
|
-
report += github_setup.reminders(f"{owner}/{name}", list(config.get("extras") or []))
|
|
190
|
+
report += github_setup.run_after_push(setup, steps, config, project)
|
|
142
191
|
return None
|
|
@@ -19,12 +19,39 @@ import json
|
|
|
19
19
|
import os
|
|
20
20
|
import re
|
|
21
21
|
import string
|
|
22
|
+
import sys
|
|
22
23
|
import tempfile
|
|
23
24
|
from pathlib import Path
|
|
24
25
|
from typing import Callable, List, Optional, Tuple
|
|
25
26
|
|
|
26
27
|
STEPS = ("labels", "issues", "pin", "discussions", "topics", "pypi-environment", "traffic")
|
|
27
28
|
|
|
29
|
+
|
|
30
|
+
class SetupAborted(Exception):
|
|
31
|
+
"""The person chose to stop the rest of the setup at a conflict."""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def interactive() -> bool:
|
|
35
|
+
"""Ask only a person at a terminal: never under CI, an agent (CLAUDECODE)
|
|
36
|
+
or REPOKIT_INTERACTIVE=0 -- the rule git-repokit-common 0.4.4's hooks use."""
|
|
37
|
+
if os.environ.get("REPOKIT_INTERACTIVE") == "0" or os.environ.get("CI") or os.environ.get("CLAUDECODE"):
|
|
38
|
+
return False
|
|
39
|
+
try:
|
|
40
|
+
return sys.stdin.isatty()
|
|
41
|
+
except (AttributeError, ValueError):
|
|
42
|
+
return False
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def ask_conflict(message: str) -> str:
|
|
46
|
+
"""'continue', 'skip' or 'abort'. Not interactive: 'skip', never a hang."""
|
|
47
|
+
if not interactive():
|
|
48
|
+
return "skip"
|
|
49
|
+
try:
|
|
50
|
+
answer = input(f"{message}\n [c]ontinue anyway, [s]kip this step, [a]bort the rest? [s] ")
|
|
51
|
+
except EOFError:
|
|
52
|
+
return "skip"
|
|
53
|
+
return {"c": "continue", "a": "abort"}.get(answer.strip().lower()[:1], "skip")
|
|
54
|
+
|
|
28
55
|
# /github-issues-setup, Step 1 (names, colors, descriptions as the skill has them)
|
|
29
56
|
LABELS = [
|
|
30
57
|
("pinned", "d4c5f9", "Permanently open issue"),
|
|
@@ -115,8 +142,9 @@ def render_issue(template: str, project_name: str) -> str:
|
|
|
115
142
|
class GhSetup:
|
|
116
143
|
"""The steps for one repository. Each method returns report lines."""
|
|
117
144
|
|
|
118
|
-
def __init__(self, gh: List[str], repo: str, run: Runner):
|
|
145
|
+
def __init__(self, gh: List[str], repo: str, run: Runner, ask: Optional[Callable[[str], str]] = None):
|
|
119
146
|
self.gh, self.repo, self.run = gh, repo, run
|
|
147
|
+
self.ask = ask or (lambda message: "skip")
|
|
120
148
|
|
|
121
149
|
def _gh(self, *args: str) -> Tuple[int, str]:
|
|
122
150
|
return self.run(self.gh + list(args))
|
|
@@ -146,10 +174,15 @@ class GhSetup:
|
|
|
146
174
|
have.add(name)
|
|
147
175
|
return [f"labels: created {', '.join(made)}" if made else "labels: all already there"]
|
|
148
176
|
|
|
149
|
-
def
|
|
150
|
-
|
|
177
|
+
def _numbered(self, kind: str) -> Optional[list]:
|
|
178
|
+
"""Every issue (kind 'issue') or pull request ('pr'), open or closed, as
|
|
179
|
+
number and title; None when gh cannot list them."""
|
|
180
|
+
rc, out = self._gh(kind, "list", "--repo", self.repo, "--state", "all", "--limit", "100", "--json", "number,title")
|
|
151
181
|
return json.loads(out or "[]") if rc == 0 else None
|
|
152
182
|
|
|
183
|
+
def _issues(self) -> Optional[list]:
|
|
184
|
+
return self._numbered("issue")
|
|
185
|
+
|
|
153
186
|
def issues(self, project_name: str, drafts_dir: Optional[str] = None) -> List[str]:
|
|
154
187
|
existing = self._issues()
|
|
155
188
|
if existing is None:
|
|
@@ -157,12 +190,40 @@ class GhSetup:
|
|
|
157
190
|
titles = {i["title"] for i in existing}
|
|
158
191
|
if all(t in titles for t, _, _ in ISSUES):
|
|
159
192
|
return ["issues: Roadmap and Quick Notes already there"]
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
193
|
+
# Issues and pull requests share one number sequence, and `gh issue
|
|
194
|
+
# list` shows no pull requests: count both, or a Dependabot pull
|
|
195
|
+
# request at #1 would let the Roadmap become #2 unnoticed.
|
|
196
|
+
pulls = self._numbered("pr")
|
|
197
|
+
if pulls is None:
|
|
198
|
+
return ["issues: could not list the pull requests, so #1 and #2 cannot be checked; not created"]
|
|
199
|
+
# Where each would land: the ones present keep their numbers, the
|
|
200
|
+
# missing ones take the next numbers in order.
|
|
201
|
+
everything = existing + pulls
|
|
202
|
+
next_number = max([i["number"] for i in everything] or [0]) + 1
|
|
203
|
+
landing = {}
|
|
204
|
+
for title, _, _ in ISSUES:
|
|
205
|
+
found = next((i["number"] for i in existing if i["title"] == title), None)
|
|
206
|
+
landing[title] = found if found is not None else next_number
|
|
207
|
+
next_number += found is None
|
|
208
|
+
if [landing[t] for t, _, _ in ISSUES] != [1, 2]:
|
|
209
|
+
ours = {t for t, _, _ in ISSUES}
|
|
210
|
+
foreign = sorted((i for i in everything if i["title"] not in ours), key=lambda i: i["number"])
|
|
211
|
+
if foreign:
|
|
212
|
+
first = foreign[0]
|
|
213
|
+
kind = "pull request" if first in pulls else "issue"
|
|
214
|
+
held = f"#{first['number']} is already {kind} {first['title']!r}"
|
|
215
|
+
else:
|
|
216
|
+
held = ", ".join(f"{t} would be #{n}" for t, n in landing.items())
|
|
217
|
+
message = f"issues: {held}, so Roadmap and Quick Notes would not be #1 and #2"
|
|
218
|
+
choice = self.ask(message)
|
|
219
|
+
if choice == "abort":
|
|
220
|
+
raise SetupAborted(message)
|
|
221
|
+
if choice != "continue":
|
|
222
|
+
return [message + "; not created"]
|
|
164
223
|
report = []
|
|
165
224
|
for title, labels, template in ISSUES:
|
|
225
|
+
if title in titles:
|
|
226
|
+
continue
|
|
166
227
|
body = render_issue(template, project_name)
|
|
167
228
|
if drafts_dir and os.path.isdir(drafts_dir):
|
|
168
229
|
Path(drafts_dir, "issue_" + template.replace(".md.template", ".md")).write_text(body, encoding="utf-8")
|
|
@@ -246,3 +307,34 @@ def reminders(repo: str, extras: List[str]) -> List[str]:
|
|
|
246
307
|
out.append("Sponsorships: Settings > General > Features > Sponsorships (FUNDING.yml is in .github/)")
|
|
247
308
|
out.append("Pages, if the project serves docs/: Settings > Pages > main, /docs")
|
|
248
309
|
return out
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
def run_before_push(setup: GhSetup, steps: List[str], project: str, repo_root: str) -> List[str]:
|
|
313
|
+
"""The labels, the two issues and the pins: in the window before the first
|
|
314
|
+
push, so the issues are #1 and #2. May raise SetupAborted."""
|
|
315
|
+
report: List[str] = []
|
|
316
|
+
if "labels" in steps:
|
|
317
|
+
report += setup.labels(referenced_labels(repo_root))
|
|
318
|
+
if "issues" in steps:
|
|
319
|
+
drafts = os.path.join(repo_root, "private", "claude", "issues")
|
|
320
|
+
report += setup.issues(project, drafts if os.path.isdir(drafts) else None)
|
|
321
|
+
if "pin" in steps:
|
|
322
|
+
report += setup.pin()
|
|
323
|
+
return report
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
def run_after_push(setup: GhSetup, steps: List[str], config: dict, project: str) -> List[str]:
|
|
327
|
+
"""The settings that need the repository's content or no ordering, then the
|
|
328
|
+
reminders for what has no API."""
|
|
329
|
+
report: List[str] = []
|
|
330
|
+
if "discussions" in steps:
|
|
331
|
+
report += setup.discussions()
|
|
332
|
+
if "topics" in steps:
|
|
333
|
+
report += setup.topics(list(config.get("topics") or []))
|
|
334
|
+
if "pypi-environment" in steps:
|
|
335
|
+
report += setup.pypi_environment(config.get("archetype"))
|
|
336
|
+
if "traffic" in steps:
|
|
337
|
+
report += setup.traffic(project)
|
|
338
|
+
if steps:
|
|
339
|
+
report += reminders(setup.repo, list(config.get("extras") or []))
|
|
340
|
+
return report
|
|
@@ -10,7 +10,7 @@ import logging
|
|
|
10
10
|
import json
|
|
11
11
|
import subprocess
|
|
12
12
|
import requests
|
|
13
|
-
from typing import Dict, Any, Optional, List, Union, Tuple
|
|
13
|
+
from typing import Callable, Dict, Any, Optional, List, Union, Tuple
|
|
14
14
|
|
|
15
15
|
from .auth_integration import AuthenticationHandler
|
|
16
16
|
from .defaults import strategy_push_branches
|
|
@@ -525,6 +525,9 @@ class RemoteIntegration:
|
|
|
525
525
|
token_command: Optional[str] = None,
|
|
526
526
|
include_branches: Optional[List[str]] = None,
|
|
527
527
|
exclude_branches: Optional[List[str]] = None,
|
|
528
|
+
update_existing: bool = False,
|
|
529
|
+
after_create: Optional[Callable[[str], bool]] = None,
|
|
530
|
+
after_push: Optional[Callable[[str], None]] = None,
|
|
528
531
|
) -> bool:
|
|
529
532
|
"""
|
|
530
533
|
Create a remote repository and push local branches.
|
|
@@ -538,10 +541,24 @@ class RemoteIntegration:
|
|
|
538
541
|
token_command: Command to retrieve token (optional)
|
|
539
542
|
include_branches: Specific branches to push (overrides strategy defaults)
|
|
540
543
|
exclude_branches: Additional branches to exclude (beyond private)
|
|
544
|
+
update_existing: When the remote already names a GitHub
|
|
545
|
+
repository, update it (publish's path): nothing is created,
|
|
546
|
+
the remote is left as it is, the push and the hooks still run
|
|
547
|
+
after_create: Called with the URL between the creation and the
|
|
548
|
+
first push (the GitHub setup's window); False stops before
|
|
549
|
+
the push
|
|
550
|
+
after_push: Called with the URL after the push
|
|
541
551
|
|
|
542
552
|
Returns:
|
|
543
553
|
True if successful, False otherwise
|
|
544
554
|
"""
|
|
555
|
+
if update_existing and service.lower() == "github":
|
|
556
|
+
from .github_create import github_repo_of
|
|
557
|
+
existing_url = (self.repo_manager.run_git(["remote", "get-url", remote_name], check=False) or "").strip()
|
|
558
|
+
if github_repo_of(existing_url):
|
|
559
|
+
self.logger.info(f"{existing_url} already exists: pushing and updating, nothing created")
|
|
560
|
+
return self._finish(existing_url, remote_name, push_branches, include_branches,
|
|
561
|
+
exclude_branches, after_create, after_push)
|
|
545
562
|
repo_name = self.repo_manager.project_name
|
|
546
563
|
description = self.repo_manager.config.get("description", "")
|
|
547
564
|
|
|
@@ -566,6 +583,16 @@ class RemoteIntegration:
|
|
|
566
583
|
remote_url = result
|
|
567
584
|
if not self.add_remote(remote_url, remote_name):
|
|
568
585
|
return False
|
|
586
|
+
return self._finish(remote_url, remote_name, push_branches, include_branches,
|
|
587
|
+
exclude_branches, after_create, after_push)
|
|
588
|
+
|
|
589
|
+
def _finish(self, remote_url, remote_name, push_branches, include_branches,
|
|
590
|
+
exclude_branches, after_create, after_push) -> bool:
|
|
591
|
+
"""The window hook, the push, the after-push hook."""
|
|
592
|
+
if after_create and not after_create(remote_url):
|
|
593
|
+
self.logger.error(f"Stopped before the push; {remote_url} exists. "
|
|
594
|
+
"Run publish again to push and finish.")
|
|
595
|
+
return False
|
|
569
596
|
|
|
570
597
|
# Push branches if requested
|
|
571
598
|
if push_branches:
|
|
@@ -600,6 +627,8 @@ class RemoteIntegration:
|
|
|
600
627
|
)
|
|
601
628
|
return False
|
|
602
629
|
|
|
630
|
+
if after_push:
|
|
631
|
+
after_push(remote_url)
|
|
603
632
|
self.logger.info(f"Successfully set up remote repository at {remote_url}")
|
|
604
633
|
return True
|
|
605
634
|
|
|
@@ -2825,6 +2825,9 @@ exit 0
|
|
|
2825
2825
|
"license": self._license_record(),
|
|
2826
2826
|
"extras": list(self.config.get("extras") or []),
|
|
2827
2827
|
}
|
|
2828
|
+
if self.config.get("topics"):
|
|
2829
|
+
# read back by a later publish's GitHub setup (the topics step)
|
|
2830
|
+
repokit_config["topics"] = list(self.config["topics"])
|
|
2828
2831
|
|
|
2829
2832
|
# Add additional config if available
|
|
2830
2833
|
if self.config.get("description"):
|