Factor build_pkg() in conda.py
@@ -44,17 +44,8 @@ elif sys.platform.startswith('win'):
else:
raise ValueError("Unknown platform")
-bits = struct.calcsize('P') * 8
-
-arch = '{0}-{1}'.format(osname, bits)
-
-for python_ver in ('2.7', '3.4', '3.5', '3.6'):
- for package_name in ('reprozip', 'reprounzip', 'reprounzip-docker',
- 'reprounzip-vagrant', 'reprounzip-vistrails',
- 'reprozip-jupyter', 'reprounzip-qt'):
- if package_name == 'reprozip' and osname != 'linux':
- continue
+def build_pkg(python_ver, package_name):
temp_dir = tempfile.mkdtemp(prefix='rr_conda_')
pkgdir = join(top_level, package_name)
@@ -126,3 +117,14 @@ for python_ver in ('2.7', '3.4', '3.5', '3.6'):
# Clears Conda cache
if os.path.exists(anaconda_cache):
shutil.rmtree(anaconda_cache)
+
+
+if __name__ == '__main__':
+ for python_ver in ('2.7', '3.4', '3.5', '3.6'):
+ for package_name in ('reprozip', 'reprounzip', 'reprounzip-docker',
+ 'reprounzip-vagrant', 'reprounzip-vistrails',
+ 'reprozip-jupyter', 'reprounzip-qt'):
+ if package_name == 'reprozip' and osname != 'linux':
+ continue
+
+ build_pkg(python_ver, package_name)
