From 45ab7c1cfd7c0980991a4e372a7836d7d34c8b18 Mon Sep 17 00:00:00 2001 From: Ilia Miheev Date: Fri, 11 Jul 2025 13:28:21 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=BD=D0=B0=D0=BB=D0=B8=D1=87=D0=B8=D1=8F=20=D1=84=D0=B0?= =?UTF-8?q?=D0=B9=D0=BB=D0=B0=20setup.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uploadi/uploadi.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/uploadi/uploadi.py b/uploadi/uploadi.py index af00f77..ce4218a 100644 --- a/uploadi/uploadi.py +++ b/uploadi/uploadi.py @@ -23,15 +23,23 @@ def uploadi(): print('Надо выбрать один флаг. -t или -p') return - name_project = args.name_project + # Проверяем, есть ли setup.py + listdir = os.listdir() + if 'setup.py' not in listdir: + print('Отсутствует файл загрузки setup.py') + return + # Определяем имя проекта и комманду выгрузки + name_project = args.name_project + command = '' + if args.t: + command = 'twine upload --repository-url https://test.pypi.org/legacy/ dist/*' + else: + command = 'twine upload dist/*' # Выполняем выгрузку os.system('python setup.py sdist bdist_wheel') - if args.t: - os.system('twine upload --repository-url https://test.pypi.org/legacy/ dist/*') - else: - os.system('twine upload dist/*') + os.system(command) os.system(f'rmdir /s /q build dist {name_project}.egg-info')