1+ # project-x-py development commands
2+
3+ # Default recipe to display help
4+ default :
5+ @ just --list
6+
7+ # Sync version numbers across all files
8+ version-sync :
9+ @ echo " 🔄 Synchronizing version numbers..."
10+ python scripts/ version_sync.py
11+
12+ # Build package with version sync
13+ build : version-sync
14+ @ echo " 🔨 Building package with synchronized versions..."
15+ uv build
16+
17+ # Development build (faster, no version sync)
18+ build-dev :
19+ @ echo " 🔨 Development build..."
20+ uv build
21+
22+ # Build documentation with version sync
23+ docs : version-sync
24+ @ echo " 📚 Building documentation..."
25+ python scripts/ build-docs.py
26+
27+ # Run tests
28+ test :
29+ @ echo " 🧪 Running tests..."
30+ uv run pytest
31+
32+ # Run linters
33+ lint :
34+ @ echo " 🔍 Running linters..."
35+ uv run ruff check .
36+ uv run mypy src/
37+
38+ # Format code
39+ format :
40+ @ echo " ✨ Formatting code..."
41+ uv run ruff format .
42+
43+ # Clean build artifacts
44+ clean :
45+ @ echo " 🧹 Cleaning build artifacts..."
46+ rm -rf dist/
47+ rm -rf build/
48+ rm -rf *.egg-info/
49+ find . -type d -name " __pycache__" -delete
50+ find . -type f -name " *.pyc" -delete
51+
52+ # Bump patch version (1.0.1 -> 1.0.2)
53+ bump-patch : version-sync
54+ #!/usr/bin/env python3
55+ import re
56+ from pathlib import Path
57+
58+ init_file = Path(" src/project_x_py/__init__.py" )
59+ content = init_file.read_text()
60+ current = re.search(r' __version__ = "([^"]+)"' , content).group(1 )
61+ major, minor, patch = current.split(" ." )
62+ new_version = f" {major}.{minor}.{int(patch)+1}"
63+ new_content = re.sub(r' __version__ = "[^"]+"' , f' __version__ = "{new_version}"' , content)
64+ init_file.write_text(new_content)
65+ print(f" Version bumped: {current} → {new_version}" )
66+ just version-sync
67+
68+ # Bump minor version (1.0.1 -> 1.1.0)
69+ bump-minor : version-sync
70+ #!/usr/bin/env python3
71+ import re
72+ from pathlib import Path
73+
74+ init_file = Path(" src/project_x_py/__init__.py" )
75+ content = init_file.read_text()
76+ current = re.search(r' __version__ = "([^"]+)"' , content).group(1 )
77+ major, minor, patch = current.split(" ." )
78+ new_version = f" {major}.{int(minor)+1}.0"
79+ new_content = re.sub(r' __version__ = "[^"]+"' , f' __version__ = "{new_version}"' , content)
80+ init_file.write_text(new_content)
81+ print(f" Version bumped: {current} → {new_version}" )
82+ just version-sync
83+
84+ # Bump major version (1.0.1 -> 2.0.0)
85+ bump-major : version-sync
86+ #!/usr/bin/env python3
87+ import re
88+ from pathlib import Path
89+
90+ init_file = Path(" src/project_x_py/__init__.py" )
91+ content = init_file.read_text()
92+ current = re.search(r' __version__ = "([^"]+)"' , content).group(1 )
93+ major, minor, patch = current.split(" ." )
94+ new_version = f" {int(major)+1}.0.0"
95+ new_content = re.sub(r' __version__ = "[^"]+"' , f' __version__ = "{new_version}"' , content)
96+ init_file.write_text(new_content)
97+ print(f" Version bumped: {current} → {new_version}" )
98+ just version-sync
99+
100+ # Full release process
101+ release : clean test lint version-sync build
102+ @ echo " 🚀 Release package ready!"
103+ @ echo " Next steps:"
104+ @ echo " 1. uv publish"
105+ @ echo " 2. git tag v$(python -c 'from src.project_x_py import __version__; print(__version__)')"
106+ @ echo " 3. git push --tags"
107+
108+ # Show current version
109+ version :
110+ @ python -c " from src.project_x_py import __version__; print(f'Current version: v{__version__}')"
111+
112+ # Check if versions are synchronized
113+ check-version :
114+ @ echo " 🔍 Checking version synchronization..."
115+ python scripts/ version_sync.py
0 commit comments