pyASDReader 1.2.2__tar.gz → 1.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/CHANGELOG.md +36 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/PKG-INFO +9 -2
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/README.md +8 -1
- pyasdreader-1.2.3/VERSION_MANAGEMENT.md +539 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/pyproject.toml +1 -1
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/src/_version.py +1 -1
- pyasdreader-1.2.2/VERSION_MANAGEMENT.md +0 -303
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/.codecov.yml +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/.pre-commit-config.yaml +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/LICENSE +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/MANIFEST.in +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/coverage.json +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/examples/README.md +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/examples/basic_usage.py +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/pyASDReader.egg-info/SOURCES.txt +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/scripts/publish.sh +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/setup.cfg +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/src/__init__.py +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/src/asd_file_reader.py +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/src/constant.py +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/src/file_attributes.py +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/src/logger_setup.py +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/__init__.py +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/sample_data/v6sample/v6sample00000.asd +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/sample_data/v6sample/v6sample00001.asd +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/sample_data/v6sample/v6sample00002.asd +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/sample_data/v7sample/v7sample00000.asd +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/sample_data/v7sample/v7sample00001.asd +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/sample_data/v7sample/v7sample00002.asd +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/sample_data/v7sample/v7sample00003.asd +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/sample_data/v7sample/v7sample00004.asd +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/sample_data/v7sample/v7sample00005.asd +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/sample_data/v7sample_field_spectroscopy/44231B009-1-FW300000.asd +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/sample_data/v7sample_field_spectroscopy/44231B009-1-FW3R00000.asd +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/sample_data/v7sample_field_spectroscopy/44231B174-1-FF300000.asd +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/sample_data/v8sample/v8sample00001.asd +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/sample_data/v8sample/v8sample00002.asd +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/test_asd_file_reader.py +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/test_data.py +0 -0
- {pyasdreader-1.2.2 → pyasdreader-1.2.3}/tests/test_file_attributes.py +0 -0
|
@@ -13,6 +13,42 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
13
13
|
|
|
14
14
|
## [Unreleased]
|
|
15
15
|
|
|
16
|
+
## [1.2.3] - 2025-10-07
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
- 📚 **Documentation Section** - Added comprehensive documentation links in README.md
|
|
20
|
+
- Link to CHANGELOG.md for version history and feature updates
|
|
21
|
+
- Link to VERSION_MANAGEMENT.md for release workflow and branch strategy
|
|
22
|
+
- Links to GitHub Issues and Discussions for community engagement
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- 🏗️ **Branch Strategy Documentation** - Major update to VERSION_MANAGEMENT.md
|
|
26
|
+
- Added detailed branch strategy section explaining dev/main workflow
|
|
27
|
+
- Updated release workflow with 4-step process including branch merge requirement
|
|
28
|
+
- Enhanced publishing scenarios (normal release, hotfix, quick release)
|
|
29
|
+
- Expanded best practices from 8 to 10 comprehensive guidelines
|
|
30
|
+
- Updated quick reference with branch-specific commands
|
|
31
|
+
|
|
32
|
+
- 🔄 **Enhanced CI/CD Workflows** - Intelligent optimization for GitHub Actions
|
|
33
|
+
- Added TestPyPI test reuse mechanism in PyPI workflow (saves approximately 45 minutes per release)
|
|
34
|
+
- Implemented 7-day test validity window for TestPyPI results
|
|
35
|
+
- Added verification summary job with detailed test status reporting
|
|
36
|
+
- Optimized GitHub Actions minutes usage (approximately 40% savings)
|
|
37
|
+
- Enhanced workflow comments and documentation
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
- 🐛 **Python 3.8 Compatibility** - Resolved f-string syntax issues in CI workflows
|
|
41
|
+
- Fixed package metadata verification step in publish-to-pypi.yml
|
|
42
|
+
- Fixed package metadata verification step in publish-to-testpypi.yml
|
|
43
|
+
- Resolved f-string backslash syntax error (not supported in Python 3.8)
|
|
44
|
+
- Ensured compatibility across all supported Python versions (3.8-3.12)
|
|
45
|
+
|
|
46
|
+
### Technical Improvements
|
|
47
|
+
- Better CI/CD resource optimization with intelligent test reuse
|
|
48
|
+
- Clearer release workflow documentation for contributors
|
|
49
|
+
- Improved branch management guidelines
|
|
50
|
+
- Enhanced Python version compatibility in automated workflows
|
|
51
|
+
|
|
16
52
|
## [1.2.2] - 2025-10-05
|
|
17
53
|
|
|
18
54
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyASDReader
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.3
|
|
4
4
|
Summary: A Python library for reading and parsing all versions of ASD binary spectral files
|
|
5
5
|
Author-email: Kai Cao <caokai_cgs@163.com>
|
|
6
6
|
Maintainer-email: Kai Cao <caokai_cgs@163.com>
|
|
@@ -142,6 +142,13 @@ pip install -e ".[dev]"
|
|
|
142
142
|
pip install -e ".[all]"
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
+
## Documentation
|
|
146
|
+
|
|
147
|
+
- **[CHANGELOG](CHANGELOG.md)** - Version history, feature updates, and bug fixes
|
|
148
|
+
- **[Version Management Guide](VERSION_MANAGEMENT.md)** - Release workflow, branch strategy, and CI/CD automation
|
|
149
|
+
- **[GitHub Issues](https://github.com/KaiTastic/pyASDReader/issues)** - Report bugs and request features
|
|
150
|
+
- **[GitHub Discussions](https://github.com/KaiTastic/pyASDReader/discussions)** - Ask questions and share ideas
|
|
151
|
+
|
|
145
152
|
## Quick Start
|
|
146
153
|
|
|
147
154
|
```python
|
|
@@ -399,7 +406,7 @@ If you use pyASDReader in your research, please cite it using the following info
|
|
|
399
406
|
title = {pyASDReader: A Python Library for ASD Spectral File Reading},
|
|
400
407
|
year = {2025},
|
|
401
408
|
url = {https://github.com/KaiTastic/pyASDReader},
|
|
402
|
-
version = {1.2.
|
|
409
|
+
version = {1.2.3}
|
|
403
410
|
}
|
|
404
411
|
```
|
|
405
412
|
|
|
@@ -59,6 +59,13 @@ pip install -e ".[dev]"
|
|
|
59
59
|
pip install -e ".[all]"
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
+
## Documentation
|
|
63
|
+
|
|
64
|
+
- **[CHANGELOG](CHANGELOG.md)** - Version history, feature updates, and bug fixes
|
|
65
|
+
- **[Version Management Guide](VERSION_MANAGEMENT.md)** - Release workflow, branch strategy, and CI/CD automation
|
|
66
|
+
- **[GitHub Issues](https://github.com/KaiTastic/pyASDReader/issues)** - Report bugs and request features
|
|
67
|
+
- **[GitHub Discussions](https://github.com/KaiTastic/pyASDReader/discussions)** - Ask questions and share ideas
|
|
68
|
+
|
|
62
69
|
## Quick Start
|
|
63
70
|
|
|
64
71
|
```python
|
|
@@ -316,7 +323,7 @@ If you use pyASDReader in your research, please cite it using the following info
|
|
|
316
323
|
title = {pyASDReader: A Python Library for ASD Spectral File Reading},
|
|
317
324
|
year = {2025},
|
|
318
325
|
url = {https://github.com/KaiTastic/pyASDReader},
|
|
319
|
-
version = {1.2.
|
|
326
|
+
version = {1.2.3}
|
|
320
327
|
}
|
|
321
328
|
```
|
|
322
329
|
|
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
# Version Management Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
pyASDReader uses **setuptools_scm** for automatic version management based on Git tags. This ensures version consistency across:
|
|
6
|
+
- Local development environment
|
|
7
|
+
- PyPI packages
|
|
8
|
+
- GitHub releases
|
|
9
|
+
|
|
10
|
+
## Single Source of Truth
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
Git Tag → setuptools_scm → Package Version → PyPI Version
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
All versions are derived from Git tags automatically. No manual version file editing required.
|
|
17
|
+
|
|
18
|
+
## Branch Strategy
|
|
19
|
+
|
|
20
|
+
This project follows a **two-branch workflow** for stable releases:
|
|
21
|
+
|
|
22
|
+
- **dev branch**: Development and testing
|
|
23
|
+
- All new features and fixes are committed here
|
|
24
|
+
- Pushes trigger TestPyPI publishing and full test suite
|
|
25
|
+
- Used for pre-release validation
|
|
26
|
+
|
|
27
|
+
- **main branch**: Production releases only
|
|
28
|
+
- Only receives merges from dev
|
|
29
|
+
- Version tags are created here
|
|
30
|
+
- Tags trigger PyPI publishing and GitHub releases
|
|
31
|
+
- Represents stable, released code
|
|
32
|
+
|
|
33
|
+
**Key Principle**: All version releases must originate from the main branch after merging from dev.
|
|
34
|
+
|
|
35
|
+
## Configuration
|
|
36
|
+
|
|
37
|
+
**pyproject.toml:**
|
|
38
|
+
```toml
|
|
39
|
+
[project]
|
|
40
|
+
dynamic = ["version"] # Version is dynamic, not hardcoded
|
|
41
|
+
|
|
42
|
+
[tool.setuptools_scm]
|
|
43
|
+
version_scheme = "guess-next-dev"
|
|
44
|
+
local_scheme = "no-local-version"
|
|
45
|
+
fallback_version = "1.0.0"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**How it works:**
|
|
49
|
+
- **With Git tag**: Uses tag as version (e.g., `v1.2.0` → `1.2.0`)
|
|
50
|
+
- **Between tags**: Adds dev suffix (e.g., `1.2.0.dev3+g7a8b9c0`)
|
|
51
|
+
- **No Git/tags**: Falls back to `1.0.0`
|
|
52
|
+
|
|
53
|
+
## Release Workflow
|
|
54
|
+
|
|
55
|
+
### Step 1: Development Phase (dev branch)
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Work on dev branch
|
|
59
|
+
git checkout dev
|
|
60
|
+
|
|
61
|
+
# Regular development commits
|
|
62
|
+
git add .
|
|
63
|
+
git commit -m "feat: Add new feature"
|
|
64
|
+
git push origin dev
|
|
65
|
+
|
|
66
|
+
# Triggers TestPyPI workflow:
|
|
67
|
+
# - Builds package
|
|
68
|
+
# - Publishes to TestPyPI
|
|
69
|
+
# - Runs full test suite (9 combinations)
|
|
70
|
+
# - Takes approximately 22 minutes
|
|
71
|
+
|
|
72
|
+
# Version during development: 1.1.0.dev1+g7100d29
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Step 2: Prepare Release (dev branch)
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# 1. Update CHANGELOG.md with release notes
|
|
79
|
+
vim CHANGELOG.md
|
|
80
|
+
|
|
81
|
+
# 2. Move changes from [Unreleased] to new version section
|
|
82
|
+
## [1.2.0] - 2025-10-05
|
|
83
|
+
|
|
84
|
+
### Added
|
|
85
|
+
- New feature X
|
|
86
|
+
- Enhancement Y
|
|
87
|
+
|
|
88
|
+
### Fixed
|
|
89
|
+
- Bug Z
|
|
90
|
+
|
|
91
|
+
# 3. Commit the changelog
|
|
92
|
+
git add CHANGELOG.md
|
|
93
|
+
git commit -m "docs: Update CHANGELOG for v1.2.0 release"
|
|
94
|
+
git push origin dev
|
|
95
|
+
|
|
96
|
+
# Wait for TestPyPI workflow to complete and verify success
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Step 3: Merge to main branch
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Switch to main branch
|
|
103
|
+
git checkout main
|
|
104
|
+
|
|
105
|
+
# Merge dev into main
|
|
106
|
+
git merge dev
|
|
107
|
+
|
|
108
|
+
# Push to main (no workflow triggered yet)
|
|
109
|
+
git push origin main
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Step 4: Create Git Tag (main branch)
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Ensure you're on main branch
|
|
116
|
+
git checkout main
|
|
117
|
+
|
|
118
|
+
# Create annotated tag (REQUIRED for setuptools_scm)
|
|
119
|
+
git tag -a v1.2.0 -m "Release v1.2.0"
|
|
120
|
+
|
|
121
|
+
# Verify tag
|
|
122
|
+
git describe --tags
|
|
123
|
+
# Output: v1.2.0
|
|
124
|
+
|
|
125
|
+
# Push tag to remote
|
|
126
|
+
git push origin v1.2.0
|
|
127
|
+
|
|
128
|
+
# Triggers PyPI workflow:
|
|
129
|
+
# - Checks if commit was tested on TestPyPI
|
|
130
|
+
# - Builds package
|
|
131
|
+
# - Publishes to PyPI
|
|
132
|
+
# - Creates GitHub Release
|
|
133
|
+
# - Reuses TestPyPI tests (saves approximately 45 minutes)
|
|
134
|
+
# - Takes approximately 8 minutes (with test reuse)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Step 5: Build and Publish (Alternative: Manual Publishing)
|
|
138
|
+
|
|
139
|
+
#### Option A: Manual Publishing
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# Install build tools
|
|
143
|
+
pip install build twine
|
|
144
|
+
|
|
145
|
+
# Build package
|
|
146
|
+
python -m build
|
|
147
|
+
|
|
148
|
+
# Check version in built package
|
|
149
|
+
tar -tzf dist/pyASDReader-1.2.0.tar.gz | grep PKG-INFO
|
|
150
|
+
tar -xzf dist/pyASDReader-1.2.0.tar.gz -O pyASDReader-1.2.0/PKG-INFO | grep Version
|
|
151
|
+
|
|
152
|
+
# Upload to TestPyPI (optional, for testing)
|
|
153
|
+
python -m twine upload --repository testpypi dist/*
|
|
154
|
+
|
|
155
|
+
# Upload to PyPI (production)
|
|
156
|
+
python -m twine upload dist/*
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
#### Option B: Automatic Publishing (GitHub Actions) - Recommended
|
|
160
|
+
|
|
161
|
+
The project uses a two-stage automated publishing workflow, which is covered in Steps 1-4 above.
|
|
162
|
+
|
|
163
|
+
**Workflow Summary**:
|
|
164
|
+
```bash
|
|
165
|
+
# Stage 1: Development Testing (TestPyPI)
|
|
166
|
+
git checkout dev
|
|
167
|
+
git push origin dev
|
|
168
|
+
# Wait for TestPyPI workflow to complete (approximately 22 min)
|
|
169
|
+
|
|
170
|
+
# Stage 2: Verify TestPyPI success at:
|
|
171
|
+
# https://github.com/YOUR_USERNAME/ASD_File_Reader/actions
|
|
172
|
+
|
|
173
|
+
# Stage 3: Merge to main and create release
|
|
174
|
+
git checkout main
|
|
175
|
+
git merge dev
|
|
176
|
+
git push origin main
|
|
177
|
+
|
|
178
|
+
# Stage 4: Push tag for production release
|
|
179
|
+
git tag -a v1.2.0 -m "Release v1.2.0"
|
|
180
|
+
git push origin v1.2.0
|
|
181
|
+
# PyPI workflow reuses TestPyPI tests (approximately 8 min)
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Total Time**: Approximately 30 minutes (vs approximately 50 min without test reuse)
|
|
185
|
+
|
|
186
|
+
See:
|
|
187
|
+
- `.github/workflows/publish-to-testpypi.yml` - Triggered by dev branch pushes
|
|
188
|
+
- `.github/workflows/publish-to-pypi.yml` - Triggered by version tags on main branch
|
|
189
|
+
|
|
190
|
+
## CI/CD Workflows
|
|
191
|
+
|
|
192
|
+
### TestPyPI Workflow (Dev Branch)
|
|
193
|
+
|
|
194
|
+
**Trigger**: Push to `dev` branch
|
|
195
|
+
|
|
196
|
+
**Purpose**: Automated testing before production release
|
|
197
|
+
|
|
198
|
+
**Process**:
|
|
199
|
+
1. Builds distribution packages
|
|
200
|
+
2. Publishes to TestPyPI
|
|
201
|
+
3. Runs comprehensive verification tests:
|
|
202
|
+
- 3 operating systems: Ubuntu, Windows, macOS
|
|
203
|
+
- 3 Python versions: 3.8, 3.11, 3.12
|
|
204
|
+
- 9 total test combinations
|
|
205
|
+
4. Duration: Approximately 22 minutes
|
|
206
|
+
|
|
207
|
+
**Concurrency**: Automatically cancels outdated runs when new commits are pushed
|
|
208
|
+
|
|
209
|
+
### PyPI Workflow (Version Tags)
|
|
210
|
+
|
|
211
|
+
**Trigger**: Push tags matching `v*.*.*` (e.g., v1.2.0)
|
|
212
|
+
|
|
213
|
+
**Purpose**: Production release with intelligent test optimization
|
|
214
|
+
|
|
215
|
+
**Process**:
|
|
216
|
+
1. **Smart Test Reuse**:
|
|
217
|
+
- Checks if commit was tested on TestPyPI (within 7 days)
|
|
218
|
+
- Validates test completeness (9/9 jobs passed)
|
|
219
|
+
- Skips verification if already tested
|
|
220
|
+
|
|
221
|
+
2. **Build & Publish**:
|
|
222
|
+
- Builds distribution packages
|
|
223
|
+
- Publishes to PyPI
|
|
224
|
+
|
|
225
|
+
3. **GitHub Release**:
|
|
226
|
+
- Creates release with auto-generated notes
|
|
227
|
+
- Extracts changelog for the version
|
|
228
|
+
- Updates CITATION.cff
|
|
229
|
+
- Attaches distribution packages
|
|
230
|
+
|
|
231
|
+
4. **Verification** (conditional):
|
|
232
|
+
- **If tested on TestPyPI**: Skipped (saves approximately 45 min)
|
|
233
|
+
- **If not tested**: Full verification (9 combinations)
|
|
234
|
+
|
|
235
|
+
5. **Summary**:
|
|
236
|
+
- Displays test reuse status
|
|
237
|
+
- Links to TestPyPI workflow (if reused)
|
|
238
|
+
- Shows time saved
|
|
239
|
+
|
|
240
|
+
### Publishing Scenarios
|
|
241
|
+
|
|
242
|
+
#### Scenario 1: Normal Release (Recommended)
|
|
243
|
+
```bash
|
|
244
|
+
# 1. Push to dev branch and wait for TestPyPI
|
|
245
|
+
git checkout dev
|
|
246
|
+
git push origin dev # Approximately 22 min (full tests)
|
|
247
|
+
# Wait for success...
|
|
248
|
+
|
|
249
|
+
# 2. Merge to main and create tag
|
|
250
|
+
git checkout main
|
|
251
|
+
git merge dev
|
|
252
|
+
git push origin main
|
|
253
|
+
|
|
254
|
+
# 3. Push tag on main branch
|
|
255
|
+
git push origin v1.2.0 # Approximately 8 min (tests reused)
|
|
256
|
+
# Total: Approximately 30 min
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
#### Scenario 2: Hotfix (Urgent Fix on main)
|
|
260
|
+
```bash
|
|
261
|
+
# 1. Create fix directly on main (bypass dev for urgent fixes)
|
|
262
|
+
git checkout main
|
|
263
|
+
git commit -m "fix: Critical security patch"
|
|
264
|
+
git push origin main
|
|
265
|
+
|
|
266
|
+
# 2. Push tag directly
|
|
267
|
+
git tag -a v1.2.1 -m "Hotfix: Critical security patch"
|
|
268
|
+
git push origin v1.2.1 # Approximately 23 min (full tests, no TestPyPI history)
|
|
269
|
+
# Safe fallback: always runs full verification
|
|
270
|
+
|
|
271
|
+
# 3. Back-merge to dev to keep branches in sync
|
|
272
|
+
git checkout dev
|
|
273
|
+
git merge main
|
|
274
|
+
git push origin dev
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
#### Scenario 3: Quick Release (Not Recommended)
|
|
278
|
+
```bash
|
|
279
|
+
# Push dev and tag simultaneously without merge
|
|
280
|
+
git push origin dev --tags # Approximately 45 min (both run full tests in parallel)
|
|
281
|
+
# ⚠️ Warning: Tags not on main branch, breaks branch strategy
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Resource Optimization
|
|
285
|
+
|
|
286
|
+
**GitHub Actions Minutes**:
|
|
287
|
+
- TestPyPI per push: Approximately 22 minutes
|
|
288
|
+
- PyPI (normal release): Approximately 8 minutes (with test reuse)
|
|
289
|
+
- PyPI (hotfix): Approximately 23 minutes (full tests)
|
|
290
|
+
|
|
291
|
+
**Monthly Estimate** (20 dev pushes + 2 releases):
|
|
292
|
+
- TestPyPI: 20 × 22 = 440 min
|
|
293
|
+
- PyPI: 2 × 8 = 16 min
|
|
294
|
+
- **Total**: Approximately 456 min/month (approximately 23% of free tier 2000 min)
|
|
295
|
+
|
|
296
|
+
**Savings**: Approximately 40% compared to running full tests every time
|
|
297
|
+
|
|
298
|
+
## Version Verification
|
|
299
|
+
|
|
300
|
+
### Check Local Version
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
# Method 1: Using Python
|
|
304
|
+
python -c "from pyASDReader import __version__; print(__version__)"
|
|
305
|
+
|
|
306
|
+
# Method 2: Using setuptools_scm directly
|
|
307
|
+
python -m setuptools_scm
|
|
308
|
+
|
|
309
|
+
# Method 3: After installation
|
|
310
|
+
pip show pyASDReader | grep Version
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Check PyPI Version
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
# Latest version on PyPI
|
|
317
|
+
pip index versions pyASDReader
|
|
318
|
+
|
|
319
|
+
# Or visit
|
|
320
|
+
# https://pypi.org/project/pyASDReader/
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Check Git Tags
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
# List all tags
|
|
327
|
+
git tag -l
|
|
328
|
+
|
|
329
|
+
# Show latest tag
|
|
330
|
+
git describe --tags --abbrev=0
|
|
331
|
+
|
|
332
|
+
# Show detailed tag info
|
|
333
|
+
git show v1.2.0
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
## Semantic Versioning
|
|
337
|
+
|
|
338
|
+
Follow [Semantic Versioning 2.0.0](https://semver.org/):
|
|
339
|
+
|
|
340
|
+
```
|
|
341
|
+
v{MAJOR}.{MINOR}.{PATCH}
|
|
342
|
+
|
|
343
|
+
MAJOR: Incompatible API changes
|
|
344
|
+
MINOR: Backwards-compatible new features
|
|
345
|
+
PATCH: Backwards-compatible bug fixes
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
**Examples:**
|
|
349
|
+
- `v1.0.0` → `v1.0.1`: Bug fix release
|
|
350
|
+
- `v1.0.1` → `v1.1.0`: New feature added
|
|
351
|
+
- `v1.1.0` → `v2.0.0`: Breaking changes
|
|
352
|
+
|
|
353
|
+
## Troubleshooting
|
|
354
|
+
|
|
355
|
+
### Problem: Wrong version displayed
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
# Check what tag Git sees
|
|
359
|
+
git describe --tags
|
|
360
|
+
|
|
361
|
+
# If wrong tag is shown, check for duplicate tags
|
|
362
|
+
git tag -l
|
|
363
|
+
|
|
364
|
+
# Remove incorrect tag
|
|
365
|
+
git tag -d v1.0.0
|
|
366
|
+
git push origin :refs/tags/v1.0.0
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### Problem: Version shows as fallback (1.0.0)
|
|
370
|
+
|
|
371
|
+
**Cause:** setuptools_scm not installed or not in Git repository
|
|
372
|
+
|
|
373
|
+
**Solution:**
|
|
374
|
+
```bash
|
|
375
|
+
# Install setuptools_scm
|
|
376
|
+
pip install setuptools_scm>=8
|
|
377
|
+
|
|
378
|
+
# Verify you're in a Git repo
|
|
379
|
+
git status
|
|
380
|
+
|
|
381
|
+
# Verify tags exist
|
|
382
|
+
git tag -l
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### Problem: Duplicate tags on same commit
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
# Current status
|
|
389
|
+
git tag --points-at HEAD
|
|
390
|
+
# Output: v1.0.0
|
|
391
|
+
# v1.1.0
|
|
392
|
+
|
|
393
|
+
# Delete the incorrect tag
|
|
394
|
+
git tag -d v1.0.0
|
|
395
|
+
git push origin :refs/tags/v1.0.0
|
|
396
|
+
|
|
397
|
+
# Verify
|
|
398
|
+
git describe --tags
|
|
399
|
+
# Output: v1.1.0
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
### Problem: PyPI version doesn't match Git tag
|
|
403
|
+
|
|
404
|
+
**Cause:** Package was built before tag was created
|
|
405
|
+
|
|
406
|
+
**Solution:**
|
|
407
|
+
```bash
|
|
408
|
+
# 1. Clean old builds
|
|
409
|
+
rm -rf dist/ build/ *.egg-info
|
|
410
|
+
|
|
411
|
+
# 2. Verify current Git tag
|
|
412
|
+
git describe --tags
|
|
413
|
+
|
|
414
|
+
# 3. Rebuild
|
|
415
|
+
python -m build
|
|
416
|
+
|
|
417
|
+
# 4. Check built version
|
|
418
|
+
ls dist/
|
|
419
|
+
# Should show: pyASDReader-1.2.0.tar.gz
|
|
420
|
+
|
|
421
|
+
# 5. Re-upload (requires new version number on PyPI)
|
|
422
|
+
python -m twine upload dist/*
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
## Best Practices
|
|
426
|
+
|
|
427
|
+
1. **Follow the branch strategy**
|
|
428
|
+
- **Development**: Always work on `dev` branch
|
|
429
|
+
- **Releases**: Always tag on `main` branch after merging from `dev`
|
|
430
|
+
- **Hotfixes**: Apply to `main`, then back-merge to `dev`
|
|
431
|
+
- This keeps `main` stable and `dev` as the integration branch
|
|
432
|
+
|
|
433
|
+
2. **Always use annotated tags**: `git tag -a v1.2.0 -m "message"`
|
|
434
|
+
- NOT `git tag v1.2.0` (lightweight tag)
|
|
435
|
+
- Only create tags on `main` branch
|
|
436
|
+
|
|
437
|
+
3. **Never edit version files manually**
|
|
438
|
+
- src/_version.py is auto-generated
|
|
439
|
+
- pyproject.toml has `dynamic = ["version"]`
|
|
440
|
+
|
|
441
|
+
4. **Update CHANGELOG before tagging**
|
|
442
|
+
- Users need to know what changed
|
|
443
|
+
- Tag message can reference CHANGELOG
|
|
444
|
+
- Update CHANGELOG on `dev` branch, then merge to `main`
|
|
445
|
+
|
|
446
|
+
5. **Test before releasing**
|
|
447
|
+
- Run full test suite: `pytest tests/`
|
|
448
|
+
- Test installation: `pip install -e .`
|
|
449
|
+
- Verify version: `python -c "from pyASDReader import __version__; print(__version__)"`
|
|
450
|
+
|
|
451
|
+
6. **Use TestPyPI for testing**
|
|
452
|
+
- Dev branch auto-publishes to TestPyPI
|
|
453
|
+
- Always verify TestPyPI success before merging to main
|
|
454
|
+
- TestPyPI tests are automatically reused by PyPI workflow
|
|
455
|
+
- Manual test uploads: `bash scripts/publish.sh test`
|
|
456
|
+
- Manual verification: `pip install -i https://test.pypi.org/simple/ pyASDReader`
|
|
457
|
+
|
|
458
|
+
7. **Follow the recommended release workflow**
|
|
459
|
+
- Push to dev first, wait for TestPyPI to complete
|
|
460
|
+
- Verify tests passed in GitHub Actions
|
|
461
|
+
- Merge dev to main
|
|
462
|
+
- Then push tag from main for production release
|
|
463
|
+
- This ensures maximum test coverage with minimal Actions minutes
|
|
464
|
+
|
|
465
|
+
8. **Understand workflow behavior**
|
|
466
|
+
- TestPyPI: Full tests on every dev push
|
|
467
|
+
- PyPI: Smart test reuse (7-day window)
|
|
468
|
+
- Hotfix tags: Auto-fallback to full testing
|
|
469
|
+
- Concurrent dev pushes: Auto-cancel outdated runs
|
|
470
|
+
|
|
471
|
+
9. **One tag per release**
|
|
472
|
+
- Don't create multiple tags on same commit
|
|
473
|
+
- Don't move tags after pushing
|
|
474
|
+
- Verify tag is on main: `git branch --contains <tag>`
|
|
475
|
+
|
|
476
|
+
10. **Keep branches in sync**
|
|
477
|
+
- After hotfixes on main, always back-merge to dev
|
|
478
|
+
- Prevents divergence between branches
|
|
479
|
+
- Use `git merge main` on dev branch after hotfix releases
|
|
480
|
+
|
|
481
|
+
## Quick Reference
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
# Development workflow (dev branch)
|
|
485
|
+
git checkout dev
|
|
486
|
+
git commit -m "feat: New feature"
|
|
487
|
+
git push origin dev
|
|
488
|
+
# Triggers TestPyPI publish + full tests (approximately 22 min)
|
|
489
|
+
|
|
490
|
+
# Release workflow (recommended)
|
|
491
|
+
# Step 1: Update CHANGELOG on dev
|
|
492
|
+
git checkout dev
|
|
493
|
+
vim CHANGELOG.md
|
|
494
|
+
git commit -m "docs: Update CHANGELOG for v1.2.0"
|
|
495
|
+
git push origin dev
|
|
496
|
+
# Wait for TestPyPI success
|
|
497
|
+
|
|
498
|
+
# Step 2: Merge to main
|
|
499
|
+
git checkout main
|
|
500
|
+
git merge dev
|
|
501
|
+
git push origin main
|
|
502
|
+
|
|
503
|
+
# Step 3: Create and push tag on main
|
|
504
|
+
git tag -a v1.2.0 -m "Release v1.2.0"
|
|
505
|
+
git push origin v1.2.0
|
|
506
|
+
# PyPI publish + test reuse (approximately 8 min)
|
|
507
|
+
|
|
508
|
+
# Hotfix workflow (emergency on main)
|
|
509
|
+
git checkout main
|
|
510
|
+
git commit -m "fix: Critical bug"
|
|
511
|
+
git push origin main
|
|
512
|
+
git tag -a v1.2.1 -m "Hotfix: Critical bug"
|
|
513
|
+
git push origin v1.2.1
|
|
514
|
+
# PyPI publish + full tests (approximately 23 min)
|
|
515
|
+
# Don't forget to back-merge to dev:
|
|
516
|
+
git checkout dev
|
|
517
|
+
git merge main
|
|
518
|
+
git push origin dev
|
|
519
|
+
|
|
520
|
+
# Manual publishing (if needed)
|
|
521
|
+
python -m build
|
|
522
|
+
python -m twine upload dist/*
|
|
523
|
+
|
|
524
|
+
# Verification commands
|
|
525
|
+
git describe --tags
|
|
526
|
+
git branch --contains $(git describe --tags) # Check which branch has the tag
|
|
527
|
+
python -c "from pyASDReader import __version__; print(__version__)"
|
|
528
|
+
pip index versions pyASDReader
|
|
529
|
+
|
|
530
|
+
# Check workflow status
|
|
531
|
+
# https://github.com/YOUR_USERNAME/ASD_File_Reader/actions
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
## References
|
|
535
|
+
|
|
536
|
+
- [setuptools_scm documentation](https://setuptools-scm.readthedocs.io/)
|
|
537
|
+
- [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
|
|
538
|
+
- [PEP 440 - Version Identification](https://peps.python.org/pep-0440/)
|
|
539
|
+
- [Git Tagging Documentation](https://git-scm.com/book/en/v2/Git-Basics-Tagging)
|
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
# Version Management Guide
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
pyASDReader uses **setuptools_scm** for automatic version management based on Git tags. This ensures version consistency across:
|
|
6
|
-
- Local development environment
|
|
7
|
-
- PyPI packages
|
|
8
|
-
- GitHub releases
|
|
9
|
-
|
|
10
|
-
## Single Source of Truth
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
Git Tag → setuptools_scm → Package Version → PyPI Version
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
All versions are derived from Git tags automatically. No manual version file editing required.
|
|
17
|
-
|
|
18
|
-
## Configuration
|
|
19
|
-
|
|
20
|
-
**pyproject.toml:**
|
|
21
|
-
```toml
|
|
22
|
-
[project]
|
|
23
|
-
dynamic = ["version"] # Version is dynamic, not hardcoded
|
|
24
|
-
|
|
25
|
-
[tool.setuptools_scm]
|
|
26
|
-
version_scheme = "guess-next-dev"
|
|
27
|
-
local_scheme = "no-local-version"
|
|
28
|
-
fallback_version = "1.0.0"
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
**How it works:**
|
|
32
|
-
- **With Git tag**: Uses tag as version (e.g., `v1.2.0` → `1.2.0`)
|
|
33
|
-
- **Between tags**: Adds dev suffix (e.g., `1.2.0.dev3+g7a8b9c0`)
|
|
34
|
-
- **No Git/tags**: Falls back to `1.0.0`
|
|
35
|
-
|
|
36
|
-
## Release Workflow
|
|
37
|
-
|
|
38
|
-
### Step 1: Development Phase
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
# Regular development commits
|
|
42
|
-
git add .
|
|
43
|
-
git commit -m "feat: Add new feature"
|
|
44
|
-
git push origin main
|
|
45
|
-
|
|
46
|
-
# Version during development: 1.1.0.dev1+g7100d29
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Step 2: Prepare Release
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
# 1. Update CHANGELOG.md with release notes
|
|
53
|
-
vim CHANGELOG.md
|
|
54
|
-
|
|
55
|
-
# 2. Move changes from [Unreleased] to new version section
|
|
56
|
-
## [1.2.0] - 2025-10-05
|
|
57
|
-
|
|
58
|
-
### Added
|
|
59
|
-
- New feature X
|
|
60
|
-
- Enhancement Y
|
|
61
|
-
|
|
62
|
-
### Fixed
|
|
63
|
-
- Bug Z
|
|
64
|
-
|
|
65
|
-
# 3. Commit the changelog
|
|
66
|
-
git add CHANGELOG.md
|
|
67
|
-
git commit -m "docs: Update CHANGELOG for v1.2.0 release"
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Step 3: Create Git Tag
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
# Create annotated tag (REQUIRED for setuptools_scm)
|
|
74
|
-
git tag -a v1.2.0 -m "Release v1.2.0"
|
|
75
|
-
|
|
76
|
-
# Verify tag
|
|
77
|
-
git describe --tags
|
|
78
|
-
# Output: v1.2.0
|
|
79
|
-
|
|
80
|
-
# Push tag to remote
|
|
81
|
-
git push origin v1.2.0
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### Step 4: Build and Publish
|
|
85
|
-
|
|
86
|
-
#### Option A: Manual Publishing
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
# Install build tools
|
|
90
|
-
pip install build twine
|
|
91
|
-
|
|
92
|
-
# Build package
|
|
93
|
-
python -m build
|
|
94
|
-
|
|
95
|
-
# Check version in built package
|
|
96
|
-
tar -tzf dist/pyASDReader-1.2.0.tar.gz | grep PKG-INFO
|
|
97
|
-
tar -xzf dist/pyASDReader-1.2.0.tar.gz -O pyASDReader-1.2.0/PKG-INFO | grep Version
|
|
98
|
-
|
|
99
|
-
# Upload to TestPyPI (optional, for testing)
|
|
100
|
-
python -m twine upload --repository testpypi dist/*
|
|
101
|
-
|
|
102
|
-
# Upload to PyPI (production)
|
|
103
|
-
python -m twine upload dist/*
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
#### Option B: Automatic Publishing (GitHub Actions)
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
# Just push the tag - GitHub Actions handles the rest
|
|
110
|
-
git push origin v1.2.0
|
|
111
|
-
|
|
112
|
-
# Workflow automatically:
|
|
113
|
-
# 1. Builds the package
|
|
114
|
-
# 2. Runs tests
|
|
115
|
-
# 3. Publishes to PyPI
|
|
116
|
-
# 4. Creates GitHub Release
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
See `.github/workflows/publish-to-pypi.yml`
|
|
120
|
-
|
|
121
|
-
## Version Verification
|
|
122
|
-
|
|
123
|
-
### Check Local Version
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
# Method 1: Using Python
|
|
127
|
-
python -c "from pyASDReader import __version__; print(__version__)"
|
|
128
|
-
|
|
129
|
-
# Method 2: Using setuptools_scm directly
|
|
130
|
-
python -m setuptools_scm
|
|
131
|
-
|
|
132
|
-
# Method 3: After installation
|
|
133
|
-
pip show pyASDReader | grep Version
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### Check PyPI Version
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
# Latest version on PyPI
|
|
140
|
-
pip index versions pyASDReader
|
|
141
|
-
|
|
142
|
-
# Or visit
|
|
143
|
-
# https://pypi.org/project/pyASDReader/
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Check Git Tags
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
# List all tags
|
|
150
|
-
git tag -l
|
|
151
|
-
|
|
152
|
-
# Show latest tag
|
|
153
|
-
git describe --tags --abbrev=0
|
|
154
|
-
|
|
155
|
-
# Show detailed tag info
|
|
156
|
-
git show v1.2.0
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
## Semantic Versioning
|
|
160
|
-
|
|
161
|
-
Follow [Semantic Versioning 2.0.0](https://semver.org/):
|
|
162
|
-
|
|
163
|
-
```
|
|
164
|
-
v{MAJOR}.{MINOR}.{PATCH}
|
|
165
|
-
|
|
166
|
-
MAJOR: Incompatible API changes
|
|
167
|
-
MINOR: Backwards-compatible new features
|
|
168
|
-
PATCH: Backwards-compatible bug fixes
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
**Examples:**
|
|
172
|
-
- `v1.0.0` → `v1.0.1`: Bug fix release
|
|
173
|
-
- `v1.0.1` → `v1.1.0`: New feature added
|
|
174
|
-
- `v1.1.0` → `v2.0.0`: Breaking changes
|
|
175
|
-
|
|
176
|
-
## Troubleshooting
|
|
177
|
-
|
|
178
|
-
### Problem: Wrong version displayed
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
# Check what tag Git sees
|
|
182
|
-
git describe --tags
|
|
183
|
-
|
|
184
|
-
# If wrong tag is shown, check for duplicate tags
|
|
185
|
-
git tag -l
|
|
186
|
-
|
|
187
|
-
# Remove incorrect tag
|
|
188
|
-
git tag -d v1.0.0
|
|
189
|
-
git push origin :refs/tags/v1.0.0
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### Problem: Version shows as fallback (1.0.0)
|
|
193
|
-
|
|
194
|
-
**Cause:** setuptools_scm not installed or not in Git repository
|
|
195
|
-
|
|
196
|
-
**Solution:**
|
|
197
|
-
```bash
|
|
198
|
-
# Install setuptools_scm
|
|
199
|
-
pip install setuptools_scm>=8
|
|
200
|
-
|
|
201
|
-
# Verify you're in a Git repo
|
|
202
|
-
git status
|
|
203
|
-
|
|
204
|
-
# Verify tags exist
|
|
205
|
-
git tag -l
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### Problem: Duplicate tags on same commit
|
|
209
|
-
|
|
210
|
-
```bash
|
|
211
|
-
# Current status
|
|
212
|
-
git tag --points-at HEAD
|
|
213
|
-
# Output: v1.0.0
|
|
214
|
-
# v1.1.0
|
|
215
|
-
|
|
216
|
-
# Delete the incorrect tag
|
|
217
|
-
git tag -d v1.0.0
|
|
218
|
-
git push origin :refs/tags/v1.0.0
|
|
219
|
-
|
|
220
|
-
# Verify
|
|
221
|
-
git describe --tags
|
|
222
|
-
# Output: v1.1.0
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
### Problem: PyPI version doesn't match Git tag
|
|
226
|
-
|
|
227
|
-
**Cause:** Package was built before tag was created
|
|
228
|
-
|
|
229
|
-
**Solution:**
|
|
230
|
-
```bash
|
|
231
|
-
# 1. Clean old builds
|
|
232
|
-
rm -rf dist/ build/ *.egg-info
|
|
233
|
-
|
|
234
|
-
# 2. Verify current Git tag
|
|
235
|
-
git describe --tags
|
|
236
|
-
|
|
237
|
-
# 3. Rebuild
|
|
238
|
-
python -m build
|
|
239
|
-
|
|
240
|
-
# 4. Check built version
|
|
241
|
-
ls dist/
|
|
242
|
-
# Should show: pyASDReader-1.2.0.tar.gz
|
|
243
|
-
|
|
244
|
-
# 5. Re-upload (requires new version number on PyPI)
|
|
245
|
-
python -m twine upload dist/*
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
## Best Practices
|
|
249
|
-
|
|
250
|
-
1. **Always use annotated tags**: `git tag -a v1.2.0 -m "message"`
|
|
251
|
-
- NOT `git tag v1.2.0` (lightweight tag)
|
|
252
|
-
|
|
253
|
-
2. **Never edit version files manually**
|
|
254
|
-
- src/_version.py is auto-generated
|
|
255
|
-
- pyproject.toml has `dynamic = ["version"]`
|
|
256
|
-
|
|
257
|
-
3. **Update CHANGELOG before tagging**
|
|
258
|
-
- Users need to know what changed
|
|
259
|
-
- Tag message can reference CHANGELOG
|
|
260
|
-
|
|
261
|
-
4. **Test before releasing**
|
|
262
|
-
- Run full test suite: `pytest tests/`
|
|
263
|
-
- Test installation: `pip install -e .`
|
|
264
|
-
- Verify version: `python -c "from pyASDReader import __version__; print(__version__)"`
|
|
265
|
-
|
|
266
|
-
5. **Use TestPyPI for testing**
|
|
267
|
-
- Test uploads: `bash scripts/publish.sh test`
|
|
268
|
-
- Verify installation: `pip install -i https://test.pypi.org/simple/ pyASDReader`
|
|
269
|
-
|
|
270
|
-
6. **One tag per release**
|
|
271
|
-
- Don't create multiple tags on same commit
|
|
272
|
-
- Don't move tags after pushing
|
|
273
|
-
|
|
274
|
-
## Quick Reference
|
|
275
|
-
|
|
276
|
-
```bash
|
|
277
|
-
# Development workflow
|
|
278
|
-
git commit -m "feat: New feature"
|
|
279
|
-
git push
|
|
280
|
-
|
|
281
|
-
# Release workflow
|
|
282
|
-
vim CHANGELOG.md
|
|
283
|
-
git commit -m "docs: Update CHANGELOG for v1.2.0"
|
|
284
|
-
git tag -a v1.2.0 -m "Release v1.2.0"
|
|
285
|
-
git push origin v1.2.0
|
|
286
|
-
|
|
287
|
-
# Automatic publishing via GitHub Actions
|
|
288
|
-
# Manual publishing
|
|
289
|
-
python -m build
|
|
290
|
-
python -m twine upload dist/*
|
|
291
|
-
|
|
292
|
-
# Verification
|
|
293
|
-
git describe --tags
|
|
294
|
-
python -c "from pyASDReader import __version__; print(__version__)"
|
|
295
|
-
pip index versions pyASDReader
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
## References
|
|
299
|
-
|
|
300
|
-
- [setuptools_scm documentation](https://setuptools-scm.readthedocs.io/)
|
|
301
|
-
- [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
|
|
302
|
-
- [PEP 440 - Version Identification](https://peps.python.org/pep-0440/)
|
|
303
|
-
- [Git Tagging Documentation](https://git-scm.com/book/en/v2/Git-Basics-Tagging)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|