1 Commits

Author SHA1 Message Date
b91b781a65 JSONs menschenlesbar formatieren.
Some checks failed
run tests / test-is-not-yet-released (pull_request) Failing after 6s
run tests / test-skip-release-if-already-released (pull_request) Failing after 9s
run tests / test-declare-with-release-yaml (pull_request) Failing after 11s
run tests / test-declare-directly (pull_request) Failing after 13s
run tests / unittest (pull_request) Successful in 31s
check if project is already released / unittest (pull_request) Successful in 33s
run tests / test-declare-default (pull_request) Successful in 30s
run tests / test-sync-versions (pull_request) Successful in 35s
run tests / check (push) Successful in 37s
run tests / release (push) Successful in 21s
2026-03-16 10:59:43 +01:00
3 changed files with 23 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
[project]
name = "gitea-release-action"
version = "0.0.1"
version = "1.0.0"
description = "reusable action for release workflows"
authors = [ ]
requires-python = ">=3.13"

View File

@@ -57,6 +57,14 @@ class TestPackageJson(TestCase):
def test_can_write_version(self):
_test_can_write_version(self, 'package.json')
def test_write_version_multiline(self):
v = use_any(_asset_path('package.json'))
v.version = Version(2, 33, 7, 42)
with NamedTemporaryFile() as tf:
v.store(tf.name)
self.assertGreater(len(tf.read().decode('utf-8').splitlines()), 1)
class TestVersionTxt(TestCase):
def test_can_read_version(self):

View File

@@ -12,6 +12,19 @@ logger = getLogger(__name__)
RE_SETUP_PY = re.compile(r'version\s?=\s?[\'"](.*)[\'"]')
def _add_dummy_indent_parameter_to_toml_dump():
original_dump = toml.dump
def dump(*args, **kwargs):
kwargs.pop('indent', None)
return original_dump(*args, **kwargs)
toml.dump = dump
_add_dummy_indent_parameter_to_toml_dump()
class SetupPy:
def __init__(self, filename):
logger.warning('setup.py is discouraged. Use pyproject.toml.')
@@ -64,7 +77,7 @@ class Structured:
cur[self.item_path[-1]] = str(self.version)
with open(destination, 'w') as f:
self.format.dump(edited, f)
self.format.dump(edited, f, indent=2)
class VersionTxt: