@@ -4,41 +4,44 @@ This document outlines the steps to create a new release for the `pyspark-data-s
44
55## Prerequisites
66
7- - Ensure you have Poetry installed
7+ - Ensure you have [ uv ] ( https://docs.astral.sh/uv/ ) installed
88- Ensure you have GitHub CLI installed (optional, for enhanced releases)
99- Ensure you have push access to the repository
1010- Ensure all tests pass and the code is ready for release
1111
1212## Release Steps
1313
14- ### 1. Update Version (Using Poetry Commands)
14+ ### 1. Update Version
1515
16- Use Poetry's built-in version bumping commands:
16+ ` uv ` does not manage versions directly, but you can use the Hatch CLI via ` uvx ` or edit ` pyproject.toml ` manually.
1717
1818``` bash
1919# Bump patch version (0.1.6 → 0.1.7) - for bug fixes
20- poetry version patch
20+ uvx hatch version patch
2121
2222# Bump minor version (0.1.6 → 0.2.0) - for new features
23- poetry version minor
23+ uvx hatch version minor
2424
2525# Bump major version (0.1.6 → 1.0.0) - for breaking changes
26- poetry version major
26+ uvx hatch version major
2727
2828# Or set a specific version
29- poetry version 1.2.3
29+ uvx hatch version 1.2.3
3030```
3131
32- This automatically updates the version in ` pyproject.toml ` .
32+ These commands update the ` version ` field under ` [project] ` in ` pyproject.toml ` . You can also open the file and edit the value manually if you prefer .
3333
3434### 2. Build and Publish
3535
3636``` bash
37- # Build the package
38- poetry build
37+ # Build the package (creates dist/ artifacts)
38+ uv build
3939
40- # Publish to PyPI (requires PyPI credentials)
41- poetry publish
40+ # Publish to PyPI (requires token or username/password)
41+ uv publish
42+
43+ # Optional: dry-run to verify upload without publishing
44+ uv publish --dry-run
4245```
4346
4447### 3. Commit Version Changes
@@ -48,7 +51,8 @@ poetry publish
4851git add pyproject.toml
4952
5053# Commit with the current version (automatically retrieved)
51- git commit -m " Bump version to $( poetry version -s) "
54+ VERSION=$( uvx hatch version)
55+ git commit -m " Bump version to ${VERSION} "
5256
5357# Push to main branch
5458git push
@@ -59,35 +63,37 @@ git push
5963#### Option A: Simple Git Tag
6064``` bash
6165# Create an annotated tag with current version
62- git tag -a " v$( poetry version -s) " -m " Release version $( poetry version -s) "
66+ VERSION=$( uvx hatch version)
67+ git tag -a " v${VERSION} " -m " Release version ${VERSION} "
6368
6469# Push the tag to GitHub
65- git push origin " v$( poetry version -s ) "
70+ git push origin " v${VERSION} "
6671```
6772
6873#### Option B: Rich GitHub Release (Recommended)
6974``` bash
7075# Create a GitHub release with current version
71- gh release create " v$( poetry version -s) " \
72- --title " Release v$( poetry version -s) " \
73- --notes " Release notes for version $( poetry version -s) " \
76+ VERSION=$( uvx hatch version)
77+ gh release create " v${VERSION} " \
78+ --title " Release v${VERSION} " \
79+ --notes " Release notes for version ${VERSION} " \
7480 --latest
7581```
7682
7783## Version Numbering
7884
7985Follow [ Semantic Versioning] ( https://semver.org/ ) :
8086
81- - ** Patch** (` poetry version patch` ): Bug fixes, no breaking changes
82- - ** Minor** (` poetry version minor` ): New features, backward compatible
83- - ** Major** (` poetry version major` ): Breaking changes
87+ - ** Patch** (` uvx hatch version patch` ): Bug fixes, no breaking changes
88+ - ** Minor** (` uvx hatch version minor` ): New features, backward compatible
89+ - ** Major** (` uvx hatch version major` ): Breaking changes
8490
8591## Manual Version Update (Alternative)
8692
8793If you prefer to manually edit ` pyproject.toml ` :
8894
8995``` toml
90- [tool . poetry ]
96+ [project ]
9197version = " x.y.z" # Update this line manually
9298```
9399
@@ -98,21 +104,27 @@ Then follow steps 2-4 above.
98104- [ ] All tests pass
99105- [ ] Documentation is up to date
100106- [ ] CHANGELOG.md is updated (if applicable)
101- - [ ] Version is bumped using ` poetry version [patch|minor|major]`
102- - [ ] Package builds successfully (` poetry build` )
103- - [ ] Package publishes successfully (` poetry publish` )
107+ - [ ] Version is bumped using ` uvx hatch version [patch|minor|major]` (or manual edit)
108+ - [ ] Package builds successfully (` uv build` )
109+ - [ ] Package publishes successfully (` uv publish` )
104110- [ ] Version changes are committed and pushed
105111- [ ] GitHub release/tag is created
106112- [ ] Release notes are written
107113
108114## Troubleshooting
109115
110116### Publishing Issues
111- - Ensure you're authenticated with PyPI: ` poetry config pypi- token.pypi your -token`
117+ - Ensure you're authenticated with PyPI: ` uv publish -- token <pypi -token> ` or set credentials via environment variables
112118- Check if the version already exists on PyPI
113119
114120### Git Tag Issues
115- - If tag already exists: ` git tag -d "v$(poetry version -s)" ` (delete local) and ` git push origin :refs/tags/"v$(poetry version -s)" ` (delete remote)
121+ - If tag already exists:
122+
123+ ``` bash
124+ VERSION=$( uvx hatch version)
125+ git tag -d " v${VERSION} "
126+ git push origin :refs/tags/" v${VERSION} "
127+ ```
116128- Ensure you have push permissions to the repository
117129
118130### GitHub CLI Issues
@@ -127,26 +139,21 @@ If you see `objc_initializeAfterForkError` crashes on macOS, set this environmen
127139# For single commands
128140OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES python your_script.py
129141
130- # For Poetry environment
131- OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES poetry run python your_script.py
142+ # For commands that run inside the uv environment
143+ OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES uv run python your_script.py
132144
133145# To set permanently in your shell (add to ~/.zshrc or ~/.bash_profile):
134146export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
135147```
136148
137- ## Useful Poetry Version Commands
149+ ## Useful Version Commands
138150
139151``` bash
140152# Check current version
141- poetry version
142-
143- # Show version number only (useful for scripts)
144- poetry version -s
153+ uvx hatch version
145154
146- # Preview what the next version would be (without changing it)
147- poetry version --dry-run patch
148- poetry version --dry-run minor
149- poetry version --dry-run major
155+ # Bump to an explicit version
156+ uvx hatch version 0.2.0
150157```
151158
152159## Documentation Releases
0 commit comments