cgse 2024.1.3__py3-none-any.whl → 2024.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
bump.py CHANGED
@@ -12,9 +12,15 @@ Note:
12
12
 
13
13
  """
14
14
 
15
+ # /// script
16
+ # requires-python = ">=3.9"
17
+ # dependencies = [
18
+ # "tomlkit",
19
+ # "rich",
20
+ # ]
21
+ # ///
15
22
  import os
16
23
  import pathlib
17
- import subprocess
18
24
 
19
25
  import rich
20
26
  import tomlkit
@@ -24,10 +30,10 @@ import tomlkit.exceptions
24
30
  def get_master_version(master_pyproject_path):
25
31
  """Returns the version number of the master project, i.e. cgse."""
26
32
 
27
- with open(master_pyproject_path, 'r') as file:
33
+ with open(master_pyproject_path, "r") as file:
28
34
  data = tomlkit.parse(file.read())
29
35
 
30
- return data['project']['version']
36
+ return data["project"]["version"]
31
37
 
32
38
 
33
39
  def update_project_version(project_dir, new_version):
@@ -37,13 +43,13 @@ def update_project_version(project_dir, new_version):
37
43
 
38
44
  # Check if the Poetry version is defined, otherwise print a message.
39
45
 
40
- with open("pyproject.toml", 'r') as file:
46
+ with open("pyproject.toml", "r") as file:
41
47
  data = tomlkit.parse(file.read())
42
48
 
43
49
  try:
44
- data['project']['version'] = new_version
50
+ data["project"]["version"] = new_version
45
51
 
46
- with open('pyproject.toml', 'w') as file:
52
+ with open("pyproject.toml", "w") as file:
47
53
  tomlkit.dump(data, file)
48
54
 
49
55
  except tomlkit.exceptions.NonExistentKey:
@@ -53,20 +59,22 @@ def update_project_version(project_dir, new_version):
53
59
  def update_all_projects_in_monorepo(root_dir):
54
60
  """Updates all pyproject.toml files with the master version number."""
55
61
 
56
- master_version = get_master_version(os.path.join(root_dir, 'pyproject.toml'))
62
+ excluded_subdirs = ["__pycache__", ".venv", ".git", ".idea", "cgse/build", "cgse/dist"]
63
+
64
+ master_version = get_master_version(os.path.join(root_dir, "pyproject.toml"))
57
65
 
58
66
  rich.print(f"Projects will be bumped to version {master_version}")
59
67
 
60
68
  for subdir, dirs, files in os.walk(root_dir):
61
- if subdir == '.' or subdir == '..' or subdir == '__pycache__' or ".venv" in subdir or ".git" in subdir:
69
+ if subdir == "." or subdir == ".." or any(excluded in subdir for excluded in excluded_subdirs):
70
+ # rich.print(f"rejected {subdir = }")
62
71
  continue
63
- if 'pyproject.toml' in files and subdir != str(root_dir): # Skip the master pyproject.toml
72
+ if "pyproject.toml" in files and subdir != str(root_dir): # Skip the master pyproject.toml
64
73
  print(f"Updating version for project in {subdir}")
65
74
  update_project_version(subdir, master_version)
66
75
 
67
76
 
68
77
  if __name__ == "__main__":
69
-
70
78
  monorepo_root = pathlib.Path(__file__).parent.resolve()
71
79
 
72
80
  cwd = os.getcwd()
@@ -1,15 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cgse
3
- Version: 2024.1.3
3
+ Version: 2024.1.4
4
4
  Summary: Generic Common-EGSE: Commanding and monitoring lab equipment
5
5
  Author-email: Rik Huygen <rik.huygen@kuleuven.be>, Sara Regibo <sara.regibo@kuleuven.be>
6
6
  License: MIT
7
7
  Requires-Python: >=3.9
8
8
  Requires-Dist: rich>=13.9.4
9
- Requires-Dist: tomlkit
10
- Provides-Extra: dev
11
- Requires-Dist: pipdeptree; extra == 'dev'
12
- Requires-Dist: ruff; extra == 'dev'
9
+ Requires-Dist: tomlkit>=0.13.2
13
10
  Description-Content-Type: text/markdown
14
11
 
15
12
  # Common-EGSE
@@ -0,0 +1,5 @@
1
+ README.md,sha256=yQS3M4FcPRbxmq2IewtmrzquiPGMJyJRS8A09WWDZNY,1210
2
+ bump.py,sha256=i6s9L4q7iztE7sdg1qs1bjgA4Gx1kJ2EN9lY8-LUMYw,2480
3
+ cgse-2024.1.4.dist-info/METADATA,sha256=9YJAF0MA-Rg2cut5AwlXlCNJNIX1l5G1za6Fdr7M6u8,1556
4
+ cgse-2024.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
5
+ cgse-2024.1.4.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- README.md,sha256=yQS3M4FcPRbxmq2IewtmrzquiPGMJyJRS8A09WWDZNY,1210
2
- bump.py,sha256=1DEdISjBkVxS03uqsGtX7n9VXaILtkxTD3tnYEfPJiQ,2267
3
- cgse-2024.1.3.dist-info/METADATA,sha256=MuWQnAFEssebuEQF4a3xT2fXG9wRmJzWev8FEoHlnJ0,1646
4
- cgse-2024.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
5
- cgse-2024.1.3.dist-info/RECORD,,