mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-16 22:43:00 +00:00
Minor fixes to get setup.py to work on Windows
This commit is contained in:
30
setup.py
30
setup.py
@@ -119,7 +119,8 @@ from distutils.command.build_py import build_py
|
|||||||
from distutils.command.sdist import sdist
|
from distutils.command.sdist import sdist
|
||||||
|
|
||||||
|
|
||||||
npm_path = ':'.join([
|
sep = ';' if os.name == 'nt' else ':'
|
||||||
|
npm_path = sep.join([
|
||||||
pjoin(here, 'node_modules', '.bin'),
|
pjoin(here, 'node_modules', '.bin'),
|
||||||
os.environ.get("PATH", os.defpath),
|
os.environ.get("PATH", os.defpath),
|
||||||
])
|
])
|
||||||
@@ -179,13 +180,11 @@ class Bower(BaseCommand):
|
|||||||
|
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env['PATH'] = npm_path
|
env['PATH'] = npm_path
|
||||||
|
args = ['bower', 'install', '--allow-root', '--config.interactive=false']
|
||||||
|
if os.name == 'nt':
|
||||||
|
args = ['cmd', '/C'] + args
|
||||||
try:
|
try:
|
||||||
check_call(
|
check_call(args, cwd=here, env=env)
|
||||||
['bower', 'install', '--allow-root', '--config.interactive=false'],
|
|
||||||
cwd=here,
|
|
||||||
env=env,
|
|
||||||
)
|
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print("Failed to run bower: %s" % e, file=sys.stderr)
|
print("Failed to run bower: %s" % e, file=sys.stderr)
|
||||||
print("You can install js dependencies with `npm install`", file=sys.stderr)
|
print("You can install js dependencies with `npm install`", file=sys.stderr)
|
||||||
@@ -234,14 +233,17 @@ class CSS(BaseCommand):
|
|||||||
|
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env['PATH'] = npm_path
|
env['PATH'] = npm_path
|
||||||
|
args = [
|
||||||
|
'lessc', '--clean-css',
|
||||||
|
'--source-map-basepath={}'.format(static),
|
||||||
|
'--source-map={}'.format(sourcemap),
|
||||||
|
'--source-map-rootpath=../',
|
||||||
|
style_less, style_css,
|
||||||
|
]
|
||||||
|
if os.name == 'nt':
|
||||||
|
args = ['cmd', '/C'] + args
|
||||||
try:
|
try:
|
||||||
check_call([
|
check_call(args, cwd=here, env=env)
|
||||||
'lessc', '--clean-css',
|
|
||||||
'--source-map-basepath={}'.format(static),
|
|
||||||
'--source-map={}'.format(sourcemap),
|
|
||||||
'--source-map-rootpath=../',
|
|
||||||
style_less, style_css,
|
|
||||||
], cwd=here, env=env)
|
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print("Failed to run lessc: %s" % e, file=sys.stderr)
|
print("Failed to run lessc: %s" % e, file=sys.stderr)
|
||||||
print("You can install js dependencies with `npm install`", file=sys.stderr)
|
print("You can install js dependencies with `npm install`", file=sys.stderr)
|
||||||
|
Reference in New Issue
Block a user