No need to run pip install pyScss in setup.py if it's not available

This commit is contained in:
Fabio Manganiello 2019-12-02 00:24:28 +01:00
parent 526136be36
commit fbe4f9494c
2 changed files with 8 additions and 15 deletions

View File

@ -90,11 +90,12 @@ def generate_dockerfile(deps, ports, cfgfile, devdir, python_version):
for dep in deps: for dep in deps:
content += '\t&& pip install {} \\\n'.format(dep) content += '\t&& pip install {} \\\n'.format(dep)
content += '\t&& pip install ' + \ content += textwrap.dedent(
'git+https://github.com/BlackLight/platypush.git \\\n' '''
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: for port in ports:
content += 'EXPOSE {}\n'.format(port) content += 'EXPOSE {}\n'.format(port)

View File

@ -3,8 +3,6 @@
import errno import errno
import os import os
import re import re
import subprocess
import sys
import distutils.cmd import distutils.cmd
from distutils.command.build import build from distutils.command.build import build
from setuptools import setup, find_packages from setuptools import setup, find_packages
@ -23,15 +21,9 @@ class WebBuildCommand(distutils.cmd.Command):
try: try:
from scss import Compiler from scss import Compiler
except ImportError: except ImportError:
print('pyScss not found, trying to install it') print('pyScss module not found: {}. You will have to generate ' +
cmd = [sys.executable, '-m', 'pip', 'install', 'pyScss'] 'the CSS files manually through python setup.py build install')
return
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('Building CSS files') print('Building CSS files')
base_path = path(os.path.join('platypush','backend','http','static','css')) base_path = path(os.path.join('platypush','backend','http','static','css'))