Skip to content

Commit 26efa4b

Browse files
committed
make release-tag: Merge branch 'main' into stable
2 parents bee505f + 2a05842 commit 26efa4b

33 files changed

+2248
-281
lines changed

.github/workflows/dependency_checker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4
11-
- name: Set up Python 3.9
11+
- name: Set up latest Python
1212
uses: actions/setup-python@v5
1313
with:
14-
python-version: 3.9
14+
python-version-file: 'pyproject.toml'
1515
- name: Install dependencies
1616
run: |
1717
python -m pip install .[dev]

.github/workflows/lint.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@ on:
55
pull_request:
66
types: [opened, reopened]
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
lint:
1014
runs-on: ubuntu-latest
1115
steps:
1216
- uses: actions/checkout@v4
13-
- name: Set up Python 3.9
17+
- name: Set up latest Python
1418
uses: actions/setup-python@v5
1519
with:
16-
python-version: 3.9
20+
python-version-file: 'pyproject.toml'
1721
- name: Install dependencies
1822
run: |
1923
python -m pip install --upgrade pip

.github/workflows/prepare_release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,22 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v4
22-
- name: Set up Python 3.10
22+
- name: Set up latest Python
2323
uses: actions/setup-python@v5
2424
with:
25-
python-version: '3.10'
25+
python-version-file: 'pyproject.toml'
2626

2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
3030
python -m pip install requests==2.31.0
3131
python -m pip install bandit==1.7.7
32+
python -m pip install packaging
3233
python -m pip install .[test]
3334
35+
- name: Check for prerelease dependencies
36+
run: python scripts/check_for_prereleases.py
37+
3438
- name: Generate release notes
3539
env:
3640
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}

.github/workflows/readme.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
pull_request:
66
types: [opened, reopened]
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
readme:
1014
runs-on: ${{ matrix.os }}

