Last active
June 18, 2021 23:28
-
-
Save CopperyMarrow15/ae01421f8344ff0921603fe3ac24bfa7 to your computer and use it in GitHub Desktop.
an easy way to upload Python packages to PyPI
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
@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