Skip to content

Commit

Permalink
Bump to 0.6.3 (#772)
Browse files Browse the repository at this point in the history
  • Loading branch information
tushuhei authored Oct 22, 2024
1 parent f8c99b7 commit 27fd3bb
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 6 deletions.
2 changes: 1 addition & 1 deletion budoux/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from . import parser

__version__ = "0.6.2"
__version__ = "0.6.3"

Parser = parser.Parser
load_default_japanese_parser = parser.load_default_japanese_parser
Expand Down
57 changes: 57 additions & 0 deletions bump_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import argparse
import re
import subprocess


def main():
parser = argparse.ArgumentParser(description='Bump the version number.')
parser.add_argument(
'new_version', type=str, help='The new version number (e.g., 1.2.3)')
args = parser.parse_args()
new_version = args.new_version

# Updates Python port version number
init_file = 'budoux/__init__.py'
with open(init_file, 'r') as f:
content = f.read()
new_content = re.sub(r'(__version__\s+=\s+[\'"])([\.\d]+)([\'"])',
rf'\g<1>{new_version}\g<3>', content)
with open(init_file, 'w') as f:
f.write(new_content)

# Updates JavaScript port version number
npm_command = ['npm', 'version', new_version, '--no-git-tag-version']
subprocess.run(npm_command, cwd='javascript', check=True)

cli_file = 'javascript/src/cli.ts'
with open(cli_file, 'r') as f:
content = f.read()
new_content = re.sub(r'(const\s+CLI_VERSION\s+=\s+[\'"])([\.\d]+)([\'"])',
rf'\g<1>{new_version}\g<3>', content)
with open(cli_file, 'w') as f:
f.write(new_content)

# Updates Java port version number
mvn_command = [
'mvn', 'versions:set', f'-DnewVersion={new_version}',
'-DgenerateBackupPoms=false'
]
subprocess.run(mvn_command, cwd='java', check=True)


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<groupId>com.google.budoux</groupId>
<artifactId>budoux</artifactId>
<version>0.6.2</version>
<version>0.6.3</version>

<name>BudouX</name>
<url>https://google.github.io/budoux/</url>
Expand Down
4 changes: 2 additions & 2 deletions javascript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "budoux",
"version": "0.6.2",
"version": "0.6.3",
"description": "A small chunk segmenter.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion javascript/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
loadDefaultJapaneseParser,
} from './index.js';

const CLI_VERSION = '0.6.2';
const CLI_VERSION = '0.6.3';
const defaultParsers = loadDefaultParsers();

/**
Expand Down

0 comments on commit 27fd3bb

Please sign in to comment.