Skip to content

Commit 8225690

Browse files
committed
use static by default
1 parent 7bdc292 commit 8225690

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

jupyter_releaser/tests/test_functions.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,20 @@ def test_get_repo(git_repo, mocker):
2626

2727

2828
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")
3529
assert util.get_version() == "0.0.1"
30+
util.bump_version("0.0.2a0")
31+
assert util.get_version() == "0.0.2a0"
3632

3733

3834
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]\nversion = "0.0.1\"""", "")
38+
py_project.write_text(text, encoding="utf-8")
3939
assert util.get_version() == "0.0.1"
4040

4141

4242
def test_get_version_setuppy(py_package):
43-
util.PYPROJECT.unlink()
4443
assert util.get_version() == "0.0.1"
4544
util.bump_version("0.0.2a0")
4645
assert util.get_version() == "0.0.2a0"

jupyter_releaser/tests/util.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ def pyproject_template(sub_packages=[]):
8585
[build-system]
8686
requires = ["setuptools>=40.8.0", "wheel"]
8787
build-backend = "setuptools.build_meta"
88+
89+
[project]
90+
version = "0.0.1"
8891
"""
8992
if sub_packages:
9093
res += f"""
@@ -115,6 +118,9 @@ def tbump_py_template(package_name="foo"):
115118
return f"""
116119
[[file]]
117120
src = "{package_name}.py"
121+
122+
[[file]]
123+
src = "pyproject.toml"
118124
"""
119125

120126

0 commit comments

Comments
 (0)