Skip to content

Commit

Permalink
Move from bump2version to bump-my-version
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
  • Loading branch information
timkpaine committed Jul 9, 2024
1 parent a198332 commit d1ece9e
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 33 deletions.
21 changes: 0 additions & 21 deletions .bumpversion.cfg

This file was deleted.

1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @robambalu @AdamGlustein @svatasoiu @alexddobkin

# Packaging code
.bumpversion.cfg @robambalu @AdamGlustein @svatasoiu @alexddobkin @ptomecek @timkpaine @czgdp1807
conda @robambalu @AdamGlustein @svatasoiu @alexddobkin @ptomecek @timkpaine @czgdp1807
CMakeLists.txt @robambalu @AdamGlustein @svatasoiu @alexddobkin @ptomecek @timkpaine @czgdp1807
Makefile @robambalu @AdamGlustein @svatasoiu @alexddobkin @ptomecek @timkpaine @czgdp1807
Expand Down
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ updates:
directory: "/"
schedule:
interval: "weekly"
labels:
- "part: github_actions"

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "monthly"
labels:
- "lang: python"
- "part: dependencies"
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,16 @@ dockerdown: ## spin up docker compose services for adapter testing
.PHONY: show-version patch minor major

show-version:
@ bump2version --dry-run --allow-dirty pyproject.toml --list | grep current | awk -F= '{print $$2}'
@ bump-my-version show current_version

patch:
bump2version patch
bump-my-version bump patch

minor:
bump2version minor
bump-my-version bump minor

major:
bump2version major
bump-my-version bump major

########
# DIST #
Expand Down
2 changes: 1 addition & 1 deletion conda/dev-environment-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- bison
- brotli
- build
- bump2version>=1
- bump-my-version
- cmake
- codespell>=2.2.6,<2.3
- compilers
Expand Down
2 changes: 1 addition & 1 deletion conda/dev-environment-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
dependencies:
- brotli
- build
- bump2version>=1
- bump-my-version
- cmake
- codespell>=2.2.6,<2.3
- compilers
Expand Down
8 changes: 4 additions & 4 deletions docs/wiki/dev-guides/Release-Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ your users.
### Preparing and tagging a release

Follow these steps when it's time to tag a new release. Before doing
this, you will need to ensure `bump2version` is installed into your
this, you will need to ensure `bump-my-version` is installed into your
development environment.

> \[!NOTE\]
Expand All @@ -89,7 +89,7 @@ development environment.
```

1. Make a branch and update version numbers in your local clone using
the `bump2version` integration in the Makefile.
the `bump-my-version` integration in the Makefile.

First, make a branch that will be pushed to the main `csp`
repository. Using a name like `release/v0.3.4` should avoid any
Expand All @@ -99,7 +99,7 @@ development environment.
git checkout -b release/v0.x.x
```

You can update the version number in the codebase using `bump2version`. For a
You can update the version number in the codebase using `bump-my-version`. For a
bugfix release, you would do:

```bash
Expand Down Expand Up @@ -127,7 +127,7 @@ development environment.

1. Tag the release

Use the version number `bump2version` generated and make sure the
Use the version number `bump-my-version` generated and make sure the
tag name begins with a `v`.

```bash
Expand Down
28 changes: 27 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Tracker = "https://github.com/point72/csp/issues"
[project.optional-dependencies]
develop = [
# build/dist
"bump2version>=1.0.0",
"bump-my-version",
"build",
"ruamel.yaml",
"scikit-build",
Expand Down Expand Up @@ -109,6 +109,32 @@ slack = [
"slack-sdk>=3",
]

[tool.bumpversion]
current_version = "0.0.5"
commit = false
tag = false
commit_args = "-s"

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

[[tool.bumpversion.files]]
filename = "setup.py"
search = 'version="{current_version}"'
replace = 'version="{new_version}"'

[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "CMakeLists.txt"
search = 'project(csp VERSION "{current_version}")'
replace = 'project(csp VERSION "{new_version}")'

[tool.check-manifest]
ignore = []

Expand Down

0 comments on commit d1ece9e

Please sign in to comment.