Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pex filenames #12451

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)