File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -26,21 +26,20 @@ def test_get_repo(git_repo, mocker):
26
26
27
27
28
28
def test_get_version_pyproject_static (py_package ):
29
- text = util .PYPROJECT .read_text (encoding = "utf-8" )
30
- text += """
31
- [project]
32
- version = "0.0.1"
33
- """
34
- util .PYPROJECT .write_text (text , encoding = "utf-8" )
35
29
assert util .get_version () == "0.0.1"
30
+ util .bump_version ("0.0.2a0" )
31
+ assert util .get_version () == "0.0.2a0"
36
32
37
33
38
34
def test_get_version_pyproject_dynamic (py_package ):
35
+ py_project = py_package / "pyproject.toml"
36
+ text = py_project .read_text (encoding = "utf-8" )
37
+ text = text .replace ("""[project]\n version = "0.0.1\" """ , "" )
38
+ py_project .write_text (text , encoding = "utf-8" )
39
39
assert util .get_version () == "0.0.1"
40
40
41
41
42
42
def test_get_version_setuppy (py_package ):
43
- util .PYPROJECT .unlink ()
44
43
assert util .get_version () == "0.0.1"
45
44
util .bump_version ("0.0.2a0" )
46
45
assert util .get_version () == "0.0.2a0"
Original file line number Diff line number Diff line change @@ -85,6 +85,9 @@ def pyproject_template(sub_packages=[]):
85
85
[build-system]
86
86
requires = ["setuptools>=40.8.0", "wheel"]
87
87
build-backend = "setuptools.build_meta"
88
+
89
+ [project]
90
+ version = "0.0.1"
88
91
"""
89
92
if sub_packages :
90
93
res += f"""
@@ -115,6 +118,9 @@ def tbump_py_template(package_name="foo"):
115
118
return f"""
116
119
[[file]]
117
120
src = "{ package_name } .py"
121
+
122
+ [[file]]
123
+ src = "pyproject.toml"
118
124
"""
119
125
120
126
You can’t perform that action at this time.
0 commit comments