6
6
import networkx as nx
7
7
import subprocess
8
8
import shutil
9
+ from vinca .main import read_vinca_yaml
10
+ import ruamel .yaml
11
+
9
12
10
13
from vinca .distro import Distro
11
14
12
- packages_to_migrate = ["libopencv" ]
13
- distro_version = "noetic"
14
- ros_prefix = f"ros-{ distro_version } "
15
+ distro_version = None
16
+ ros_prefix = None
15
17
16
- arches = ["linux-64" , "linux-aarch64" , "win-64" , "osx-64" , "osx-arm64" ]
18
+ # arches = ["linux-64", "linux-aarch64", "win-64", "osx-64", "osx-arm64"]
19
+ # arch_to_fname = {
20
+ # "linux-64": "linux",
21
+ # "linux-aarch64": "linux_aarch_64",
22
+ # "win-64": "win",
23
+ # "osx-64": "osx",
24
+ # "osx-arm64": "osx_arm64"
25
+ # }
17
26
18
27
def to_ros_name (distro , pkg_name ):
19
28
shortname = pkg_name [len (ros_prefix ) + 1 :]
@@ -26,6 +35,15 @@ def to_ros_name(distro, pkg_name):
26
35
27
36
def create_migration_instructions (arch , packages_to_migrate , trigger_branch ):
28
37
url = f"https://conda.anaconda.org/robostack/{ arch } /repodata.json"
38
+
39
+ yaml = ruamel .yaml .YAML ()
40
+ with open ("vinca.yaml" , "r" ) as fi :
41
+ vinca_conf = yaml .load (fi )
42
+
43
+ global distro_version , ros_prefix
44
+ distro_version = vinca_conf ['ros_distro' ]
45
+ ros_prefix = f"ros-{ distro_version } "
46
+
29
47
print ("URL: " , url )
30
48
# return
31
49
repodata = requests .get (url ).json ()
@@ -46,9 +64,6 @@ def create_migration_instructions(arch, packages_to_migrate, trigger_branch):
46
64
# print(f"need to migrate {pkey}")
47
65
to_migrate .add (pname )
48
66
49
- # print(to_migrate)
50
- # print(ros_pkgs)
51
-
52
67
latest = {}
53
68
for pkg in ros_pkgs :
54
69
current = current_version = None
@@ -70,9 +85,7 @@ def create_migration_instructions(arch, packages_to_migrate, trigger_branch):
70
85
current = pkey
71
86
latest [pkg ] = current
72
87
73
- # print(latest)
74
-
75
- # now we can build the graph ...
88
+ # now we can build the graph ...
76
89
77
90
G = nx .DiGraph ()
78
91
for pkg , pkgkey in latest .items ():
@@ -98,12 +111,6 @@ def create_migration_instructions(arch, packages_to_migrate, trigger_branch):
98
111
ros_names .append (to_ros_name (distro , pkg ))
99
112
print ("Final names: " , ros_names )
100
113
101
- from vinca .main import read_vinca_yaml
102
- import ruamel .yaml
103
- yaml = ruamel .yaml .YAML ()
104
- with open ("vinca.yaml" , "r" ) as fi :
105
- vinca_conf = yaml .load (fi )
106
-
107
114
vinca_conf ["packages_select_by_deps" ] = ros_names
108
115
vinca_conf ["skip_all_deps" ] = True
109
116
vinca_conf ["is_migration" ] = True
0 commit comments