.github/workflows/release.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Release
2+
on:
3+
release:
4+
types: [published]
5+
branches:
6+
- main
7+
- stable
8+
9+
workflow_dispatch:
10+
inputs:
11+
candidate:
12+
description: 'Release candidate.'
13+
required: true
14+
type: boolean
15+
default: true
16+
test_pypi:
17+
description: 'Test PyPI.'
18+
type: boolean
19+
default: false
20+
jobs:
21+
release:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
id-token: write
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
ref: ${{ inputs.candidate && 'main' || 'stable' }}
29+
30+
- name: Set up latest Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version-file: 'pyproject.toml'
34+
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
python -m pip install .[dev]
39+
40+
- name: Create wheel
41+
run: |
42+
make dist
43+
44+
- name: Publish a Python distribution to PyPI
45+
uses: pypa/gh-action-pypi-publish@release/v1
46+
with:
47+
repository-url: ${{ inputs.test_pypi && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' }}
48+
49+
- name: Bump version to next candidate
50+
if: ${{ inputs.candidate && !inputs.test_pypi }}
51+
run: |
52+
git config user.name "github-actions[bot]"
53+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
54+
bump-my-version bump candidate --no-tag --no-commit
55+
56+
- name: Create pull request
57+
if: ${{ inputs.candidate && !inputs.test_pypi }}
58+
id: cpr
59+
uses: peter-evans/create-pull-request@v4
60+
with:
61+
token: ${{ secrets.GH_ACCESS_TOKEN }}
62+
commit-message: bumpversion-candidate
63+
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
64+
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
65+
signoff: false
66+
delete-branch: true
67+
title: Automated Bump Version Candidate
68+
body: "This is an auto-generated PR that bumps the version to the next candidate."
69+
branch: bumpversion-candidate-update
70+
branch-suffix: short-commit-hash
71+
add-paths: |
72+
sdmetrics/__init__.py
73+
pyproject.toml
74+
draft: false
75+
base: main
76+
77+
- name: Enable Pull Request Automerge
78+
if: ${{ steps.cpr.outputs.pull-request-operation == 'created' }}
79+
run: gh pr merge "${{ steps.cpr.outputs.pull-request-number }}" --squash --admin
80+
env:
81+
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}

HISTORY.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# History
22

3+
## v0.22.0 - 2025-07-24
4+
5+
### New Features
6+
7+
* Add a fairness metric that computes Equalized Odds - Issue [#772](https://github.com/sdv-dev/SDMetrics/issues/772) by @fealho
8+
* Add a violin plot visualizations to compare a pair of columns - Issue [#759](https://github.com/sdv-dev/SDMetrics/issues/759) by @R-Palazzo
9+
10+
### Internal
11+
12+
* Fix test failures with pandas 2.3 - Issue [#773](https://github.com/sdv-dev/SDMetrics/issues/773) by @rwedge
13+
* Check pyproject for release candidate dependencies - Issue [#770](https://github.com/sdv-dev/SDMetrics/issues/770) by @rwedge
14+
15+
### Maintenance
16+
17+
* Update python setup step in workflows to use latest python version - Issue [#653](https://github.com/sdv-dev/SDMetrics/issues/653) by @frances-h
18+
19+
### Miscellaneous
20+
21+
* Add workflow to release SDMetrics on PyPI - Issue [#783](https://github.com/sdv-dev/SDMetrics/issues/783) by @gsheni
22+
323
## v0.21.0 - 2025-05-29
424

525
### New Features

Makefile

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ clean-coverage: ## remove coverage artifacts
5555

5656
.PHONY: clean-test
5757
clean-test: ## remove test artifacts
58-
rm -fr .tox/
5958
rm -fr .pytest_cache
6059

6160
.PHONY: clean
@@ -76,6 +75,9 @@ install-test: clean-build clean-pyc ## install the package and test dependencies
7675
install-develop: clean-build clean-pyc ## install the package in editable mode and dependencies for development
7776
pip install -e .[dev]
7877

78+
.PHONY: install-readme
79+
install-readme: clean-build clean-pyc ## install the package in editable mode and readme dependencies for developement
80+
pip install -e .[readme]
7981

8082
# LINT TARGETS
8183

@@ -105,12 +107,8 @@ test-readme: ## run the readme snippets
105107
.PHONY: test
106108
test: test-unit test-integration test-readme ## test everything that needs test dependencies
107109

108-
.PHONY: test-devel
109-
test-devel: lint ## test everything that needs development dependencies
110-
111-
.PHONY: test-all
112-
test-all: ## run tests on every Python version with tox
113-
tox -r
110+
.PHONY: test-repo
111+
test-repo: lint test-unit test-integration test-readme test-performance ## test everything
114112

115113
.PHONY: coverage
116114
coverage: ## check code coverage quickly with the default Python
@@ -142,26 +140,31 @@ publish-test: dist publish-confirm ## package and upload a release on TestPyPI
142140
publish: dist publish-confirm ## package and upload a release
143141
twine upload dist/*
144142

145-
.PHONY: bumpversion-release
146-
bumpversion-release: ## Merge main to stable and bumpversion release
143+
.PHONY: git-merge-main-stable
144+
git-merge-main-stable: ## Merge main into stable
147145
git checkout stable || git checkout -b stable
148146
git merge --no-ff main -m"make release-tag: Merge branch 'main' into stable"
149-
bump-my-version bump release
147+
148+
.PHONY: git-merge-stable-main
149+
git-merge-stable-main: ## Merge stable into main
150+
git checkout main
151+
git merge stable
152+
153+
.PHONY: git-push
154+
git-push: ## Simply push the repository to github
155+
git push
156+
157+
.PHONY: git-push-tags-stable
158+
git-push-tags-stable: ## Push tags and stable to github
150159
git push --tags origin stable
151160

152-
.PHONY: bumpversion-release-test
153-
bumpversion-release-test: ## Merge main to stable and bumpversion release
154-
git checkout stable || git checkout -b stable
155-
git merge --no-ff main -m"make release-tag: Merge branch 'main' into stable"
161+
.PHONY: bumpversion-release
162+
bumpversion-release: ## Bump the version to the next release
156163
bump-my-version bump release --no-tag
157-
@echo git push --tags origin stable
158164

159165
.PHONY: bumpversion-patch
160-
bumpversion-patch: ## Merge stable to main and bumpversion patch
161-
git checkout main
162-
git merge stable
166+
bumpversion-patch: ## Bump the version to the next patch
163167
bump-my-version bump --no-tag patch
164-
git push
165168

166169
.PHONY: bumpversion-candidate
167170
bumpversion-candidate: ## Bump the version to the next candidate
@@ -177,11 +180,13 @@ bumpversion-major: ## Bump the version the next major skipping the release
177180

178181
.PHONY: bumpversion-revert
179182
bumpversion-revert: ## Undo a previous bumpversion-release
183+
git tag --delete $(shell git tag --points-at HEAD)
180184
git checkout main
181185
git branch -D stable
182186

183187
CLEAN_DIR := $(shell git status --short | grep -v ??)
184188
CURRENT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
189+
CURRENT_VERSION := $(shell grep "^current_version" pyproject.toml | grep -o "dev[0-9]*")
185190
CHANGELOG_LINES := $(shell git diff HEAD..origin/stable HISTORY.md 2>&1 | wc -l)
186191

187192
.PHONY: check-clean
@@ -196,6 +201,12 @@ ifneq ($(CURRENT_BRANCH),main)
196201
$(error Please make the release from main branch\n)
197202
endif
198203

204+
.PHONY: check-candidate
205+
check-candidate: ## Check if a release candidate has been made
206+
ifeq ($(CURRENT_VERSION),dev0)
207+
$(error Please make a release candidate and test it before atempting a release)
208+
endif
209+
199210
.PHONY: check-history
200211
check-history: ## Check if HISTORY.md has been modified
201212
ifeq ($(CHANGELOG_LINES),0)
@@ -207,19 +218,16 @@ check-deps: # Dependency targets
207218
$(eval allow_list='numpy=|pandas=|scikit-learn=|scipy=|tqdm=|plotly=|copulas=')
208219
pip freeze | grep -v "SDMetrics.git" | grep -E $(allow_list) | sort > $(OUTPUT_FILEPATH)
209220

210-
.PHONY: git-push
211-
git-push: ## Simply push the repository to github
212-
git push
213-
214221
.PHONY: check-release
215-
check-release: check-clean check-main check-history ## Check if the release can be made
222+
check-release: check-clean check-candidate check-main check-history ## Check if the release can be made
216223
@echo "A new release can be made"
217224

218225
.PHONY: release
219-
release: check-release bumpversion-release publish bumpversion-patch
226+
release: check-release git-merge-main-stable bumpversion-release git-push-tags-stable \
227+
git-merge-stable-main bumpversion-patch git-push
220228

221229
.PHONY: release-test
222-
release-test: check-release bumpversion-release-test publish-test bumpversion-revert
230+
release-test: check-release git-merge-main-stable bumpversion-release bumpversion-revert
223231

224232
.PHONY: release-candidate
225233
release-candidate: check-main publish bumpversion-candidate git-push

0 commit comments

Comments
 (0)