@@ -76,6 +76,9 @@ install-test: clean-build clean-pyc ## install the package and test dependencies
7676install-develop : clean-build clean-pyc # # install the package in editable mode and dependencies for development
7777 pip install -e .[dev]
7878
79+ .PHONY : install-readme
80+ install-readme : clean-build clean-pyc # # install the package in editable mode and readme dependencies for developement
81+ pip install -e .[readme]
7982
8083# LINT TARGETS
8184
8790fix-lint :
8891 invoke fix-lint
8992
90-
9193# TEST TARGETS
9294
9395.PHONY : test-unit
@@ -112,10 +114,6 @@ test: test-unit test-integration test-readme ## test everything that needs test
112114.PHONY : test-devel
113115test-devel : lint # # test everything that needs development dependencies
114116
115- .PHONY : test-all
116- test-all : # # run tests on every Python version with tox
117- tox -r
118-
119117
120118.PHONY : coverage
121119coverage : # # check code coverage quickly with the default Python
@@ -147,26 +145,31 @@ publish-test: dist publish-confirm ## package and upload a release on TestPyPI
147145publish : dist publish-confirm # # package and upload a release
148146 twine upload dist/*
149147
150- .PHONY : bumpversion-release
151- bumpversion-release : # # Merge main to stable and bumpversion release
148+ .PHONY : git-merge-main-stable
149+ git-merge-main-stable : # # Merge main into stable
152150 git checkout stable || git checkout -b stable
153151 git merge --no-ff main -m" make release-tag: Merge branch 'main' into stable"
154- bump-my-version bump release
152+
153+ .PHONY : git-merge-stable-main
154+ git-merge-stable-main : # # Merge stable into main
155+ git checkout main
156+ git merge stable
157+
158+ .PHONY : git-push
159+ git-push : # # Simply push the repository to github
160+ git push
161+
162+ .PHONY : git-push-tags-stable
163+ git-push-tags-stable : # # Push tags and stable to github
155164 git push --tags origin stable
156165
157- .PHONY : bumpversion-release-test
158- bumpversion-release-test : # # Merge main to stable and bumpversion release
159- git checkout stable || git checkout -b stable
160- git merge --no-ff main -m" make release-tag: Merge branch 'main' into stable"
166+ .PHONY : bumpversion-release
167+ bumpversion-release : # # Bump the version to the next release
161168 bump-my-version bump release --no-tag
162- @echo git push --tags origin stable
163169
164170.PHONY : bumpversion-patch
165- bumpversion-patch : # # Merge stable to main and bumpversion patch
166- git checkout main
167- git merge stable
171+ bumpversion-patch : # # Bump the version to the next patch
168172 bump-my-version bump --no-tag patch
169- git push
170173
171174.PHONY : bumpversion-candidate
172175bumpversion-candidate : # # Bump the version to the next candidate
@@ -182,11 +185,13 @@ bumpversion-major: ## Bump the version the next major skipping the release
182185
183186.PHONY : bumpversion-revert
184187bumpversion-revert : # # Undo a previous bumpversion-release
188+ git tag --delete $(shell git tag --points-at HEAD)
185189 git checkout main
186190 git branch -D stable
187191
188192CLEAN_DIR := $(shell git status --short | grep -v ??)
189193CURRENT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
194+ CURRENT_VERSION := $(shell grep "^current_version" pyproject.toml | grep -o "dev[0-9]* ")
190195CHANGELOG_LINES := $(shell git diff HEAD..origin/stable HISTORY.md 2>&1 | wc -l)
191196
192197.PHONY : check-clean
@@ -201,41 +206,36 @@ ifneq ($(CURRENT_BRANCH),main)
201206 $(error Please make the release from main branch\n)
202207endif
203208
209+ .PHONY : check-candidate
210+ check-candidate : # # Check if a release candidate has been made
211+ ifeq ($(CURRENT_VERSION ) ,dev0)
212+ $(error Please make a release candidate and test it before atempting a release)
213+ endif
214+
204215.PHONY : check-history
205216check-history : # # Check if HISTORY.md has been modified
206217ifeq ($(CHANGELOG_LINES ) ,0)
207218 $(error Please insert the release notes in HISTORY.md before releasing)
208219endif
209220
210- .PHONY : git-push
211- git-push : # # Simply push the repository to github
212- git push
221+ .PHONY : check-deps
222+ check-deps : # Dependency targets
223+ $(eval allow_list='numpy=|pandas=|tqdm=|torch=|rdt=')
224+ pip freeze | grep -v " CTGAN.git" | grep -E $(allow_list ) > $(OUTPUT_FILEPATH )
213225
214226.PHONY : check-release
215- check-release : check-clean check-main check-history # # Check if the release can be made
227+ check-release : check-clean check-candidate check- main check-history # # Check if the release can be made
216228 @echo " A new release can be made"
217229
218230.PHONY : release
219- release : check-release bumpversion-release publish bumpversion-patch
231+ release : check-release git-merge-main-stable bumpversion-release git-push-tags-stable \
232+ git-merge-stable-main bumpversion-patch git-push
220233
221234.PHONY : release-test
222- release-test : check-release bumpversion-release-test publish-test bumpversion-revert
235+ release-test : check-release git-merge-main-stable bumpversion-release bumpversion-revert
223236
224237.PHONY : release-candidate
225238release-candidate : check-main publish bumpversion-candidate git-push
226239
227240.PHONY : release-candidate-test
228- release-candidate-test : check-clean check-main publish-test
229-
230- .PHONY : release-minor
231- release-minor : check-release bumpversion-minor release
232-
233- .PHONY : release-major
234- release-major : check-release bumpversion-major release
235-
236- # Dependency targets
237-
238- .PHONY : check-deps
239- check-deps :
240- $(eval allow_list='numpy=|pandas=|tqdm=|torch=|rdt=')
241- pip freeze | grep -v " CTGAN.git" | grep -E $(allow_list ) > $(OUTPUT_FILEPATH )
241+ release-candidate-test : check-clean check-main publish-test
0 commit comments