0Pricing
Python Academy · Lesson

Versioning and Metadata

Manage package metadata.

Why Metadata Matters

Metadata is everything about your package except the code: its version, description, license, author, and links. PyPI uses it to display your project, and pip uses it to resolve dependencies.

Good metadata makes your package trustworthy and installable.

Semantic Versioning

The convention is MAJOR.MINOR.PATCH:

  • MAJOR breaking changes
  • MINOR new, backward-compatible features
  • PATCH backward-compatible bug fixes

Users rely on this to know whether an upgrade is safe.

version = '2.4.1'
major, minor, patch = version.split('.')
print('Major', major, 'Minor', minor, 'Patch', patch)
print('Bug fix -> bump patch to', major + '.' + minor + '.' + str(int(patch) + 1))

All lessons in this course

  1. Project Structure and pyproject.toml
  2. Building with build
  3. Versioning and Metadata
  4. Publishing with twine
← Back to Python Academy