Skip to content

Commit 3f89e95

Browse files
authored
Merge pull request #5 from getyourguide/publish-to-pypi
fix: added publishing and release workflows
2 parents fec5ee4 + f7b731f commit 3f89e95

File tree

7 files changed

+114
-29
lines changed

7 files changed

+114
-29
lines changed

.github/pull_request_template.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,31 @@
33
Describe the change at a high-level.
44
-->
55

6+
## Commit Message Format
7+
<!--
8+
This project uses Conventional Commits for automated versioning and changelog generation.
9+
Ensure your commit messages follow this format:
10+
11+
- feat: A new feature (triggers MINOR version bump)
12+
- fix: A bug fix (triggers PATCH version bump)
13+
- feat!: A breaking change (triggers MAJOR version bump)
14+
- docs: Documentation changes
15+
- chore: Maintenance tasks
16+
- test: Adding or updating tests
17+
18+
Examples:
19+
- feat: add expectation for null value validation
20+
- fix: correct type hint in expect_value_greater_than
21+
- feat!: remove deprecated validation methods
22+
-->
23+
624
## Checklist
725
<!--
826
Please consider the following when submitting code changes.
927
10-
Note: You can check the boxes once you submit, or put an x in the [ ]
11-
12-
like [x]
28+
Note: You can check the boxes once you submit, or put an x in the [ ] like [x]
1329
-->
1430

1531
- [ ] Tests have been added in the prescribed format
16-
- [ ] `CHANGELOG.md` has been updated to reflect changes
17-
- [ ] Version has been updated in `pyproject.toml`
32+
- [ ] Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/) format
33+
- [ ] Pre-commit hooks pass locally

.github/workflows/publish.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: read
10+
id-token: write
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install Python and UV
19+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7
20+
with:
21+
python-version: "3.11"
22+
23+
- name: Build package
24+
run: uv build
25+
26+
- name: Publish to PyPI
27+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: googleapis/release-please-action@c3fc4de07084f75a2b61a5b933069bda6edf3d5c # v4

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,13 @@ repos:
5959
pytest-cov,
6060
]
6161
stages: [pre-commit, manual]
62+
63+
# ============================================================================
64+
# Commit message validation - Conventional Commits
65+
# ============================================================================
66+
- repo: https://github.com/compilerla/conventional-pre-commit
67+
rev: v3.6.0
68+
hooks:
69+
- id: conventional-pre-commit
70+
stages: [commit-msg]
71+
args: []

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.1"
3+
}

README.md

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
## 🎯 DataFrameExpectations
22

3+
![CI](https://github.com/getyourguide/dataframe-expectations/workflows/CI/badge.svg)
4+
![Publish to PyPI](https://github.com/getyourguide/dataframe-expectations/workflows/Publish%20to%20PyPI/badge.svg)
5+
[![PyPI version](https://badge.fury.io/py/dataframe-expectations.svg)](https://badge.fury.io/py/dataframe-expectations)
6+
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
7+
38
**DataFrameExpectations** is a Python library designed to validate **Pandas** and **PySpark** DataFrames using customizable, reusable expectations. It simplifies testing in data pipelines and end-to-end workflows by providing a standardized framework for DataFrame validation.
49

510
Instead of using different validation approaches for DataFrames, this library provides a
611
standardized solution for this use case. As a result, any contributions made here—such as adding new expectations—can be leveraged by all users of the library.
7-
You can find the complete list of expectations [here](docs/build/html/expectations.html).
12+
13+
📚 **[View Documentation](https://code.getyourguide.com/dataframe-expectations/)** | 📋 **[List of Expectations](https://code.getyourguide.com/dataframe-expectations/expectations.html)**
814

915

1016
### Installation:
@@ -106,35 +112,26 @@ Contributions are welcome! You can enhance the library by adding new expectation
106112

107113
### Versioning
108114

109-
This project follows [Semantic Versioning](https://semver.org/) (SemVer):
110-
- **MAJOR** version for incompatible API changes
111-
- **MINOR** version for backward-compatible functionality additions
112-
- **PATCH** version for backward-compatible bug fixes
115+
This project follows [Semantic Versioning](https://semver.org/) (SemVer) and uses [Release Please](https://github.com/googleapis/release-please) for automated version management.
113116

114-
To update the version, manually edit the version field in `pyproject.toml`:
115-
116-
```toml
117-
[project]
118-
version = "0.2.0" # Update this line
119-
```
117+
Versions are automatically determined based on [Conventional Commits](https://www.conventionalcommits.org/):
120118

121-
Alternatively, you can use uv to bump version number:
119+
- `feat:` - New feature → **MINOR** version bump (0.1.0 → 0.2.0)
120+
- `fix:` - Bug fix → **PATCH** version bump (0.1.0 → 0.1.1)
121+
- `feat!:` or `BREAKING CHANGE:` - Breaking change → **MAJOR** version bump (0.1.0 → 1.0.0)
122122

123+
**Example commits:**
123124
```bash
124-
# Bump patch version (0.1.0 -> 0.1.1)
125-
uv version --bump patch
126-
127-
# Bump minor version (0.1.0 -> 0.2.0)
128-
uv version --bump minor
129-
130-
# Bump major version (0.1.0 -> 1.0.0)
131-
uv version --bump major
132-
133-
# Set specific version
134-
uv version 0.2.0
125+
git commit -m "feat: add new expectation for null values"
126+
git commit -m "fix: correct validation logic in expect_value_greater_than"
127+
git commit -m "feat!: remove deprecated API methods"
135128
```
136129

137-
Don't forget to update the [CHANGELOG.md](CHANGELOG.md) file with a detailed description of the changes you've introduced.
130+
When changes are pushed to the main branch, Release Please automatically:
131+
1. Creates or updates a Release PR with version bump and changelog
132+
2. When merged, creates a GitHub Release and publishes to PyPI
133+
134+
No manual version updates needed - just use conventional commit messages!
138135

139136
### Security
140137
For security issues please contact [email protected].

release-please-config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"packages": {
3+
".": {
4+
"release-type": "python",
5+
"package-name": "dataframe-expectations",
6+
"changelog-path": "CHANGELOG.md",
7+
"extra-files": [
8+
{
9+
"type": "toml",
10+
"path": "pyproject.toml",
11+
"jsonpath": "$.project.version"
12+
}
13+
]
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)