Skip to content

Commit

Permalink
Remove bumpversion and use bump-my-version (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
frances-h authored Mar 6, 2024
1 parent 0c42168 commit faca985
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 49 deletions.
12 changes: 0 additions & 12 deletions MANIFEST.in

This file was deleted.

12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
55 changes: 53 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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',
Expand All @@ -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
Expand Down Expand Up @@ -132,7 +135,55 @@ add-ignore = ['D107', 'D407', 'D417']

[tool.setuptools]
include-package-data = true
license-files = ['LICENSE']

[tool.setuptools.packages.find]
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
tag = true
parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<candidate>\d+))?'
serialize = [
'{major}.{minor}.{patch}.{release}{candidate}',
'{major}.{minor}.{patch}'
]

[tool.bumpversion.parts.release]
optional_value = 'release'
values = [
'dev',
'release'
]

[[tool.bumpversion.files]]
filename = 'copulas/__init__.py'
search = "__version__ = '{current_version}'"
replace = "__version__ = '{new_version}'"

29 changes: 0 additions & 29 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,32 +1,3 @@
[bumpversion]
current_version = 0.10.1.dev0
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<candidate>\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

[flake8]
max-line-length = 99
exclude = docs, .git, __pycache__, .ipynb_checkpoints
Expand Down

0 comments on commit faca985

Please sign in to comment.