mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-19 07:53:00 +00:00
Merge pull request #4035 from manics/docker-yarn
setup.py: require npm, check that NPM CSS JSX commands succeed
This commit is contained in:
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -62,6 +62,10 @@ jobs:
|
|||||||
pip install dist/*.whl
|
pip install dist/*.whl
|
||||||
./ci/check_installed_data.py
|
./ci/check_installed_data.py
|
||||||
|
|
||||||
|
- name: verify sdist can be installed without npm/yarn
|
||||||
|
run: |
|
||||||
|
docker run --rm -v $PWD/dist:/dist:ro docker.io/library/python:3.9-slim-bullseye bash -c 'pip install /dist/jupyterhub-*.tar.gz'
|
||||||
|
|
||||||
# ref: https://github.com/actions/upload-artifact#readme
|
# ref: https://github.com/actions/upload-artifact#readme
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
6
setup.py
6
setup.py
@@ -168,9 +168,6 @@ class NPM(BaseCommand):
|
|||||||
bower_dir = pjoin(static, 'components')
|
bower_dir = pjoin(static, 'components')
|
||||||
|
|
||||||
def should_run(self):
|
def should_run(self):
|
||||||
if not shutil.which('npm'):
|
|
||||||
print("npm unavailable", file=sys.stderr)
|
|
||||||
return False
|
|
||||||
if not os.path.exists(self.bower_dir):
|
if not os.path.exists(self.bower_dir):
|
||||||
return True
|
return True
|
||||||
if not os.path.exists(self.node_modules):
|
if not os.path.exists(self.node_modules):
|
||||||
@@ -195,6 +192,7 @@ class NPM(BaseCommand):
|
|||||||
os.utime(self.bower_dir)
|
os.utime(self.bower_dir)
|
||||||
# update data-files in case this created new files
|
# update data-files in case this created new files
|
||||||
self.distribution.data_files = get_data_files()
|
self.distribution.data_files = get_data_files()
|
||||||
|
assert not self.should_run(), 'NPM.run failed'
|
||||||
|
|
||||||
|
|
||||||
class CSS(BaseCommand):
|
class CSS(BaseCommand):
|
||||||
@@ -255,6 +253,7 @@ class CSS(BaseCommand):
|
|||||||
raise
|
raise
|
||||||
# update data-files in case this created new files
|
# update data-files in case this created new files
|
||||||
self.distribution.data_files = get_data_files()
|
self.distribution.data_files = get_data_files()
|
||||||
|
assert not self.should_run(), 'CSS.run failed'
|
||||||
|
|
||||||
|
|
||||||
class JSX(BaseCommand):
|
class JSX(BaseCommand):
|
||||||
@@ -314,6 +313,7 @@ class JSX(BaseCommand):
|
|||||||
|
|
||||||
# update data-files in case this created new files
|
# update data-files in case this created new files
|
||||||
self.distribution.data_files = get_data_files()
|
self.distribution.data_files = get_data_files()
|
||||||
|
assert not self.should_run(), 'JSX.run failed'
|
||||||
|
|
||||||
|
|
||||||
def js_css_first(cls, strict=True):
|
def js_css_first(cls, strict=True):
|
||||||
|
Reference in New Issue
Block a user