Skip to content

Commit

Permalink
Simplify and fix pex filenaming.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtibbles committed Jul 16, 2024
1 parent 846b97f commit 060e400
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,8 @@ dist: setrequirements writeversion staticdeps staticdeps-cext strip-staticdeps b
python setup.py bdist_wheel
ls -l dist

read-whl-file-version:
python ./build_tools/read_whl_version.py ${whlfile} > kolibri/VERSION

pex:
ls dist/*.whl | while read whlfile; do $(MAKE) read-whl-file-version whlfile=$$whlfile; pex $$whlfile --disable-cache -o dist/kolibri-`cat kolibri/VERSION | sed 's/+/_/g'`.pex -m kolibri --python-shebang=/usr/bin/python3; done
ls dist/*.whl | while read whlfile; do version=$$(python ./build_tools/read_whl_version.py $$whlfile); pex $$whlfile --disable-cache -o dist/kolibri-`echo $$version | sed 's/+/_/g'`.pex -m kolibri --python-shebang=/usr/bin/python3; done

i18n-extract-backend:
cd kolibri && python -m kolibri manage makemessages -- -l en --ignore 'node_modules/*' --ignore 'kolibri/dist/*' --all
Expand Down
7 changes: 2 additions & 5 deletions build_tools/read_whl_version.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import logging
import sys

from pkginfo import Wheel

logger = logging.getLogger(__name__)

if __name__ == "__main__":
if len(sys.argv) != 2:
logger.error("Usage: read_whl_version.py <whl_file>")
print("Usage: read_whl_version.py <whl_file>") # noqa: T201
sys.exit(1)

whl_file = sys.argv[1]
whl = Wheel(whl_file)
logger.info(whl.version)
print(whl.version) # noqa: T201
sys.exit(0)

0 comments on commit 060e400

Please sign in to comment.