Simplified wheel downloading
This commit is contained in:
parent
da0c8dd944
commit
7e0dd0384d
27
setup.py
27
setup.py
@ -18,7 +18,6 @@
|
|||||||
# ##### END GPL LICENSE BLOCK #####
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
import glob
|
import glob
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -36,6 +35,12 @@ from setuptools import setup, find_packages
|
|||||||
requirement_re = re.compile('[><=]+')
|
requirement_re = re.compile('[><=]+')
|
||||||
sys.dont_write_bytecode = True
|
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):
|
def set_default_path(var, default):
|
||||||
"""convert CLI-arguments (string) to Paths"""
|
"""convert CLI-arguments (string) to Paths"""
|
||||||
@ -90,21 +95,11 @@ class BuildWheels(Command):
|
|||||||
# log.info(' - %s = %s / %s', package, line, line_req[-1])
|
# log.info(' - %s = %s / %s', package, line, line_req[-1])
|
||||||
|
|
||||||
self.wheels_path.mkdir(parents=True, exist_ok=True)
|
self.wheels_path.mkdir(parents=True, exist_ok=True)
|
||||||
|
for package in wheels:
|
||||||
# Download lockfile, as there is a suitable wheel on pypi.
|
pattern = package.replace('-', '_') + '*.whl'
|
||||||
if not list(self.wheels_path.glob('lockfile*.whl')):
|
if list(self.wheels_path.glob(pattern)):
|
||||||
log.info('Downloading lockfile wheel')
|
continue
|
||||||
self.download_wheel(requirements['lockfile'])
|
self.download_wheel(requirements[package])
|
||||||
|
|
||||||
# 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'])
|
|
||||||
|
|
||||||
# Build CacheControl.
|
# Build CacheControl.
|
||||||
if not list(self.wheels_path.glob('CacheControl*.whl')):
|
if not list(self.wheels_path.glob('CacheControl*.whl')):
|
||||||
|
Reference in New Issue
Block a user