Skip to content
Snippets Groups Projects
Commit 66f53ee2 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[scripts][ci] Fix PyPI upload

parent a288a201
No related branches found
No related tags found
No related merge requests found
Pipeline #26234 passed
...@@ -192,7 +192,7 @@ Examples: ...@@ -192,7 +192,7 @@ Examples:
'printing to help you understand what will be done') 'printing to help you understand what will be done')
@verbosity_option() @verbosity_option()
@bdt.raise_on_error @bdt.raise_on_error
def pypi(dry_run): def pypi(package, dry_run):
"""Deploys build artifacts (python packages to PyPI) """Deploys build artifacts (python packages to PyPI)
Deployment is only allowed for packages in which the visibility is Deployment is only allowed for packages in which the visibility is
...@@ -204,8 +204,6 @@ def pypi(dry_run): ...@@ -204,8 +204,6 @@ def pypi(dry_run):
logger.warn('!!!! DRY RUN MODE !!!!') logger.warn('!!!! DRY RUN MODE !!!!')
logger.warn('Nothing is being deployed to server') logger.warn('Nothing is being deployed to server')
package = os.environ['CI_PROJECT_PATH']
# determine project visibility # determine project visibility
visible = (os.environ['CI_PROJECT_VISIBILITY'] == 'public') visible = (os.environ['CI_PROJECT_VISIBILITY'] == 'public')
...@@ -213,7 +211,8 @@ def pypi(dry_run): ...@@ -213,7 +211,8 @@ def pypi(dry_run):
raise RuntimeError('The repository %s is not public - a package ' \ raise RuntimeError('The repository %s is not public - a package ' \
'deriving from it therefore, CANNOT be published to PyPI. ' \ 'deriving from it therefore, CANNOT be published to PyPI. ' \
'You must follow the relevant software disclosure procedures ' \ 'You must follow the relevant software disclosure procedures ' \
'and set this repository to "public" before trying again.' % package) 'and set this repository to "public" before trying again.' % \
os.environ['CI_PROJECT_PATH'])
from ..constants import CACERT from ..constants import CACERT
from twine.settings import Settings from twine.settings import Settings
...@@ -228,7 +227,7 @@ def pypi(dry_run): ...@@ -228,7 +227,7 @@ def pypi(dry_run):
if not dry_run: if not dry_run:
from twine.commands.upload import upload from twine.commands.upload import upload
for k in packages: for k in package:
logger.info('Deploying python package %s to PyPI', k) logger.info('Deploying python package %s to PyPI', k)
upload(settings, [k]) upload(settings, [k])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment