Move installed data file check to script

This commit is contained in:
Simon Li
2022-06-01 20:44:40 +01:00
parent 5e5dad9512
commit acd75d85c7
2 changed files with 23 additions and 19 deletions

View File

@@ -57,26 +57,10 @@ jobs:
run: | run: |
./ci/check_sdist.py dist/jupyterhub-*.tar.gz ./ci/check_sdist.py dist/jupyterhub-*.tar.gz
- name: verify wheel - name: verify data-files are installed where they are found
run: | run: |
cd dist pip install dist/*.whl
pip install ./*.whl ./ci/check_installed_data.py
# verify data-files are installed where they are found
cat <<EOF | python
import os
from jupyterhub._data import DATA_FILES_PATH
print(f"DATA_FILES_PATH={DATA_FILES_PATH}")
assert os.path.exists(DATA_FILES_PATH), DATA_FILES_PATH
for subpath in (
"templates/page.html",
"static/css/style.min.css",
"static/components/jquery/dist/jquery.js",
"static/js/admin-react.js",
):
path = os.path.join(DATA_FILES_PATH, subpath)
assert os.path.exists(path), path
print("OK")
EOF
# ref: https://github.com/actions/upload-artifact#readme # ref: https://github.com/actions/upload-artifact#readme
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2

20
ci/check_installed_data.py Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env python
# Check that installed package contains everything we expect
import os
from jupyterhub._data import DATA_FILES_PATH
print("Checking jupyterhub._data")
print(f"DATA_FILES_PATH={DATA_FILES_PATH}")
assert os.path.exists(DATA_FILES_PATH), DATA_FILES_PATH
for subpath in (
"templates/page.html",
"static/css/style.min.css",
"static/components/jquery/dist/jquery.js",
"static/js/admin-react.js",
):
path = os.path.join(DATA_FILES_PATH, subpath)
assert os.path.exists(path), path
print("OK")