-
Notifications
You must be signed in to change notification settings - Fork 1
Allow custom release locations in run.py #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for custom release locations by allowing users to specify custom PyPI repository URLs and custom GitHub API URLs in the run.py script. This enables publishing to private/custom PyPI repositories and creating releases in GitHub Enterprise instances.
- Added
--repo-url
parameter to the publish command for custom PyPI repositories - Added
--github-api-url
parameter to the release command for custom GitHub instances - Updated command-line interface documentation to reflect the new parameters
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
run.py
Outdated
if repo_url: | ||
repo_url_arg = f'--repository-url {repo_url}' | ||
twine_args = f'--verbose {repo_url_arg}' | ||
else: | ||
twine_args = '--repository testpypi --verbose' if testpypi else '--verbose' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repo_url parameter is directly interpolated into a command string without validation. This could allow command injection if the URL contains shell metacharacters. Consider validating the URL format or using proper argument passing instead of string concatenation.
Copilot uses AI. Check for mistakes.
run.py lint [-s | --skip-build] | ||
run.py publish [-s | --skip-build] [--testpypi] | ||
run.py release | ||
run.py publish [-s | --skip-build] [(--testpypi | --repo-url=<url>)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring syntax suggests --testpypi and --repo-url are mutually exclusive with the parentheses and pipe operator, but the code logic doesn't enforce this. If they are mutually exclusive, add validation to prevent both flags from being used simultaneously.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
This PR allows for publishing to custom pypi repositories and creating releases in custom GitHub instances.
Fixes # N/A
Type of change
Please delete options that are not relevant.
Checklist
Please delete options that are not relevant.
Testing
N/A.
Additional Notes
Add any other context about the pull request here.