-
Notifications
You must be signed in to change notification settings - Fork 7k
[release auto] use env var for twine password #59068
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||
| import os | ||||||
| import subprocess | ||||||
| import sys | ||||||
| from typing import List | ||||||
| from typing import Dict, List | ||||||
|
|
||||||
| from ray_release.aws import get_secret_token | ||||||
|
|
||||||
|
|
@@ -32,8 +32,10 @@ def _get_pypi_token(pypi_env: str) -> str: | |||||
| return get_secret_token(AWS_SECRET_PYPI) | ||||||
|
|
||||||
|
|
||||||
| def _call_subprocess(command: List[str]): | ||||||
| subprocess.run(command, check=True) | ||||||
| def _call_subprocess(command: List[str], add_env: Dict[str, str]): | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The signature of
Suggested change
|
||||||
| env = os.environ.copy() | ||||||
| env.update(add_env) | ||||||
| subprocess.run(command, env=env, check=True) | ||||||
|
|
||||||
|
|
||||||
| def upload_wheels_to_pypi(pypi_env: str, directory_path: str) -> None: | ||||||
|
|
@@ -52,8 +54,6 @@ def upload_wheels_to_pypi(pypi_env: str, directory_path: str) -> None: | |||||
| pypi_url, | ||||||
| "--username", | ||||||
| "__token__", | ||||||
| "--password", | ||||||
| pypi_token, | ||||||
| wheel_path, | ||||||
| ] | ||||||
| _call_subprocess(cmd) | ||||||
| _call_subprocess(cmd, add_env={"TWINE_PASSWORD": pypi_token}) | ||||||
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.
To support making
add_envan optional argument in_call_subprocessas suggested in another comment,Optionalshould be imported fromtyping.