Skip to content

Commit 44e22e1

Browse files
committed
node: Define split size in a single place
1 parent a546794 commit 44e22e1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

node/flatpak_node_generator/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from typing import Iterator, List, Set
88

99
from .cache import Cache, FilesystemBasedCache
10-
from .manifest import ManifestGenerator
10+
from .manifest import DEFAULT_SPLIT_SIZE_KB, ManifestGenerator
1111
from .node_headers import NodeHeaders
1212
from .package import Package
1313
from .progress import GeneratorProgress
@@ -99,7 +99,7 @@ async def _async_main() -> None:
9999
'-S',
100100
'--split-size',
101101
type=int,
102-
default=49 * 1000, # GITHUB has 49MB limit.
102+
default=DEFAULT_SPLIT_SIZE_KB,
103103
dest='split_size',
104104
help='If splitting the sources file, split at this size in KB. Default is 49000KB.',
105105
)

node/flatpak_node_generator/manifest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
from .integrity import Integrity
1919

20+
DEFAULT_SPLIT_SIZE_KB = 49 * 1000 # GitHub has 49 MB limit
21+
2022

2123
class ManifestGenerator(ContextManager['ManifestGenerator']):
2224
JSON_INDENT = 4
@@ -26,7 +28,7 @@ def __init__(self) -> None:
2628
# That way, we ensure uniqueness.
2729
self._sources: Set[Tuple[Tuple[str, Any], ...]] = set()
2830
self._commands: List[str] = []
29-
self.split_size = 49 * 1000 * 1000
31+
self.split_size = DEFAULT_SPLIT_SIZE_KB * 1000
3032

3133
def __exit__(
3234
self,

0 commit comments

Comments
 (0)