Skip to content

Commit 9fce172

Browse files
committed
Use a sorted list created from a set in update_versions
1 parent 2e6422b commit 9fce172

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.scripts/update_versions

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import argparse
44
import logging
55
from pathlib import Path
6-
from typing import Set
6+
from typing import List
77

88
DEFAULT_VERSION = "1.0.0"
99

@@ -15,13 +15,12 @@ logging.basicConfig(
1515
)
1616

1717

18-
def main(properties_file: Path, projects: Set[str]):
18+
def main(properties_file: Path, projects: List[str]):
1919
if not properties_file.is_file():
2020
raise ValueError(f"Properties file {properties_file} does not exist")
2121

2222
properties = read_properties(properties_file)
23-
24-
for project in sorted(projects):
23+
for project in projects:
2524
project_key = f"model.{project}.version"
2625
if project_key not in properties:
2726
logger.info(
@@ -41,7 +40,8 @@ def main(properties_file: Path, projects: Set[str]):
4140

4241
# Write the file containing the list of changed services, excluding the 'all' project
4342
changed_file = properties_file.parent / '.changed'
44-
projects.discard('all')
43+
if 'all' in projects:
44+
projects.remove('all')
4545
changed_file.write_text("\n".join(projects))
4646

4747

@@ -89,4 +89,4 @@ if __name__ == "__main__":
8989

9090
args = parser.parse_args()
9191

92-
main(args.properties, set(args.services))
92+
main(args.properties, sorted(set(args.services)))

0 commit comments

Comments
 (0)