git-repokit 0.10.3__tar.gz → 0.10.5__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.5}/PKG-INFO +1 -1
- {git_repokit-0.10.3 → git_repokit-0.10.5/git_repokit.egg-info}/PKG-INFO +1 -1
- {git_repokit-0.10.3 → git_repokit-0.10.5}/git_repokit.egg-info/SOURCES.txt +2 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/pyproject.toml +1 -1
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/__version__.py +1 -1
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/branch_utils.py +2 -6
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/cli.py +172 -26
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/config.py +24 -1
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/github_create.py +91 -40
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/github_setup.py +115 -7
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/__init__.py +14 -12
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/remote_integration.py +40 -3
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/repo_manager.py +6 -2
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_github_setup.py +9 -3
- git_repokit-0.10.5/tests/test_github_setup_publish.py +343 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_license_cli.py +6 -2
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_licenses.py +8 -6
- git_repokit-0.10.5/tests/test_publish_metadata.py +251 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/LICENSE +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/MANIFEST.in +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/README.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/git_repokit.egg-info/dependency_links.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/git_repokit.egg-info/entry_points.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/git_repokit.egg-info/requires.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/git_repokit.egg-info/top_level.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/__init__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/__main__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/_vendor/__init__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/_vendor/ailib/__init__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/_vendor/ailib/analyzer.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/_vendor/ailib/backend.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/_vendor/ailib/cache.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/_vendor/ailib/parsers.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/_vendor/ailib/transports/__init__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/_vendor/ailib/transports/cli.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/_vendor/ailib/transports/openai_compat.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/_vendor/ailib/transports/prompt_file.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/_vendor/ailib/types.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/auth_integration.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/badges.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/common_kit.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/defaults.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/directory_analyzer.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/directory_profiles.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/git_config.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/guardrails.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/history_cleaner.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/history_protection.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/hooks/pre-commit-guardrails +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/hooks/pre-commit-template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/layers.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/0bsd.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/LICENSES.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/agpl-3.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/all-rights-reserved.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/apache-2.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/bsd-2-clause.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/bsd-3-clause.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/bsl-1.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/cc-by-4.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/cc-by-sa-4.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/cc0-1.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/epl-2.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/gpl-2.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/gpl-3.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/isc.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/lgpl-2.1.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/lgpl-3.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/mit.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/mpl-2.0.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/proprietary-evaluation.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/licenses/unlicense.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/readme_blocks.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/template_engine.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/ai/claude/CLAUDE-nested.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/ai/claude/CLAUDE.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/ai/claude/instructions/step1_context_rebuilder.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/ai/claude/instructions/step2_dev_workflow_process.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/ai/claude/instructions/step3_context_bridge.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/common/CHANGELOG.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/common/CONTRIBUTING.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/common/README.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/common/gitattributes.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/common/gitignore.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/extras/FUNDING.yml.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/extras/ROADMAP.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/extras/dependabot.yml.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/extras/one-offs-README.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/extras/platform-support.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/extras/pull_request_template.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/extras/release-template.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/extras/settings.json.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/extras/stale.yml.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/github/CODEOWNERS.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/github/ISSUE_TEMPLATE/bug-report.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/github/ISSUE_TEMPLATE/feature-request.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/github/issues/notes.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/github/issues/roadmap.md.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/hooks/pre-commit.template +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/any/claude-plugin/.claude-plugin/marketplace.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/any/claude-plugin/plugin/.claude-plugin/plugin.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/any/claude-plugin/plugin/README.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/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.5}/repokit/templates/layers/archetypes/c-cpp/cmake-app/.repokit-common.toml.rkappend +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/cmake-app/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/cmake-app/.vscode/tasks.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/cmake-app/CMakeLists.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/cmake-app/CMakePresets.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/cmake-app/cmake/GenerateStamp.cmake +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/cmake-app/src/main.cpp +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/cmake-app/tests/test_version.cpp +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/cmake-app/vcpkg.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/minimal/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/minimal/Makefile +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/minimal/build.bat +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/minimal/src/__RK_SNAKE__.c +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/msbuild/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/msbuild/.vscode/tasks.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/msbuild/__RK_PROJECT__.sln +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/msbuild/__RK_PROJECT__.vcxproj +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/c-cpp/msbuild/src/main.cpp +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/js-ts/claude-plugin/.repokit-common.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/js-ts/claude-plugin/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/js-ts/claude-plugin/plugin/hooks/hooks.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/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.5}/repokit/templates/layers/archetypes/js-ts/claude-plugin/plugin/tests/manifest.test.js +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/js-ts/node/.repokit-common.toml.rkappend +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/js-ts/node/package.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/js-ts/node-package/.github/workflows/release.yml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/js-ts/node-package/package.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/js-ts/node-package/src/index.ts +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/js-ts/node-package/tests/index.test.ts +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/js-ts/script/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/js-ts/script/__RK_PROJECT__.js +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/js-ts/script/tests/version.test.js +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/js-ts/ts/package.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/js-ts/ts/tsconfig.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/paradox/ck3/.repokit-common.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/paradox/ck3/mod/descriptor.mod +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/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.5}/repokit/templates/layers/archetypes/paradox/descriptor-mod/mod/descriptor.mod +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/paradox/descriptor-mod/mod/thumbnail.png +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/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.5}/repokit/templates/layers/archetypes/python/claude-plugin/.github/workflows/ci-python.yml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/claude-plugin/.repokit-common.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/claude-plugin/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/claude-plugin/VERSION +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/claude-plugin/plugin/hooks/hooks.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/claude-plugin/plugin/hooks/scripts/run-hook.mjs +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/claude-plugin/plugin/hooks/scripts/session_start.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/claude-plugin/plugin/tests/test_manifest.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/pypi/.github/workflows/release.yml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/pypi/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/__init__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/__main__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/_version.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/pypi/__RK_SNAKE__/cli.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/pypi/pyproject.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/pypi/tests/conftest.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/pypi/tests/test_version.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/script/.github/workflows/ci-python.yml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/script/.repokit-common.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/script/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/script/VERSION +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/script/__RK_PROJECT__.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/script/tests/test_version.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/setuppy/requirements.txt +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/archetypes/python/setuppy/setup.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/c-cpp/.gitignore.rkappend +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/c-cpp/.repokit-common.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/c-cpp/include/__RK_SNAKE__/version.h +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/c-cpp/src/app.rc +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/js-ts/.editorconfig +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/js-ts/.github/workflows/ci-js-ts.yml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/js-ts/.gitignore.rkappend +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/js-ts/.repokit-common.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/js-ts/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/js-ts/VERSION +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/paradox/.gitattributes.rkappend +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/paradox/.repokit-common.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/paradox/VERSION +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/paradox/docs/modding.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/python/.github/workflows/ci-python.yml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/python/.gitignore.rkappend +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/languages/python/.vscode/launch.json +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/layers/manifest.toml +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/vault/CLAUDE.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/vault/claude/_maps/MOC-project.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/vault/claude/_oracle/backlinks.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/vault/claude/_oracle/concepts.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/vault/claude/_oracle/manifest.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/vault/claude/_todo/ACTIVE-WORK.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/templates/vault/claude/_todo/OPEN-LOOPS.md +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/utils.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/repokit/vault.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/setup.cfg +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/setup.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_badges.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_branch_strategies.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_cli_examples.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_cli_integration.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_common_guard.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_core_functionality.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_deployment_scenarios.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_directory_profiles.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_docs_links.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_extras_cli.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_github_create.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_github_integration.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_github_owner.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_guardrails.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_hermetic.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_hook_encoding.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_hook_patterns.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_languages_setting.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_layer_action_pins.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_layers.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_layers_c_cpp.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_layers_claude_plugin.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_layers_cli.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_layers_compositions.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_layers_js_ts.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_layers_vscode.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_legacy_smoke.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_license_adopt.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_list_templates.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_new_default.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_packaging.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_paradox.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_private_branch_create.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_private_modes.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_readme_blocks.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_run_tests_driver.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_template_parity.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_utils.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_vault_bootstrap.py +0 -0
- {git_repokit-0.10.3 → git_repokit-0.10.5}/tests/test_vendored_ailib.py +0 -0
|
@@ -202,6 +202,7 @@ tests/test_github_create.py
|
|
|
202
202
|
tests/test_github_integration.py
|
|
203
203
|
tests/test_github_owner.py
|
|
204
204
|
tests/test_github_setup.py
|
|
205
|
+
tests/test_github_setup_publish.py
|
|
205
206
|
tests/test_guardrails.py
|
|
206
207
|
tests/test_hermetic.py
|
|
207
208
|
tests/test_hook_encoding.py
|
|
@@ -225,6 +226,7 @@ tests/test_packaging.py
|
|
|
225
226
|
tests/test_paradox.py
|
|
226
227
|
tests/test_private_branch_create.py
|
|
227
228
|
tests/test_private_modes.py
|
|
229
|
+
tests/test_publish_metadata.py
|
|
228
230
|
tests/test_readme_blocks.py
|
|
229
231
|
tests/test_run_tests_driver.py
|
|
230
232
|
tests/test_template_parity.py
|
|
@@ -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.5"
|
|
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.5"
|
|
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")
|
|
@@ -993,7 +980,14 @@ Examples:
|
|
|
993
980
|
|
|
994
981
|
publish_parser.add_argument(
|
|
995
982
|
"--repo-name",
|
|
996
|
-
help="Name for the remote repository (default:
|
|
983
|
+
help="Name for the remote repository (default: the project_name in the project's "
|
|
984
|
+
".repokit.json, else the directory name)"
|
|
985
|
+
)
|
|
986
|
+
|
|
987
|
+
publish_parser.add_argument(
|
|
988
|
+
"--description", "-d",
|
|
989
|
+
help="The repository's description on GitHub (default: the one in the project's "
|
|
990
|
+
".repokit.json). On a repository already on GitHub, sets it."
|
|
997
991
|
)
|
|
998
992
|
|
|
999
993
|
publish_parser.add_argument(
|
|
@@ -1058,6 +1052,7 @@ Examples:
|
|
|
1058
1052
|
nargs="+",
|
|
1059
1053
|
help="Exclude these branches from publishing (in addition to private)"
|
|
1060
1054
|
)
|
|
1055
|
+
_add_github_setup_args(publish_parser)
|
|
1061
1056
|
|
|
1062
1057
|
# BOOTSTRAP command
|
|
1063
1058
|
bootstrap_parser = subparsers.add_parser(
|
|
@@ -1637,6 +1632,124 @@ def _known_language_names():
|
|
|
1637
1632
|
return ["generic"]
|
|
1638
1633
|
|
|
1639
1634
|
|
|
1635
|
+
|
|
1636
|
+
def _add_github_setup_args(parser) -> None:
|
|
1637
|
+
"""--github-setup, --topics and --no-github-setup (create, adopt, publish)."""
|
|
1638
|
+
parser.add_argument(
|
|
1639
|
+
"--github-setup", dest="github_setup", action="append", metavar="STEP[,STEP...]",
|
|
1640
|
+
help="With --github or --publish-to github, what to set up on the repository: labels, issues "
|
|
1641
|
+
"(the Roadmap and Quick Notes as #1 and #2, before the first push), pin, discussions, "
|
|
1642
|
+
"topics, pypi-environment, traffic (prints ghtraf's commands), or all. Default: the "
|
|
1643
|
+
"global config's `github_setup` list; none when it names none."
|
|
1644
|
+
)
|
|
1645
|
+
parser.add_argument("--topics", metavar="TOPIC[,TOPIC...]", help="Repository topics for --github-setup topics")
|
|
1646
|
+
parser.add_argument(
|
|
1647
|
+
"--homepage", metavar="URL",
|
|
1648
|
+
help="The repository's homepage on GitHub. Default: the PyPI page for a preset that "
|
|
1649
|
+
"publishes to PyPI (python/pypi), else none."
|
|
1650
|
+
)
|
|
1651
|
+
parser.add_argument(
|
|
1652
|
+
"--no-github-setup", action="store_true",
|
|
1653
|
+
help="Set nothing up on GitHub, whatever the config's `github_setup` says"
|
|
1654
|
+
)
|
|
1655
|
+
|
|
1656
|
+
|
|
1657
|
+
def _project_metadata(args, repo_root: str) -> Dict[str, Any]:
|
|
1658
|
+
"""What a publish says about the published project (0.10.5): its own
|
|
1659
|
+
.repokit.json, never the current directory's. description: --description,
|
|
1660
|
+
else the record's (a placeholder counts as none); project_name: the
|
|
1661
|
+
record's; topics: --topics, else the record's; archetype and extras: the
|
|
1662
|
+
record's; homepage: --homepage, else "" (the PyPI default is decided at
|
|
1663
|
+
creation). A key the record lacks is empty, never the cwd's value."""
|
|
1664
|
+
from .config import read_project_record, real_description
|
|
1665
|
+
from .layers import parse_languages as _split
|
|
1666
|
+
record = read_project_record(repo_root)
|
|
1667
|
+
topics = _split(args.topics) if getattr(args, "topics", None) else list(record.get("topics") or [])
|
|
1668
|
+
return {
|
|
1669
|
+
"description": real_description(getattr(args, "description", None) or record.get("description")),
|
|
1670
|
+
"project_name": record.get("project_name") or "",
|
|
1671
|
+
"topics": topics,
|
|
1672
|
+
"archetype": record.get("archetype"),
|
|
1673
|
+
"extras": list(record.get("extras") or []),
|
|
1674
|
+
"homepage": getattr(args, "homepage", None) or "",
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
|
|
1678
|
+
def _edit_existing_repository(repo_root: str, config: Dict[str, Any], url: str,
|
|
1679
|
+
description: Optional[str], homepage: Optional[str]) -> Optional[str]:
|
|
1680
|
+
"""`gh repo edit` the description and/or homepage of a repository already
|
|
1681
|
+
on GitHub (publish's update path, only when named). None, or what failed."""
|
|
1682
|
+
from .github_create import _run, gh_ready, github_repo_of
|
|
1683
|
+
if not description and not homepage:
|
|
1684
|
+
# e.g. --description "A new project repository": the placeholder is never sent
|
|
1685
|
+
return "nothing updated: the description named is the placeholder"
|
|
1686
|
+
repo = github_repo_of(url)
|
|
1687
|
+
if not repo:
|
|
1688
|
+
return f"not a GitHub repository: {url}"
|
|
1689
|
+
gh, _login, problem = gh_ready(repo_root, config, organization=repo.split("/")[0])
|
|
1690
|
+
if problem:
|
|
1691
|
+
return f"description/homepage not updated: {problem}"
|
|
1692
|
+
cmd = gh + ["repo", "edit", repo]
|
|
1693
|
+
if description: # never "" (a placeholder emptied by real_description): that would clear GitHub's
|
|
1694
|
+
cmd += ["--description", description]
|
|
1695
|
+
if homepage:
|
|
1696
|
+
cmd += ["--homepage", homepage]
|
|
1697
|
+
rc, out = _run(cmd, repo_root)
|
|
1698
|
+
return None if rc == 0 else f"description/homepage not updated: {out}"
|
|
1699
|
+
|
|
1700
|
+
|
|
1701
|
+
def _apply_project_metadata(config: Dict[str, Any], meta: Dict[str, Any]) -> None:
|
|
1702
|
+
"""Put the published project's metadata into the config the creation
|
|
1703
|
+
reads, replacing whatever the current directory's config supplied."""
|
|
1704
|
+
config["description"] = meta["description"]
|
|
1705
|
+
config["homepage"] = meta["homepage"]
|
|
1706
|
+
config["topics"] = meta["topics"]
|
|
1707
|
+
config["archetype"] = meta["archetype"]
|
|
1708
|
+
config["extras"] = meta["extras"]
|
|
1709
|
+
if meta["project_name"]:
|
|
1710
|
+
config["project_name"] = meta["project_name"]
|
|
1711
|
+
else:
|
|
1712
|
+
config.pop("project_name", None)
|
|
1713
|
+
|
|
1714
|
+
|
|
1715
|
+
def _publish_setup(args, config: Dict[str, Any], repo_root: str, service: str,
|
|
1716
|
+
report: List[str]) -> Tuple[Dict[str, Any], Optional[str]]:
|
|
1717
|
+
"""The GitHub setup for a --publish-to run: the hooks to hand
|
|
1718
|
+
setup_remote_repository, or what is wrong. Steps come from --github-setup,
|
|
1719
|
+
else the config's `github_setup`; --no-github-setup empties them. The
|
|
1720
|
+
project's metadata is already in the config: publish and adopt apply the
|
|
1721
|
+
published project's own record (_apply_project_metadata), create's config
|
|
1722
|
+
is the project's own."""
|
|
1723
|
+
if service != "github":
|
|
1724
|
+
if getattr(args, "github_setup", None):
|
|
1725
|
+
return {}, "--github-setup works with --publish-to github only"
|
|
1726
|
+
return {}, None
|
|
1727
|
+
from . import github_setup
|
|
1728
|
+
from .github_create import publish_hooks
|
|
1729
|
+
try:
|
|
1730
|
+
steps = github_setup.setup_names(config.get("github_setup"))
|
|
1731
|
+
except ValueError as e:
|
|
1732
|
+
return {}, str(e)
|
|
1733
|
+
if not steps:
|
|
1734
|
+
return {}, None
|
|
1735
|
+
after_create, after_push = publish_hooks(repo_root, dict(config), steps, report)
|
|
1736
|
+
return {"after_create": after_create, "after_push": after_push}, None
|
|
1737
|
+
|
|
1738
|
+
|
|
1739
|
+
def _publish_with_setup(args, config: Dict[str, Any], repo_root: str, service: str,
|
|
1740
|
+
remote_integration, **remote) -> bool:
|
|
1741
|
+
"""setup_remote_repository with the GitHub setup's hooks, the setup's
|
|
1742
|
+
report printed afterwards. False on a refused setup or a failed publish."""
|
|
1743
|
+
report: List[str] = []
|
|
1744
|
+
hooks, problem = _publish_setup(args, config, repo_root, service, report)
|
|
1745
|
+
if problem:
|
|
1746
|
+
logging.getLogger("repokit").error(problem)
|
|
1747
|
+
return False
|
|
1748
|
+
ok = remote_integration.setup_remote_repository(service=service, **remote, **hooks)
|
|
1749
|
+
for line in report:
|
|
1750
|
+
print(f"GitHub: {line}")
|
|
1751
|
+
return ok
|
|
1752
|
+
|
|
1640
1753
|
def args_to_config(args: argparse.Namespace) -> Dict[str, Any]:
|
|
1641
1754
|
"""
|
|
1642
1755
|
Convert command-line arguments to configuration dictionary.
|
|
@@ -1680,8 +1793,13 @@ def args_to_config(args: argparse.Namespace) -> Dict[str, Any]:
|
|
|
1680
1793
|
if getattr(args, "github_setup", None):
|
|
1681
1794
|
from .layers import parse_languages as _split_steps
|
|
1682
1795
|
cli_config["github_setup"] = _split_steps(args.github_setup)
|
|
1796
|
+
if getattr(args, "homepage", None):
|
|
1797
|
+
cli_config["homepage"] = args.homepage
|
|
1798
|
+
if getattr(args, "no_github_setup", False):
|
|
1799
|
+
cli_config["github_setup"] = []
|
|
1683
1800
|
if getattr(args, "topics", None):
|
|
1684
|
-
|
|
1801
|
+
from .layers import parse_languages as _split_topics
|
|
1802
|
+
cli_config["topics"] = _split_topics(args.topics)
|
|
1685
1803
|
if getattr(args, "badges", None):
|
|
1686
1804
|
cli_config["badges"] = args.badges.strip()
|
|
1687
1805
|
if getattr(args, "no_extras", False):
|
|
@@ -2795,8 +2913,14 @@ def main() -> int:
|
|
|
2795
2913
|
if hasattr(args, 'token') and args.token and not token_cmd:
|
|
2796
2914
|
token_cmd = f"echo {args.token}"
|
|
2797
2915
|
|
|
2798
|
-
|
|
2799
|
-
|
|
2916
|
+
# The adopted project's own description, topics and homepage (0.10.5)
|
|
2917
|
+
meta = _project_metadata(args, dir_path)
|
|
2918
|
+
_apply_project_metadata(adopt_config, meta)
|
|
2919
|
+
if repo_manager.config is not adopt_config:
|
|
2920
|
+
_apply_project_metadata(repo_manager.config, meta)
|
|
2921
|
+
|
|
2922
|
+
publish_success = _publish_with_setup(
|
|
2923
|
+
args, adopt_config, dir_path, publish_to, remote_integration,
|
|
2800
2924
|
remote_name=getattr(args, 'remote_name', None) or adopt_config.get('remote_name', 'origin'),
|
|
2801
2925
|
private=getattr(args, 'private_repo', None) or adopt_config.get('private_repo', False),
|
|
2802
2926
|
push_branches=not getattr(args, 'no_push', False),
|
|
@@ -2865,6 +2989,13 @@ def main() -> int:
|
|
|
2865
2989
|
if problem:
|
|
2866
2990
|
logger.error(problem)
|
|
2867
2991
|
return 1
|
|
2992
|
+
# Unknown --github-setup steps, likewise
|
|
2993
|
+
from .github_setup import setup_names
|
|
2994
|
+
try:
|
|
2995
|
+
setup_names(config.get("github_setup"))
|
|
2996
|
+
except ValueError as e:
|
|
2997
|
+
logger.error(str(e))
|
|
2998
|
+
return 1
|
|
2868
2999
|
|
|
2869
3000
|
# The GitHub login, before any file is written: the files' URLs,
|
|
2870
3001
|
# CODEOWNERS and FUNDING name it (0.9.6; before, they carried the
|
|
@@ -2922,8 +3053,8 @@ def main() -> int:
|
|
|
2922
3053
|
verbose=args.verbose,
|
|
2923
3054
|
)
|
|
2924
3055
|
|
|
2925
|
-
publish_success =
|
|
2926
|
-
|
|
3056
|
+
publish_success = _publish_with_setup(
|
|
3057
|
+
args, repo_manager.config, repo_manager.repo_root, args.publish_to, remote_integration,
|
|
2927
3058
|
remote_name=args.remote_name,
|
|
2928
3059
|
private=args.private_repo,
|
|
2929
3060
|
push_branches=not args.no_push,
|
|
@@ -2962,8 +3093,12 @@ def main() -> int:
|
|
|
2962
3093
|
logger.error(f"Repository not found at {repo_path}")
|
|
2963
3094
|
return 1
|
|
2964
3095
|
|
|
2965
|
-
#
|
|
2966
|
-
|
|
3096
|
+
# What the published project says about itself (0.10.5): its own
|
|
3097
|
+
# .repokit.json, never the current directory's -- description,
|
|
3098
|
+
# name, topics, archetype; --repo-name and the flags win.
|
|
3099
|
+
meta = _project_metadata(args, repo_path)
|
|
3100
|
+
_apply_project_metadata(config, meta)
|
|
3101
|
+
repo_name = args.repo_name or meta["project_name"] or os.path.basename(repo_path)
|
|
2967
3102
|
config["name"] = repo_name
|
|
2968
3103
|
|
|
2969
3104
|
# Initialize RepoManager with the repository path
|
|
@@ -2989,8 +3124,11 @@ def main() -> int:
|
|
|
2989
3124
|
if args.token and not token_cmd:
|
|
2990
3125
|
token_cmd = f"echo {args.token}"
|
|
2991
3126
|
|
|
2992
|
-
|
|
2993
|
-
|
|
3127
|
+
# update_existing: a project already on GitHub is pushed and set
|
|
3128
|
+
# up, nothing created (publish only; adopt still creates)
|
|
3129
|
+
publish_success = _publish_with_setup(
|
|
3130
|
+
args, config, repo_path, args.publish_to, remote_integration,
|
|
3131
|
+
update_existing=True,
|
|
2994
3132
|
remote_name=args.remote_name,
|
|
2995
3133
|
private=args.private_repo,
|
|
2996
3134
|
push_branches=not args.no_push,
|
|
@@ -3004,6 +3142,14 @@ def main() -> int:
|
|
|
3004
3142
|
logger.error(f"Failed to publish repository to {args.publish_to}")
|
|
3005
3143
|
return 1
|
|
3006
3144
|
|
|
3145
|
+
# Already on GitHub: its description and homepage change only when named.
|
|
3146
|
+
if remote_integration.updated_existing_url and (getattr(args, "description", None)
|
|
3147
|
+
or getattr(args, "homepage", None)):
|
|
3148
|
+
problem = _edit_existing_repository(repo_path, config, remote_integration.updated_existing_url,
|
|
3149
|
+
(meta["description"] or None) if args.description else None,
|
|
3150
|
+
meta["homepage"] or None)
|
|
3151
|
+
print(f"GitHub: {problem}" if problem else "GitHub: description/homepage updated")
|
|
3152
|
+
|
|
3007
3153
|
logger.info(f"Successfully published repository to {args.publish_to}")
|
|
3008
3154
|
return 0
|
|
3009
3155
|
except Exception as e:
|
|
@@ -14,6 +14,29 @@ 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
|
+
# The placeholder descriptions a create writes when none was given (the
|
|
20
|
+
# config default, and an older one). Never sent to GitHub as a description.
|
|
21
|
+
DEFAULT_DESCRIPTIONS = ("A new project repository", "A new project")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def real_description(text: Optional[str]) -> str:
|
|
25
|
+
"""The description, or "" when it is empty or one of the placeholders."""
|
|
26
|
+
text = (text or "").strip()
|
|
27
|
+
return "" if text in DEFAULT_DESCRIPTIONS else text
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def read_project_record(repo_root: str) -> Dict[str, Any]:
|
|
31
|
+
"""A project's own .repokit.json, read from its root (not the current
|
|
32
|
+
directory, which is what ConfigManager reads), or {} when absent or
|
|
33
|
+
unreadable."""
|
|
34
|
+
try:
|
|
35
|
+
with open(os.path.join(repo_root, ".repokit.json"), encoding="utf-8") as f:
|
|
36
|
+
record = json.load(f)
|
|
37
|
+
except (OSError, ValueError):
|
|
38
|
+
return {}
|
|
39
|
+
return record if isinstance(record, dict) else {}
|
|
17
40
|
from .defaults import (
|
|
18
41
|
DEFAULT_PRIVATE_DIRS,
|
|
19
42
|
DEFAULT_PRIVATE_DIR_SETS,
|
|
@@ -53,7 +76,7 @@ class ConfigManager:
|
|
|
53
76
|
# Default configuration
|
|
54
77
|
self.default_config = {
|
|
55
78
|
"name": "my-project",
|
|
56
|
-
"description":
|
|
79
|
+
"description": DEFAULT_DESCRIPTIONS[0],
|
|
57
80
|
"language": "generic",
|
|
58
81
|
"default_branch": "main",
|
|
59
82
|
# Base defaults match the default strategy; apply_branch_strategy
|
|
@@ -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,33 +148,19 @@ 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}",
|
|
98
157
|
"--public" if public else "--private",
|
|
99
158
|
"--source", repo_root, "--remote", "origin"]
|
|
100
|
-
description =
|
|
159
|
+
description, homepage = github_setup.repository_about(config, name)
|
|
101
160
|
if description:
|
|
102
161
|
create += ["--description", description]
|
|
162
|
+
if homepage:
|
|
163
|
+
create += ["--homepage", homepage]
|
|
103
164
|
rc, out = _run(create, repo_root)
|
|
104
165
|
if rc != 0:
|
|
105
166
|
return f"gh repo create failed: {out}"
|
|
@@ -107,15 +168,14 @@ def create_on_github(repo_root: str, name: str, config: dict, private_branch: Op
|
|
|
107
168
|
logger.info(f"Created {owner}/{name} on GitHub ({'public' if public else 'private'})")
|
|
108
169
|
|
|
109
170
|
# 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)
|
|
171
|
+
setup = github_setup.GhSetup(gh, f"{owner}/{name}", lambda cmd: _run(cmd, repo_root),
|
|
172
|
+
ask=github_setup.ask_conflict)
|
|
111
173
|
project = config.get("name") or name
|
|
112
|
-
|
|
113
|
-
report +=
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if "pin" in steps:
|
|
118
|
-
report += setup.pin()
|
|
174
|
+
try:
|
|
175
|
+
report += github_setup.run_before_push(setup, steps, project, repo_root)
|
|
176
|
+
except github_setup.SetupAborted as stop:
|
|
177
|
+
return (f"stopped before the push: {stop}. {owner}/{name} exists on GitHub; "
|
|
178
|
+
"`repokit publish <path> --publish-to github` pushes and finishes the setup")
|
|
119
179
|
|
|
120
180
|
rc, out = _run(["git", "for-each-ref", "--format=%(refname:short)", "refs/heads"], repo_root)
|
|
121
181
|
existing = out.split()
|
|
@@ -129,14 +189,5 @@ def create_on_github(repo_root: str, name: str, config: dict, private_branch: Op
|
|
|
129
189
|
logger.info(f"Pushed: {', '.join(pushed) or 'nothing'}")
|
|
130
190
|
|
|
131
191
|
# 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 []))
|
|
192
|
+
report += github_setup.run_after_push(setup, steps, config, project)
|
|
142
193
|
return None
|