feat: package as gh2gl on PyPI with gh2gl init workflow#2
Open
paladini wants to merge 2 commits into
Open
Conversation
- Add pyproject.toml (hatchling build, gh2gl entry point) - Move src/ → src/gh2gl/ as a proper importable package - Add cli.py with backup (default) and init subcommands - gh2gl init creates github-backup/ workspace folder with config.yaml and .env templates ready to edit - Update README with pip install / init / run flow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Prevents the workspace folder created by 'gh2gl init' from being accidentally staged when running inside the repo during development. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pyproject.toml(hatchling build backend) replacingrequirements.txtsrc/→src/gh2gl/as a proper installable Python package namedgh2glsrc/gh2gl/cli.pywithbackup(default) andinitsubcommandsgh2gl initcreates agithub-backup/workspace folder in the current directory withconfig.yamland.envready to editbackup.pyto a thin dev shim (python backup.pystill works for development)README.mdwith pip install / init / run flowgithub-backup/to.gitignoreNew user flow
Backwards compatibility
All existing CLI flags work without a subcommand (
gh2gl --dry-run,gh2gl --filter "...", etc.). Running from a directory withconfig.yamland.envin place works the same as before.Tested
pip install -e .installs thegh2glentry pointgh2gl initcreatesgithub-backup/config.yamlandgithub-backup/.envgh2gl --dry-runfrom inside the workspace listed 189 repos with correct visibility — exit code 0Test plan
pip install gh2gl(once published to PyPI) installs thegh2glcommandpip install -e .works from the repo root (editable install)gh2gl --helpshows backup args and{backup,init}subcommandsgh2gl initcreatesgithub-backup/config.yamlandgithub-backup/.envgh2gl initagain says folder already exists (no overwrite)gh2gl --dry-runfrom insidegithub-backup/reads the localconfig.yamlpython backup.py --dry-runstill works (dev shim)🤖 Generated with Claude Code