Skip to content

Instantly share code, notes, and snippets.

@CopperyMarrow15
Last active June 18, 2021 23:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CopperyMarrow15/ae01421f8344ff0921603fe3ac24bfa7 to your computer and use it in GitHub Desktop.
Save CopperyMarrow15/ae01421f8344ff0921603fe3ac24bfa7 to your computer and use it in GitHub Desktop.
an easy way to upload Python packages to PyPI
@echo off
set ORIGINAL_DIR=%CD%
:pypath
set /p PY_INSTALLATION=Enter Python 3 installation path. (ex: C:\Python38):
cd %PY_INSTALLATION%
if exist python.exe (if exist Scripts\pip.exe (python -m pip install --user --upgrade setuptools wheel twine)) else (goto pypath) else (goto pypath)
set /p PACKAGE_DIR=Enter package directory path. (ex: C:\Python38\Lib\package):
cd %PACKAGE_DIR%
%PY_INSTALLATION%\python setup.py sdist bdist_wheel
:upload
set /p UPLOAD?=Your package is ready to upload. Would you like to upload it? (Y/N)
if %UPLOAD?%==y (%PY_INSTALLATION%\python -m twine upload dist\*) else (goto upload)
if %UPLOAD?%==Y (%PY_INSTALLATION%\python -m twine upload dist\*) else (goto upload)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment