Compare commits
1 Commits
7ab73ceca9
...
v1.0
| Author | SHA1 | Date | |
|---|---|---|---|
| b91b781a65 |
@@ -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"
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user