Skip to content

Commit 78d0b5b

Browse files
committed
Bump version from 0.7.0a2 to 0.7.0a3
1 parent dd7661a commit 78d0b5b

File tree

5 files changed

+50
-5
lines changed

5 files changed

+50
-5
lines changed

bin/bump_version.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env python
2+
3+
filenames_default = [
4+
"pyproject.toml",
5+
"src/flint/__init__.py",
6+
"doc/source/conf.py",
7+
"src/flint/test/test_all.py",
8+
]
9+
10+
def main(version2=None, *filenames):
11+
"""Bump version number in files.
12+
13+
$ bin/bump_version.py
14+
Current version: 0.1.0
15+
16+
$ bin/bump_version.py 0.1.0 0.1.1
17+
Set version 0.1.0 to 0.1.1 in:
18+
pyproject.toml
19+
src/flint/__init__.py
20+
doc/source/conf.py
21+
src/flint/test/test_all.py
22+
23+
"""
24+
with open("pyproject.toml", "r") as f:
25+
text = f.read()
26+
version1 = text.split("version = \"")[1].split("\"")[0]
27+
28+
if not version2:
29+
print(f"Current version: {version1}")
30+
return
31+
32+
if not filenames:
33+
filenames = filenames_default
34+
35+
print(f"Set version {version1} to {version2} in:")
36+
for filename in filenames:
37+
print(filename)
38+
with open(filename, "r") as f:
39+
text = f.read()
40+
with open(filename, "w") as f:
41+
f.write(text.replace(version1, version2))
42+
43+
if __name__ == "__main__":
44+
import sys
45+
main(*sys.argv[1:])

doc/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
# built documents.
5252
#
5353
# The short X.Y version.
54-
version = '0.7.0a2'
54+
version = '0.7.0a3'
5555
# The full version, including alpha/beta/rc tags.
56-
release = '0.7.0a2'
56+
release = '0.7.0a3'
5757

5858
# The language for content autogenerated by Sphinx. Refer to documentation
5959
# for a list of supported languages.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "mesonpy"
55
[project]
66
name = "python-flint"
77
description = "Bindings for FLINT and Arb"
8-
version = "0.7.0a2"
8+
version = "0.7.0a3"
99
urls = {Homepage = "https://github.com/flintlib/python-flint"}
1010
authors = [
1111
{name = "Fredrik Johansson", email = "[email protected]"},

src/flint/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@
4343
Ordering,
4444
)
4545

46-
__version__ = '0.7.0a2'
46+
__version__ = '0.7.0a3'

src/flint/test/test_all.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def raises(f, exception):
3232

3333
def test_pyflint():
3434

35-
assert flint.__version__ == "0.7.0a2"
35+
assert flint.__version__ == "0.7.0a3"
3636

3737
ctx = flint.ctx
3838
assert str(ctx) == repr(ctx) == _default_ctx_string

0 commit comments

Comments
 (0)