-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# Check if we're in nix-shell/nix develop | ||
if [[ -z "${IN_NIX_SHELL}" ]]; then | ||
echo "Error: This script must be run from within nix develop" | ||
echo "Please run 'nix develop' first, then try again" | ||
exit 1 | ||
fi | ||
|
||
echo "Building and publishing torch2jax to PyPI" | ||
echo | ||
echo "First, get a PyPI token from:" | ||
echo "https://pypi.org/manage/project/torch2jax/settings/" | ||
echo | ||
read -sp "Enter your PyPI token: " TOKEN | ||
echo | ||
|
||
# Build the package | ||
echo -e "\nBuilding package..." | ||
python3 -m build | ||
|
||
# Upload to PyPI using environment variable | ||
echo -e "\nUploading to PyPI..." | ||
TWINE_USERNAME="__token__" TWINE_PASSWORD="$TOKEN" python3 -m twine upload dist/* | ||
|
||
echo -e "\nPackage successfully published to PyPI!" | ||
echo | ||
echo "SECURITY REMINDER: Please delete the token you just used from PyPI:" | ||
echo "https://pypi.org/manage/project/torch2jax/settings/" | ||
echo | ||
read -p "Press Enter once you've deleted the token..." | ||
echo "Done!" |