From 117318d210b5cce8770a494f17ceabc9df5362ba Mon Sep 17 00:00:00 2001 From: Frances Hartwell Date: Tue, 5 Mar 2024 08:28:19 -0700 Subject: [PATCH 1/5] use bump-my-version instead of bumpversion --- Makefile | 10 +++++----- pyproject.toml | 37 +++++++++++++++++++++++++++++++++++-- setup.cfg | 26 -------------------------- 3 files changed, 40 insertions(+), 33 deletions(-) diff --git a/Makefile b/Makefile index c37b7307..5885ee74 100644 --- a/Makefile +++ b/Makefile @@ -196,23 +196,23 @@ git-push-tags-stable: ## Push tags and stable to github .PHONY: bumpversion-release bumpversion-release: ## Bump the version to the next release - bumpversion release + bump-my-version bump release .PHONY: bumpversion-patch bumpversion-patch: ## Bump the version to the next patch - bumpversion --no-tag patch + bump-my-version bump patch --no-tag .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 minor --no-tag .PHONY: bumpversion-major bumpversion-major: ## Bump the version the next major skipping the release - bumpversion --no-tag major + bump-my-version bump major --no-tag .PHONY: bumpversion-revert bumpversion-revert: ## Undo a previous bumpversion-release diff --git a/pyproject.toml b/pyproject.toml index 413576f9..e037a3d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ classifiers = [ 'Topic :: Scientific/Engineering :: Artificial Intelligence', ] keywords = [ 'copulas' ] -version = '0.10.1.dev0' +dynamic = ["version"] license = { text = 'BSL-1.1' } requires-python = '>=3.8,<3.12' readme = 'README.md' @@ -41,6 +41,9 @@ dependencies = [ requires = ['setuptools', 'wheel'] build-backend = 'setuptools.build_meta' +[tool.setuptools.dynamic] +version = {attr = 'copulas.__version__'} + [project.optional-dependencies] tutorials = [ 'markupsafe<=2.0.1', @@ -60,7 +63,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', # docs @@ -136,3 +139,33 @@ include-package-data = true [tool.setuptools.packages.find] include = ['copulas', 'copulas.*'] namespaces = false + +[tool.bumpversion] +current_version = "0.10.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}' +] + +[tool.bumpversion.parts.release] +optional_value = 'release' +values = [ + 'dev', + 'release' +] + +[tool.bumpversion.parts.candidate] + +[[tool.bumpversion.files]] +filename = 'pyproject.toml' +search = 'current_version = "{current_version}"' +replace = 'current_version = "{new_version}"' + +[[tool.bumpversion.files]] +filename = 'copulas/__init__.py' +search = "__version__ = '{current_version}'" +replace = "__version__ = '{new_version}'" + diff --git a/setup.cfg b/setup.cfg index 555d6304..30188a3e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,29 +1,3 @@ -[bumpversion] -current_version = 0.10.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:copulas/__init__.py] -search = __version__ = '{current_version}' -replace = __version__ = '{new_version}' - [bdist_wheel] universal = 1 From ffdfee1dcb4cf77acff7c189ba1e2472d05bed4a Mon Sep 17 00:00:00 2001 From: Frances Hartwell Date: Tue, 5 Mar 2024 08:45:32 -0700 Subject: [PATCH 2/5] include license-files --- pyproject.toml | 1 + setup.cfg | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e037a3d6..e5e79bf5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -135,6 +135,7 @@ add-ignore = ['D107', 'D407', 'D417'] [tool.setuptools] include-package-data = true +license-files = ['LICENSE'] [tool.setuptools.packages.find] include = ['copulas', 'copulas.*'] diff --git a/setup.cfg b/setup.cfg index 30188a3e..92037528 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,3 @@ -[bdist_wheel] -universal = 1 - [flake8] max-line-length = 99 exclude = docs, .git, __pycache__, .ipynb_checkpoints From 903aee6fb4c1fe202eee96a27117f839b5422bde Mon Sep 17 00:00:00 2001 From: Frances Hartwell Date: Tue, 5 Mar 2024 10:51:09 -0700 Subject: [PATCH 3/5] remove pyproject.toml file specific option --- pyproject.toml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e5e79bf5..f2be86a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -158,13 +158,6 @@ values = [ 'release' ] -[tool.bumpversion.parts.candidate] - -[[tool.bumpversion.files]] -filename = 'pyproject.toml' -search = 'current_version = "{current_version}"' -replace = 'current_version = "{new_version}"' - [[tool.bumpversion.files]] filename = 'copulas/__init__.py' search = "__version__ = '{current_version}'" From 65f1a8d775fc3fdd70cd74453c4015d8be20a16a Mon Sep 17 00:00:00 2001 From: Frances Hartwell Date: Wed, 6 Mar 2024 07:52:41 -0700 Subject: [PATCH 4/5] remove MANIFEST.in --- MANIFEST.in | 12 ------------ pyproject.toml | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 12 deletions(-) delete mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 71824594..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,12 +0,0 @@ -include AUTHORS.rst -include CONTRIBUTING.rst -include HISTORY.md -include LICENSE -include README.md -include RELEASE.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/pyproject.toml b/pyproject.toml index f2be86a2..c82d4656 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -141,6 +141,30 @@ license-files = ['LICENSE'] include = ['copulas', 'copulas.*'] namespaces = false +[tool.setuptools.package-data] +'*' = [ + 'AUTHORS.rst', + 'CONTRIBUTING.rst', + 'HISTORY.md', + 'README.md', + 'RELEASE.md', + '*.md', + '*.rst', + 'conf.py', + 'Makefile', + 'make.bat', + '*.jpg', + '*.png', + '*.gif' +] +'tests' = ['*'] + +[tool.setuptools.exclude-package-data] +'*' = [ + '* __pycache__', + '*.py[co]', +] + [tool.bumpversion] current_version = "0.10.1.dev0" commit = true From 2dc28b1eb4331813afd0e95cc6376d78fe320fa1 Mon Sep 17 00:00:00 2001 From: Frances Hartwell Date: Wed, 6 Mar 2024 08:20:15 -0700 Subject: [PATCH 5/5] update MAKEFILE to point to pyproject.toml --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5885ee74..b6e790df 100644 --- a/Makefile +++ b/Makefile @@ -222,7 +222,7 @@ bumpversion-revert: ## Undo a previous bumpversion-release CLEAN_DIR := $(shell git status --short | grep -v ??) CURRENT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null) -CURRENT_VERSION := $(shell grep "^current_version" setup.cfg | grep -o "dev[0-9]*") +CURRENT_VERSION := $(shell grep "^current_version" pyproject.toml | grep -o "dev[0-9]*") CHANGELOG_LINES := $(shell git diff HEAD..origin/stable HISTORY.md 2>&1 | wc -l) .PHONY: check-clean