@@ -55,7 +55,6 @@ clean-coverage: ## remove coverage artifacts
5555
5656.PHONY : clean-test
5757clean-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
7675install-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
106108test : 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
116114coverage : # # check code coverage quickly with the default Python
@@ -142,26 +140,31 @@ publish-test: dist publish-confirm ## package and upload a release on TestPyPI
142140publish : 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
167170bumpversion-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
179182bumpversion-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
183187CLEAN_DIR := $(shell git status --short | grep -v ??)
184188CURRENT_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]* ")
185190CHANGELOG_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)
197202endif
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
200211check-history : # # Check if HISTORY.md has been modified
201212ifeq ($(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
225233release-candidate : check-main publish bumpversion-candidate git-push
0 commit comments