Get started with Python packages in Azure Artifacts

This quickstart guides you through using Azure Artifacts to consume and publish Python packages in Azure DevOps Services. It covers license assigning and setup.

Create a feed

On your first visit to Azure Artifacts, you're welcomed with an image that prompts you to create a new feed. Select the + New feed button.

In the dialog box:

  • Name: Give the feed a name. "PyPI" is the default repository name for twine, which is a tool for publishing Python packages. We recommend that you don't name your feed "PyPI," because you might accidentally push to the wrong repository if you don't provide a repository name with -r.
  • Visibility: Choose who can read and contribute (or update) packages in your feed. An organization-visible feed is created with permissions that allow all users in the organization to see and use your feed (recommended). A private feed is created with permissions such that only you have access.
  • Packages from public sources: Selecting Use packages from public sources through this feed will add the public npm, NuGet, and PyPI registries as upstreams to your feed. When upstreams are enabled, your client will be able to fetch packages from the public registry through your private feed, and your private feed will cache those packages for you. If you select Use packages published to this feed, your feed will be created without connectivity to public registries. You can connect them later if you want.
  • When you're done, select Create.

New feed dialog box

You can change these settings later by editing the feed.

Connect to your feed

  1. From your feed in Azure Artifacts, select Connect to feed.

    Connect to feed button on the upper right of the page

  2. When the Connect to feed dialog box opens, choose Python from the left menu.

This will bring up instructions on how to publish a package to your feed by using Python’s twine command, and how to consume and download packages by using pip.

Next steps

Publish Python packages from your builds

If you want to consume or publish Python packages as part of your continuous integration/continuous delivery (CI/CD) pipeline, check out the Publish Python packages from Azure Pipelines guide.

Build Python apps with Azure Pipelines

To learn more about how to create, configure, and use Python packages as part of your project or pipeline, check out the Build Python apps with Azure Pipelines guide.

Resources

If you’d like to learn more about how Python packages work, there’s a great write-up in the Architecture of Open Source Applications book. Here's an excerpt: