Skip to content

Commit ca55415

Browse files
committed
chore: bump version to v0.1.7
1 parent f539918 commit ca55415

10 files changed

Lines changed: 842 additions & 4 deletions

Makefile

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,86 @@ publish-test: build ## Publish to TestPyPI
125125
publish: build ## Publish to PyPI (use with caution!)
126126
uv run scripts/publish.py
127127

128+
# ===================================================================
129+
# RELEASE MANAGEMENT
130+
# ===================================================================
131+
132+
verify-packages: ## Verify all packages are properly configured
133+
@echo "🔍 Verifying package configuration..."
134+
@python3 scripts/verify_packages.py
135+
136+
# Version management with optional VERSION parameter
137+
version: ## Update version in all packages (usage: make version VERSION=0.2.0)
138+
ifdef VERSION
139+
@python3 scripts/version.py $(VERSION)
140+
else
141+
@read -p "Enter new version: " VERSION && \
142+
python3 scripts/version.py $$VERSION
143+
endif
144+
145+
# Commit with optional [no-ci] flag
146+
commit: ## Commit changes (usage: make commit or make commit NOCI=1)
147+
ifdef NOCI
148+
@echo "💾 Committing with [no-ci]..."
149+
@git add -A && \
150+
git commit -m "chore: bump version to v$$(python3 -c "import re; content=open('pyproject.toml').read(); print(re.search(r'version = \"(.+?)\"', content).group(1))") [no-ci]"
151+
else
152+
@echo "💾 Committing..."
153+
@git add -A && \
154+
git commit -m "chore: bump version to v$$(python3 -c "import re; content=open('pyproject.toml').read(); print(re.search(r'version = \"(.+?)\"', content).group(1))")"
155+
endif
156+
157+
tag: ## Create git tag for current version
158+
@python3 scripts/tag.py
159+
160+
# Modular release steps that use the base targets
161+
release-step-1: ## Step 1: Update versions (usage: make release-step-1 VERSION=0.2.0)
162+
@echo "📝 Step 1: Updating versions..."
163+
@$(MAKE) version VERSION=$(VERSION)
164+
@echo "✅ Step 1 complete: Versions updated to $(VERSION)"
165+
166+
release-step-2: ## Step 2: Commit changes (usage: make release-step-2 NOCI=1)
167+
@echo "💾 Step 2: Committing changes..."
168+
@$(MAKE) commit NOCI=$(NOCI)
169+
@echo "✅ Step 2 complete: Changes committed"
170+
171+
release-step-3: ## Step 3: Build packages
172+
@echo "🔨 Step 3: Building packages..."
173+
@$(MAKE) build
174+
@echo "✅ Step 3 complete: Packages built"
175+
176+
release-step-4: ## Step 4: Verify configuration
177+
@echo "🔍 Step 4: Verifying configuration..."
178+
@$(MAKE) verify-packages
179+
@echo "✅ Step 4 complete: Configuration verified"
180+
181+
release-step-5: ## Step 5: Create tag
182+
@echo "🏷️ Step 5: Creating tag..."
183+
@$(MAKE) tag
184+
@echo "✅ Step 5 complete: Tag created"
185+
186+
# Full automated release (with [no-ci])
187+
release: ## Run complete release process (version -> commit -> build -> verify -> tag)
188+
@echo "🚀 Starting automated release process..."
189+
@read -p "Enter version (e.g., 0.2.0): " VERSION && \
190+
$(MAKE) release-step-1 VERSION=$$VERSION && \
191+
$(MAKE) release-step-2 NOCI=1 && \
192+
$(MAKE) release-step-3 && \
193+
$(MAKE) release-step-4 && \
194+
$(MAKE) release-step-5 && \
195+
echo "✅ Release complete! Now run: git push origin main --tags"
196+
197+
# Manual release process (without [no-ci])
198+
release-manual: ## Run release process with manual commit (no [no-ci])
199+
@echo "🚀 Starting manual release process..."
200+
@read -p "Enter version (e.g., 0.2.0): " VERSION && \
201+
$(MAKE) release-step-1 VERSION=$$VERSION && \
202+
$(MAKE) release-step-2 && \
203+
$(MAKE) release-step-3 && \
204+
$(MAKE) release-step-4 && \
205+
$(MAKE) release-step-5 && \
206+
echo "✅ Release complete! Now run: git push origin main --tags"
207+
128208
# ===================================================================
129209
# RUNNING THE CLI
130210
# ===================================================================
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Build Error Fix - Missing Update Package
2+
3+
## Issue Description
4+
5+
The deepctl installation was failing with the error:
6+
7+
```
8+
ERROR: Could not find a version that satisfies the requirement deepctl-cmd-update>=0.1.5 (from deepctl)
9+
ERROR: No matching distribution found for deepctl-cmd-update>=0.1.5
10+
```
11+
12+
## Root Cause
13+
14+
The `deepctl-cmd-update` package was listed as a dependency in the main `pyproject.toml` but was not being built during the build process.
15+
16+
## Problems Identified
17+
18+
1. **Missing from build script**: The package wasn't included in `PACKAGES_TO_BUILD` in `scripts/build.py`
19+
2. **Missing from version script**: The package wasn't included in `SYNCHRONIZED_PACKAGES` in `scripts/version.py`
20+
3. **Version mismatch**: The package had version `0.1.5` while all other packages were at `0.1.7`
21+
4. **Inconsistent dependency version**: Main package required `>=0.1.5` while others used `>=0.1.7`
22+
23+
## Solution Applied
24+
25+
### 1. Updated `scripts/build.py`
26+
27+
Added `"packages/deepctl-cmd-update"` to the `PACKAGES_TO_BUILD` list.
28+
29+
### 2. Updated `scripts/version.py`
30+
31+
- Added `"packages/deepctl-cmd-update"` to the `SYNCHRONIZED_PACKAGES` list
32+
- Added `"deepctl-cmd-update"` to the package list in the `update_version` function
33+
34+
### 3. Updated `pyproject.toml`
35+
36+
Changed the dependency version from `deepctl-cmd-update>=0.1.5` to `deepctl-cmd-update>=0.1.7` to match other packages.
37+
38+
### 4. Synchronized All Versions
39+
40+
Ran `python3 scripts/version.py 0.1.7` to ensure all packages had consistent versions.
41+
42+
### 5. Rebuilt All Packages
43+
44+
Ran `python3 scripts/build.py` to build all packages including the now-included update command.
45+
46+
## Verification
47+
48+
After applying the fixes, the installation was tested successfully:
49+
50+
```bash
51+
python3 -m venv test-env
52+
source test-env/bin/activate
53+
pip install --find-links dist/ dist/deepctl-0.1.7-py3-none-any.whl
54+
# Installation completed successfully
55+
```
56+
57+
## Prevention
58+
59+
To prevent similar issues in the future:
60+
61+
1. When adding new command packages, ensure they are added to both `build.py` and `version.py`
62+
2. Keep all package versions synchronized
63+
3. Test the full installation process after adding new packages
64+
4. Consider adding a CI check that verifies all packages listed in dependencies are actually built
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# Release Safety and Pre-Tag Verification
2+
3+
While Git doesn't have a native "pre-tag" hook, there are several effective approaches to prevent invalid releases from being tagged.
4+
5+
## Approach 1: Makefile Commands (Recommended) ✅
6+
7+
We have a complete release process in the Makefile:
8+
9+
```bash
10+
# All-in-one safe release
11+
make release
12+
# Enter version when prompted (e.g., 0.2.0)
13+
```
14+
15+
This command:
16+
17+
1. Updates all package versions
18+
2. Commits with `[no-ci]` to avoid duplicate CI
19+
3. Builds all packages
20+
4. **Runs package verification**
21+
5. Creates the tag
22+
6. Ready to push!
23+
24+
If any step fails, it stops immediately.
25+
26+
## Approach 2: Granular Control
27+
28+
Run each step individually:
29+
30+
```bash
31+
make version # Update versions
32+
make build # Build packages
33+
make verify-packages # Verify configuration
34+
make tag # Create tag
35+
```
36+
37+
## Approach 3: Git Alias
38+
39+
Add this to your `~/.gitconfig`:
40+
41+
```ini
42+
[alias]
43+
safe-tag = "!f() { \
44+
if ! python3 scripts/verify_packages.py; then \
45+
echo 'Package verification failed!'; \
46+
exit 1; \
47+
fi; \
48+
git tag -a \"$1\" -m \"$2\"; \
49+
}; f"
50+
```
51+
52+
Then use:
53+
54+
```bash
55+
git safe-tag v0.2.0 "Release version 0.2.0"
56+
```
57+
58+
## Approach 4: Pre-Push Hook
59+
60+
Create `.git/hooks/pre-push`:
61+
62+
```bash
63+
#!/bin/bash
64+
# Check if we're pushing tags
65+
while read local_ref local_sha remote_ref remote_sha
66+
do
67+
if [[ "$local_ref" =~ ^refs/tags/ ]]; then
68+
echo "Detected tag push, running verification..."
69+
if ! python3 scripts/verify_packages.py; then
70+
echo "❌ Package verification failed!"
71+
echo "Fix the issues before pushing tags."
72+
exit 1
73+
fi
74+
fi
75+
done
76+
exit 0
77+
```
78+
79+
Make it executable:
80+
81+
```bash
82+
chmod +x .git/hooks/pre-push
83+
```
84+
85+
## Approach 5: CI/CD Protection
86+
87+
Your GitHub Actions workflow can also prevent bad releases:
88+
89+
```yaml
90+
# In .github/workflows/release.yml
91+
jobs:
92+
verify:
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@v4
96+
- name: Verify packages
97+
run: python scripts/verify_packages.py
98+
99+
build:
100+
needs: verify # Only build if verification passes
101+
# ... rest of build job
102+
```
103+
104+
## Best Practices
105+
106+
1. **Always use make release** for standard releases:
107+
108+
```bash
109+
make release
110+
```
111+
112+
2. **Verify before manual releases**:
113+
114+
```bash
115+
make verify-packages
116+
```
117+
118+
3. **Add verification to CI** as a safety net
119+
120+
4. **Regular verification** during development:
121+
```bash
122+
python3 scripts/verify_packages.py
123+
```
124+
125+
## What Gets Verified?
126+
127+
The package verification script checks:
128+
129+
- ✅ All packages are in build scripts
130+
- ✅ All packages are in version scripts
131+
- ✅ All non-plugin packages are dependencies
132+
- ✅ Plugin packages are NOT dependencies
133+
- ✅ Version consistency across packages
134+
- ✅ Packages have been built
135+
136+
## Quick Commands
137+
138+
```bash
139+
# Verify packages are configured correctly
140+
make verify-packages
141+
142+
# Create a safe release
143+
make release
144+
145+
# Just update versions (no tag)
146+
make version
147+
148+
# Build without tagging
149+
make build
150+
```
151+
152+
## Additional Safety Checks
153+
154+
For extra safety, you can manually check:
155+
156+
```bash
157+
# Ensure you're on main branch
158+
git branch --show-current
159+
160+
# Check for uncommitted changes
161+
git status
162+
163+
# Pull latest changes
164+
git pull origin main
165+
```
166+
167+
## Rollback
168+
169+
If something goes wrong after tagging locally (but before pushing):
170+
171+
```bash
172+
# Delete local tag
173+
git tag -d v0.2.0
174+
175+
# Reset version changes
176+
git reset --hard HEAD~1
177+
178+
# Or just reset version files
179+
git checkout -- '**/pyproject.toml' 'src/deepctl/__init__.py'
180+
```

0 commit comments

Comments
 (0)