Skip to content

Commit

Permalink
build: Explicitly generate _version.py before building frontend
Browse files Browse the repository at this point in the history
kolibri-tools needs to be able to load the `kolibri_explore_plugin`
Python module at build time, as part of building the frontend. If the
`_version.py` for it has not been generated by then, this will fail.

Manually invoke `setuptools_scm` to generate `_version.py`. This
requires having `setuptools_scm` installed first.

Signed-off-by: Philip Withnall <[email protected]>

#647
  • Loading branch information
pwithnall committed Jun 27, 2023
1 parent 26a419a commit 49ad7c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ flake8 = "==3.8.3"
pre-commit = "==2.15.0"
twine = "*"
bumpversion = "*"
setuptools_scm = "*"

[packages]
nodeenv = "==1.3.3"
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
"description": "Monorepo with kolibri's Discovery page and custom channel presentations.",
"private": true,
"scripts": {
"build": "yarn build:packages && yarn deploy:welcome && yarn build:plugin && yarn build:info",
"build": "yarn build:version && yarn build:packages && yarn deploy:welcome && yarn build:plugin && yarn build:info",
"build:plugin": "./scripts/set_override.py default && kolibri-tools build prod --plugins kolibri_explore_plugin",
"build:packages": "yarn build:libs",
"build:libs": "lerna run build --ignore template-ui",
"build:apps": "lerna run build --scope template-ui",
"build:info": "./scripts/build_info.sh > kolibri_explore_plugin/static/build-info.json",
"build:version": "python -m setuptools_scm",
"build-dist": "./scripts/clean.sh && yarn clean && yarn build && python -m build",
"deploy:apps": "./scripts/bundle_bundles.py",
"clean": "kolibri-tools build clean --plugins kolibri_explore_plugin",
Expand Down

0 comments on commit 49ad7c4

Please sign in to comment.