Skip to content

Commit

Permalink
Move unpack location for kolibri whl file to kolibrisrc to avoid lint…
Browse files Browse the repository at this point in the history
…ing woes.
  • Loading branch information
rtibbles committed Jun 28, 2023
1 parent 2b86928 commit 19e059d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,9 @@ dmypy.json

# ignores specific to this project.
*.whl
src/kolibri
src/*.dist-info
# generated files
assets/preseeded_kolibri_home
src/stdlib_imports.py
tmpenv
whl
package
kolibri
kolibrisrc
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ guard-%:
fi

needs-version:
$(eval KOLIBRI_VERSION ?= $(shell python3 -c "import os; import sys; sys.path = [os.path.abspath('kolibri')] + sys.path; from pkginfo import Installed; print(Installed('kolibri').version)"))
$(eval KOLIBRI_VERSION ?= $(shell python3 -c "import os; import sys; sys.path = [os.path.abspath('kolibrisrc')] + sys.path; from pkginfo import Installed; print(Installed('kolibri').version)"))
$(eval APP_VERSION ?= $(shell python3 read_version.py))

clean:
Expand All @@ -24,17 +24,17 @@ clean-whl:
mkdir whl

install-whl:
rm -rf kolibri
pip3 install ${whl} -t kolibri/
rm -rf kolibrisrc
pip3 install ${whl} -t kolibrisrc/
# Read SQLAlchemy version from the unpacked whl file to avoid hard coding.
# Manually install the sqlalchemy version
@version=$$(grep -Eo '__version__ = "([0-9]+\.[0-9]+\.[0-9]+)"' kolibri/kolibri/dist/sqlalchemy/__init__.py | grep -Eo "([0-9]+\.[0-9]+\.[0-9]+)"); \
@version=$$(grep -Eo '__version__ = "([0-9]+\.[0-9]+\.[0-9]+)"' kolibrisrc/kolibri/dist/sqlalchemy/__init__.py | grep -Eo "([0-9]+\.[0-9]+\.[0-9]+)"); \
pip3 install sqlalchemy==$$version --no-binary :all:
# Delete sqlalchemy from the dist folder
rm -rf kolibri/kolibri/dist/sqlalchemy
rm -rf kolibri/kolibri/dist/SQLAlchemy*
rm -rf kolibrisrc/kolibri/dist/sqlalchemy
rm -rf kolibrisrc/kolibri/dist/SQLAlchemy*
# This doesn't exist in 0.15, so don't error if it doesn't exist.
echo "3.3.1" > kolibri/kolibri/dist/importlib_resources/version.txt || true
echo "3.3.1" > kolibrisrc/kolibri/dist/importlib_resources/version.txt || true

get-whl: clean-whl
# The eval and shell commands here are evaluated when the recipe is parsed, so we put the cleanup
Expand Down
4 changes: 2 additions & 2 deletions kolibri.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ from glob import glob

block_cipher = None

sys.path = [os.path.abspath('kolibri')] + sys.path
sys.path = [os.path.abspath('kolibrisrc')] + sys.path

import kolibri
kolibri_version = kolibri.__version__
Expand All @@ -26,7 +26,7 @@ locale_datas = [

a = Analysis(
[os.path.join('src', 'kolibri_app', '__main__.py')],
pathex=['kolibri', os.path.join('kolibri', 'kolibri', 'dist')],
pathex=['kolibrisrc', os.path.join('kolibrisrc', 'kolibri', 'dist')],
binaries=[],
datas=[('src/kolibri_app/assets/*.*', 'kolibri_app/assets')] + locale_datas,
hiddenimports=[],
Expand Down
1 change: 1 addition & 0 deletions src/kolibri_app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

from kolibri.main import enable_plugin

from kolibri_app.constants import MAC

__version__ = "0.3.0"
Expand Down
4 changes: 2 additions & 2 deletions src/kolibri_app/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
from threading import Thread

import wx
from magicbus.plugins import SimplePlugin

from kolibri.main import initialize
from kolibri.plugins.app.utils import interface
from kolibri.plugins.app.utils import SHARE_FILE
from kolibri.utils.conf import KOLIBRI_HOME
from kolibri.utils.server import KolibriProcessBus
from magicbus.plugins import SimplePlugin

from kolibri_app.constants import APP_NAME
from kolibri_app.logger import logging
from kolibri_app.view import KolibriView
Expand Down

0 comments on commit 19e059d

Please sign in to comment.