Skip to content

Conversation

@mgcooper
Copy link

This PR adds support for installing and running gpt-repository-loader via pipx, enabling:

pipx install git+https://github.com/mpoon/gpt-repository-loader.git
gpt-repository-loader /path/to/repo

🔧 Summary of Changes

  • ✅ Moved gpt_repository_loader.py into a new gpt_repository_loader/ package directory (required for pipx to correctly install)
  • ✅ Moved the scripting inside the if name == main guard into a main() function and moved the guard to the end of gpt_repository_loader.py (this enables the gpt-repository-loader CLI script)
  • ✅ Added a pyproject.toml with [project.scripts] entry for gpt-repository-loader = "gpt_repository_loader.gpt_repository_loader:main"
  • ✅ Added [tool.setuptools] to restrict packaging to gpt_repository_loader, otherwise pipx interprets the test_data folder as a package
  • ✅ Updated the import statement in the test script to reflect the new package layout (i.e., import from gpt_repository_loader.gpt_repository_loader instead of just gpt_repository_loader)

🧪 Test Instructions

From the root of the project, you can now run:

pipx install --force --editable .
gpt-repository-loader /path/to/any/git/repo

To test directly from GitHub:

pipx install git+https://github.com/mgcooper/gpt-repository-loader.git@feat/pyproject.toml

If this PR is accepted, you can then install and access the cli tool:

pipx install git+https://github.com/mpoon/gpt-repository-loader.git

Several other PRs currently address the lack of a setup.py or pyproject.toml file. To my knowledge this is the most minimal refactor possible to address this, and enable pipx install, which many users will prefer.

Closes #63

- Add pyproject.toml with CLI entry point for gpt-repository-loader
- Move script to gpt_repository_loader/ package directory
- Restrict setuptools to package only gpt_repository_loader
- Add __init__.py for extensibility
- Update tests to reflect new module path
@mgcooper mgcooper requested a review from mpoon as a code owner April 30, 2025 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add pyproject.toml

1 participant