1
0
mirror of https://github.com/MousaZeidBaker/poetry-plugin-up.git synced 2025-10-05 21:32:40 +02:00

fix: Path.write_text does not have newline kwarg in 3.9

This commit is contained in:
Jan-Eric Nitschke
2025-01-12 17:14:36 +01:00
parent 0e085e0d94
commit 7b7955a946
2 changed files with 14 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "poetry-plugin-up"
version = "0.9.0"
version = "0.8.0"
description = "Poetry plugin that updates dependencies and bumps their versions in pyproject.toml file"
authors = ["Mousa Zeid Baker"]
packages = [

View File

@@ -1,3 +1,4 @@
import sys
from pathlib import Path
from typing import List
@@ -48,7 +49,12 @@ def tmp_pyproject_path(
tmp_pyproject_path = (
tmp_path_factory.mktemp("simple_project") / "pyproject.toml"
)
tmp_pyproject_path.write_text(pyproject_content.as_string(), newline="\n")
if sys.version_info >= (3, 10):
tmp_pyproject_path.write_text(
pyproject_content.as_string(), newline="\n"
)
else:
tmp_pyproject_path.write_text(pyproject_content.as_string())
return tmp_pyproject_path
@@ -78,9 +84,12 @@ def tmp_pyproject_path_v2(
tmp_pyproject_path = (
tmp_path_factory.mktemp("simple_project_poetry_v2") / "pyproject.toml"
)
tmp_pyproject_path.write_text(
pyproject_content_v2.as_string(), newline="\n"
)
if sys.version_info >= (3, 10):
tmp_pyproject_path.write_text(
pyproject_content_v2.as_string(), newline="\n"
)
else:
tmp_pyproject_path.write_text(pyproject_content_v2.as_string())
return tmp_pyproject_path