Allow custom release locations in run.py#19
Conversation
There was a problem hiding this comment.
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-urlparameter to the publish command for custom PyPI repositories - Added
--github-api-urlparameter 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.
| 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.
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.
| 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.
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.
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.