Backport PR #4303: make sure event-schemas are installed

This commit is contained in:
Erik Sundell
2023-01-19 10:16:46 +01:00
committed by MeeseeksDev[bot]
parent 193ebc970c
commit 3e608cfc38
2 changed files with 27 additions and 7 deletions

View File

@@ -2,19 +2,34 @@
# Check that installed package contains everything we expect
import os
from pathlib import Path
import jupyterhub
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
print("Checking jupyterhub._data", end=" ")
print(f"DATA_FILES_PATH={DATA_FILES_PATH}", end=" ")
DATA_FILES_PATH = Path(DATA_FILES_PATH)
assert DATA_FILES_PATH.is_dir(), 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
path = DATA_FILES_PATH / subpath
assert path.is_file(), path
print("OK")
print("Checking package_data", end=" ")
jupyterhub_path = Path(jupyterhub.__file__).parent.resolve()
for subpath in (
"alembic.ini",
"alembic/versions/833da8570507_rbac.py",
"event-schemas/server-actions/v1.yaml",
):
path = jupyterhub_path / subpath
assert path.is_file(), path
print("OK")

View File

@@ -50,7 +50,12 @@ def get_package_data():
(mostly alembic config)
"""
package_data = {}
package_data['jupyterhub'] = ['alembic.ini', 'alembic/*', 'alembic/versions/*']
package_data['jupyterhub'] = [
'alembic.ini',
'alembic/*',
'alembic/versions/*',
'event-schemas/*/*.yaml',
]
return package_data