elytra_client/UPDATE_VERSION.md

2.8 KiB

Version Update Scripts

This directory contains scripts to update the version across the Elytra PIM Client project before building a wheel distribution.

Quick Start

Update version and build:

# Python (cross-platform)
python update_version.py 1.0.0
python build_wheel.py

# PowerShell (Windows)
.\update_version.ps1 1.0.0
.\build_wheel.ps1

# Bash (Linux/macOS)
./update_version.sh 1.0.0
./build_wheel.sh

Files Updated

The version update scripts modify the following files:

  • pyproject.toml - Project configuration (line 7)
  • elytra_client/__init__.py - Package version (line 3)

Available Scripts

Python Version

python update_version.py 0.2.0

Usage:

python update_version.py <version>

Example:

python update_version.py 1.0.0

PowerShell Version

.\update_version.ps1 -Version 0.2.0

Usage:

.\update_version.ps1 -Version <version>
# or
.\update_version.ps1 <version>

Examples:

.\update_version.ps1 0.2.0
.\update_version.ps1 -Version 1.0.0

Bash Version

./update_version.sh 0.2.0

Usage:

./update_version.sh <version>

Example:

./update_version.sh 1.0.0

Version Format

The version must follow semantic versioning format: major.minor.patch

Valid examples:

  • 0.1.0
  • 1.0.0
  • 0.2.1
  • 1.0.0-beta (with pre-release identifier)

Invalid examples:

  • 1.0 (missing patch version)
  • v1.0.0 (invalid prefix)

Workflow

Before Building a Wheel

  1. Update the version:

    # On Windows
    .\update_version.ps1 0.2.0
    
    # On Linux/macOS
    ./update_version.sh 0.2.0
    
  2. Build the wheel:

    # Using Python
    python build_wheel.py
    
    # Or PowerShell
    .\build_wheel.ps1
    
    # Or Bash
    ./build_wheel.sh
    
  3. Upload (optional):

    .\upload_wheel_to_forgejo_pypi.ps1
    

Verification

After running the update script, verify the changes:

Check pyproject.toml:

grep "version = " pyproject.toml

Check init.py:

grep "__version__ = " elytra_client/__init__.py

Error Messages

Invalid Version Format

✗ Invalid version format: 1.0
Version must follow semantic versioning (major.minor.patch)
Examples: 1.0.0, 0.2.0, 1.0.0-beta

Solution: Use the format major.minor.patch (e.g., 1.0.0)

File Not Found

✗ /path/to/file not found

Solution: Ensure you're running the script from the project root directory

Return Codes

  • 0 - Success (version updated)
  • 1 - Error (see error message)

Notes

  • Run from the project root directory
  • The scripts will show which files were updated
  • All scripts support semantic versioning with optional pre-release identifiers
  • Use consistent versions across all files to avoid build issues