### Publish Python distribution to Azure Artifacts feed Source: https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/twine-authenticate-v1 This example demonstrates installing dependencies, building a wheel, authenticating with an Azure Artifacts feed, and uploading the package using twine. ```YAML # Install python distributions like wheel, twine etc - script: |    pip install wheel    pip install twine   # Build the python distribution from source - script: |    python setup.py bdist_wheel   - task: TwineAuthenticate@1   displayName: Twine Authenticate   inputs:     artifactFeed: projectName/feedName # For project scoped feeds use: projectName/FeedName, or just feedName for organization scoped feeds   - script: |    python -m twine upload -r feedName --config-file $(PYPIRC_PATH) dist/*.whl # Use -r to pass the repository name (defined in the .pypirc file), and --config-file to point to the .pypirc path set by the TwineAuthenticate task displayName: Upload package with Twine ``` -------------------------------- ### Publish Python distribution to the official Python registry Source: https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/twine-authenticate-v1 This example shows how to authenticate using a service connection to publish a package to the official Python registry. ```YAML # Install python distributions like wheel, twine etc - script: |    pip install wheel    pip install twine   # Build the python distribution from source - script: |    python setup.py bdist_wheel   - task: TwineAuthenticate@1   displayName: Twine Authenticate   inputs:     pythonUploadServiceConnection: pypitest # Name of the Python package upload service connection   - script: |    python -m twine upload -r "pypitest" --config-file $(PYPIRC_PATH) dist/*.whl # Use -r to pass the repository name, and --config-file to point to the .pypirc path set by the TwineAuthenticate task displayName: Upload package with Twine ``` -------------------------------- ### TwineAuthenticate@1 YAML configuration with alternative feed input Source: https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/twine-authenticate-v1 YAML configuration for the TwineAuthenticate@1 task with a slightly different comment for the artifact feed input. ```yaml # Python twine upload authenticate v1 # Authenticate for uploading Python distributions using twine. Add '-r FeedName/EndpointName --config-file $(PYPIRC_PATH)' to your twine upload command. For feeds present in this organization, use the feed name as the repository (-r). Otherwise, use the endpoint name defined in the service connection. - task: TwineAuthenticate@1 inputs: # Feeds and Authentication #artifactFeed: # string. My feed (select below). #pythonUploadServiceConnection: # string. Feed from external organizations. ``` -------------------------------- ### TwineAuthenticate@1 YAML configuration with artifact feed Source: https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/twine-authenticate-v1 YAML configuration for the TwineAuthenticate@1 task focusing on artifact feed and external service connection inputs. ```yaml # Python twine upload authenticate v1 # Authenticate for uploading Python distributions using twine. Add '-r FeedName/EndpointName --config-file $(PYPIRC_PATH)' to your twine upload command. For feeds present in this organization, use the feed name as the repository (-r). Otherwise, use the endpoint name defined in the service connection. - task: TwineAuthenticate@1 inputs: # Feeds and Authentication #artifactFeed: # string. My feed name (select below). #pythonUploadServiceConnection: # string. Feed from external organizations. ``` -------------------------------- ### TwineAuthenticate@1 YAML configuration with Azure DevOps Service Connection Source: https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/twine-authenticate-v1 Basic YAML configuration for the TwineAuthenticate@1 task including the Azure DevOps service connection input. ```yaml # Python twine upload authenticate v1 # Authenticate for uploading Python distributions using twine. Add '-r FeedName/EndpointName --config-file $(PYPIRC_PATH)' to your twine upload command. For feeds present in this organization, use the feed name as the repository (-r). Otherwise, use the endpoint name defined in the service connection. - task: TwineAuthenticate@1 inputs: # Feeds and Authentication #azureDevOpsServiceConnection: # string. Alias: workloadIdentityServiceConnection. 'Azure DevOps' Service Connection. #feedUrl: # string. Azure Artifacts Feed url. #artifactFeed: # string. My feed name (select below). #pythonUploadServiceConnection: # string. Feed from external organizations. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.