elytra_client/UPDATE_VERSION.md

164 lines
2.8 KiB
Markdown

# 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:
```bash
# 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
```bash
python update_version.py 0.2.0
```
**Usage:**
```bash
python update_version.py <version>
```
**Example:**
```bash
python update_version.py 1.0.0
```
### PowerShell Version
```powershell
.\update_version.ps1 -Version 0.2.0
```
**Usage:**
```powershell
.\update_version.ps1 -Version <version>
# or
.\update_version.ps1 <version>
```
**Examples:**
```powershell
.\update_version.ps1 0.2.0
.\update_version.ps1 -Version 1.0.0
```
### Bash Version
```bash
./update_version.sh 0.2.0
```
**Usage:**
```bash
./update_version.sh <version>
```
**Example:**
```bash
./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:**
```bash
# On Windows
.\update_version.ps1 0.2.0
# On Linux/macOS
./update_version.sh 0.2.0
```
2. **Build the wheel:**
```bash
# Using Python
python build_wheel.py
# Or PowerShell
.\build_wheel.ps1
# Or Bash
./build_wheel.sh
```
3. **Upload (optional):**
```bash
.\upload_wheel_to_forgejo_pypi.ps1
```
### Verification
After running the update script, verify the changes:
**Check pyproject.toml:**
```bash
grep "version = " pyproject.toml
```
**Check __init__.py:**
```bash
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