From 5a346fa9f0e854dab3f211d88f48b47bbd2c8a06 Mon Sep 17 00:00:00 2001 From: R-Palazzo <116157184+R-Palazzo@users.noreply.github.com> Date: Wed, 6 Mar 2024 17:23:00 +0000 Subject: [PATCH] Remove bumpversion and use bump-my-version (#340) --- MANIFEST.in | 11 -------- Makefile | 12 ++++----- pyproject.toml | 72 +++++++++++++++++++++++++++++++++++++++++++++----- setup.cfg | 29 -------------------- 4 files changed, 72 insertions(+), 52 deletions(-) delete mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 469520f5..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,11 +0,0 @@ -include AUTHORS.rst -include CONTRIBUTING.rst -include HISTORY.md -include LICENSE -include README.md - -recursive-include tests * -recursive-exclude * __pycache__ -recursive-exclude * *.py[co] - -recursive-include docs *.md *.rst conf.py Makefile make.bat *.jpg *.png *.gif diff --git a/Makefile b/Makefile index 3854b885..6b3c0a8d 100644 --- a/Makefile +++ b/Makefile @@ -153,34 +153,34 @@ publish: dist publish-confirm ## package and upload a release bumpversion-release: ## Merge main to stable and bumpversion release git checkout stable || git checkout -b stable git merge --no-ff main -m"make release-tag: Merge branch 'main' into stable" - bumpversion release + bump-my-version bump release git push --tags origin stable .PHONY: bumpversion-release-test bumpversion-release-test: ## Merge main to stable and bumpversion release git checkout stable || git checkout -b stable git merge --no-ff main -m"make release-tag: Merge branch 'main' into stable" - bumpversion release --no-tag + bump-my-version bump release --no-tag @echo git push --tags origin stable .PHONY: bumpversion-patch bumpversion-patch: ## Merge stable to main and bumpversion patch git checkout main git merge stable - bumpversion --no-tag patch + bump-my-version bump --no-tag patch git push .PHONY: bumpversion-candidate bumpversion-candidate: ## Bump the version to the next candidate - bumpversion candidate --no-tag + bump-my-version bump candidate --no-tag .PHONY: bumpversion-minor bumpversion-minor: ## Bump the version the next minor skipping the release - bumpversion --no-tag minor + bump-my-version bump --no-tag minor .PHONY: bumpversion-major bumpversion-major: ## Bump the version the next major skipping the release - bumpversion --no-tag major + bump-my-version bump --no-tag major .PHONY: bumpversion-revert bumpversion-revert: ## Undo a previous bumpversion-release diff --git a/pyproject.toml b/pyproject.toml index ffe9cf07..825cca34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,3 @@ -[build-system] -requires = ['setuptools', 'wheel'] -build-backend = 'setuptools.build_meta' - [project] name = 'ctgan' description = 'Create tabular synthetic data using a conditional GAN' @@ -19,7 +15,7 @@ classifiers = [ 'Topic :: Scientific/Engineering :: Artificial Intelligence', ] keywords = ['ctgan', 'CTGAN'] -version = '0.9.1.dev0' +dynamic = ['version'] license = { text = 'BSL-1.1' } requires-python = '>=3.8,<3.12' readme = 'README.md' @@ -62,7 +58,7 @@ dev = [ # general 'pip>=9.0.1', - 'bumpversion>=0.5.3,<0.6', + 'bump-my-version>=0.18.3,<1', 'watchdog>=0.8.3,<0.11', # style check @@ -105,11 +101,38 @@ dev = [ [tool.setuptools] include-package-data = true +license-files = ['LICENSE'] [tool.setuptools.packages.find] include = ['ctgan', 'ctgan.*'] namespaces = false +[tool.setuptools.package-data] +'*' = [ + 'AUTHORS.rst', + 'CONTRIBUTING.rst', + 'HISTORY.md', + 'README.md', + '*.md', + '*.rst', + 'conf.py', + 'Makefile', + 'make.bat', + '*.jpg', + '*.png', + '*.gif' +] +'tests' = ['*'] + +[tool.setuptools.exclude-package-data] +'*' = [ + '* __pycache__', + '*.py[co]', +] + +[tool.setuptools.dynamic] +version = {attr = 'ctgan.__version__'} + [tool.isort] include_trailing_comment = true line_length = 99 @@ -124,3 +147,40 @@ add-ignore = ['D107', 'D407', 'D417'] [tool.pytest.ini_options] collect_ignore = ['pyproject.toml'] + +[tool.bumpversion] +current_version = '0.9.1.dev0' +parse = '(?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P[a-z]+)(?P\d+))?' +serialize = [ + '{major}.{minor}.{patch}.{release}{candidate}', + '{major}.{minor}.{patch}' +] +search = '{current_version}' +replace = '{new_version}' +regex = false +ignore_missing_version = false +tag = true +sign_tags = false +tag_name = 'v{new_version}' +tag_message = 'Bump version: {current_version} → {new_version}' +allow_dirty = false +commit = true +message = 'Bump version: {current_version} → {new_version}' +commit_args = '' + +[tool.bumpversion.parts.release] +first_value = 'dev' +optional_value = 'release' +values = [ + 'dev', + 'release' +] + +[[tool.bumpversion.files]] +filename = "ctgan/__init__.py" +search = "__version__ = '{current_version}'" +replace = "__version__ = '{new_version}'" + +[build-system] +requires = ['setuptools', 'wheel'] +build-backend = 'setuptools.build_meta' diff --git a/setup.cfg b/setup.cfg index 0b264aa1..6f3fc634 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,32 +1,3 @@ -[bumpversion] -current_version = 0.9.1.dev0 -commit = True -tag = True -parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P[a-z]+)(?P\d+))? -serialize = - {major}.{minor}.{patch}.{release}{candidate} - {major}.{minor}.{patch} - -[bumpversion:part:release] -optional_value = release -first_value = dev -values = - dev - release - -[bumpversion:part:candidate] - -[bumpversion:file:pyproject.toml] -search = version='{current_version}' -replace = version='{new_version}' - -[bumpversion:file:ctgan/__init__.py] -search = __version__ = '{current_version}' -replace = __version__ = '{new_version}' - -[bdist_wheel] -universal = 1 - [flake8] convention = google max-line-length = 99