From 7e0dd0384d6966778c83c0d7f5b016d9dfe3b748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 21 Feb 2018 13:50:55 +0100 Subject: [PATCH] Simplified wheel downloading --- setup.py | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/setup.py b/setup.py index 3ee3099..535bc87 100755 --- a/setup.py +++ b/setup.py @@ -18,7 +18,6 @@ # ##### END GPL LICENSE BLOCK ##### import glob -import os import sys import shutil import subprocess @@ -36,6 +35,12 @@ from setuptools import setup, find_packages requirement_re = re.compile('[><=]+') sys.dont_write_bytecode = True +# Download wheels from pypi. The specific versions are taken from requirements.txt +wheels = [ + 'lockfile', 'pillarsdk', + 'blender-bam', # for compatibility with Blender 2.78 +] + def set_default_path(var, default): """convert CLI-arguments (string) to Paths""" @@ -90,21 +95,11 @@ class BuildWheels(Command): # log.info(' - %s = %s / %s', package, line, line_req[-1]) self.wheels_path.mkdir(parents=True, exist_ok=True) - - # Download lockfile, as there is a suitable wheel on pypi. - if not list(self.wheels_path.glob('lockfile*.whl')): - log.info('Downloading lockfile wheel') - self.download_wheel(requirements['lockfile']) - - # Download Pillar Python SDK from pypi. - if not list(self.wheels_path.glob('pillarsdk*.whl')): - log.info('Downloading Pillar Python SDK wheel') - self.download_wheel(requirements['pillarsdk']) - - # Download BAM from pypi. This is required for compatibility with Blender 2.78. - if not list(self.wheels_path.glob('blender_bam*.whl')): - log.info('Downloading BAM wheel') - self.download_wheel(requirements['blender-bam']) + for package in wheels: + pattern = package.replace('-', '_') + '*.whl' + if list(self.wheels_path.glob(pattern)): + continue + self.download_wheel(requirements[package]) # Build CacheControl. if not list(self.wheels_path.glob('CacheControl*.whl')):