From fbe4f9494c55dd36ebc703868bfacc9f7d4a1a34 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 2 Dec 2019 00:24:28 +0100 Subject: [PATCH] No need to run pip install pyScss in setup.py if it's not available --- platypush/platydock/__init__.py | 9 +++++---- setup.py | 14 +++----------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/platypush/platydock/__init__.py b/platypush/platydock/__init__.py index 4c073151e..94d806dee 100755 --- a/platypush/platydock/__init__.py +++ b/platypush/platydock/__init__.py @@ -90,11 +90,12 @@ def generate_dockerfile(deps, ports, cfgfile, devdir, python_version): for dep in deps: content += '\t&& pip install {} \\\n'.format(dep) - content += '\t&& pip install ' + \ - 'git+https://github.com/BlackLight/platypush.git \\\n' + content += textwrap.dedent( + ''' + RUN pip install git+https://github.com/BlackLight/platypush.git + RUN apk del git && apk del build-base - content += '\t&& apk del git \\\n' - content += '\t&& apk del build-base\n\n' + ''') for port in ports: content += 'EXPOSE {}\n'.format(port) diff --git a/setup.py b/setup.py index 619fd7c36..ce06aa263 100755 --- a/setup.py +++ b/setup.py @@ -3,8 +3,6 @@ import errno import os import re -import subprocess -import sys import distutils.cmd from distutils.command.build import build from setuptools import setup, find_packages @@ -23,15 +21,9 @@ class WebBuildCommand(distutils.cmd.Command): try: from scss import Compiler except ImportError: - print('pyScss not found, trying to install it') - cmd = [sys.executable, '-m', 'pip', 'install', 'pyScss'] - - try: - subprocess.call(cmd) - except Exception as e: - print(('pyScss install command failed: {}: {}. You will have to generate ' + - 'the CSS files manually through python setup.py build install').format(' '.join(cmd), str(e))) - return + print('pyScss module not found: {}. You will have to generate ' + + 'the CSS files manually through python setup.py build install') + return print('Building CSS files') base_path = path(os.path.join('platypush','backend','http','static','css'))