Skip to content

Commit

Permalink
maintenance: use tbump for managing version number (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
benbovy authored May 2, 2023
1 parent 26718ae commit 7126a31
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 4 deletions.
1 change: 1 addition & 0 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ dependencies:
- build
- twine
- traittypes
- tbump
2 changes: 1 addition & 1 deletion ipytone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (c) Benoit Bovy.
# Distributed under the terms of the Modified BSD License.

from ._version import __version__, version_info
from ._version import __version__
from .analysis import FFT, Analyser, DCMeter, Follower, Meter, Waveform
from .base import PyAudioNode
from .channel import (
Expand Down
4 changes: 3 additions & 1 deletion ipytone/_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
Information about the frontend package of the widgets.
"""

from ._version import __version__

module_name = "ipytone"
module_version = "^0.5.1"
module_version = f"^{__version__}"
3 changes: 1 addition & 2 deletions ipytone/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
# Copyright (c) Benoit Bovy.
# Distributed under the terms of the Modified BSD License.

version_info = (0, 5, 1)
__version__ = ".".join(map(str, version_info))
__version__ = "0.5.1"
7 changes: 7 additions & 0 deletions ipytone/tests/test_frontend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import ipytone
from ipytone._frontend import module_name, module_version


def test_frontend():
assert module_name == "ipytone"
assert module_version == f"^{ipytone.__version__}"
25 changes: 25 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,28 @@ known-third-party=[
"ipywidgets",
"traitlets",
]

[tool.tbump]
field = [
{ name = "channel", default = "" },
{ name = "release", default = "" },
]

[tool.tbump.git]
message_template = "release {new_version}"
tag_template = "{new_version}"

[[tool.tbump.file]]
src = "pyproject.toml"
version_template = "version = \"{major}.{minor}.{patch}{channel}{release}\""

[[tool.tbump.file]]
src = "ipytone/_version.py"

[[tool.tbump.file]]
src = "package.json"
version_template = "\"version\": \"{major}.{minor}.{patch}{channel}{release}\""

[tool.tbump.version]
current = "0.5.1"
regex = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)((?P<channel>a|b|rc|.dev)(?P<release>\\d+))?"

0 comments on commit 7126a31

Please sign in to comment.