Skip to content

Commit

Permalink
Merge pull request #99 from learningequality/kolibri-0.16.1
Browse files Browse the repository at this point in the history
Update to Kolibri 0.16.1
  • Loading branch information
dylanmccall committed May 24, 2024
2 parents c72b342 + f3978b8 commit c7824bf
Show file tree
Hide file tree
Showing 53 changed files with 1,223 additions and 617 deletions.
19 changes: 19 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[tool.bumpversion]
current_version = "2.3.4"
commit = true
tag = true
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)(.(?P<patch>\\d+))?"
serialize = [
"{major}.{minor}.{patch}",
"{major}.{minor}"
]

[[tool.bumpversion.files]]
filename = "VERSION"

[[tool.bumpversion.files]]
filename = "data/metainfo/org.learningequality.Kolibri.metainfo.xml.in.in"
# This crude regex will break if the release tag contains any "/" or ">" characters.
regex = true
search = "<release\\s[^>]*\\s?version=\"{current_version}\\+next\"[^/>]*"
replace = "<release version=\"{new_version}\" date=\"{now:%Y-%m-%d}\" type=\"stable\""
58 changes: 13 additions & 45 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand All @@ -24,50 +24,18 @@ jobs:
needs: lint
runs-on: ubuntu-latest

container:
image: bilelmoussaoui/flatpak-github-actions:gnome-44
options: --privileged

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get -y install \
flatpak \
flatpak-builder \
xvfb
- name: Cache flatpak user installation
uses: actions/cache@v3
with:
path: ~/.local/share/flatpak
key: flatpak-user-${{ runner.arch }}

- name: Cache flatpak-builder state directory
uses: actions/cache@v3
with:
path: .flatpak-builder
key: flatpak-builder-${{ runner.arch }}

- name: Add Flathub repository
run: |
flatpak remote-add --user --if-not-exists flathub \
https://dl.flathub.org/repo/flathub.flatpakrepo
- name: Build flatpak
# The build needs to be run under Xvfb (or some other virtual
# display server) so that Gdk initialization succeeds in the
# tests.
run: |
xvfb-run --auto-servernum -- \
flatpak-builder --user --install-deps-from=flathub --repo _repo _flatpak \
build-aux/flatpak/org.learningequality.Kolibri.Devel.json
- name: Create flatpak bundle
run: |
flatpak build-bundle _repo org.learningequality.Kolibri.Devel.flatpak org.learningequality.Kolibri.Devel
uses: actions/checkout@v4

- name: Upload flatpak bundle
uses: actions/upload-artifact@v3
- name: Build Flatpak bundle
uses: flatpak/flatpak-github-actions/flatpak-builder@v6.3
with:
name: flatpak
path: org.learningequality.Kolibri.Devel.flatpak
bundle: org.learningequality.Kolibri.Devel.flatpak
manifest-path: build-aux/flatpak/org.learningequality.Kolibri.Devel.json
cache: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
cache-key: kolibri-gnome-${{ github.sha }}
43 changes: 43 additions & 0 deletions .github/workflows/update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Check for updates
on:
schedule:
- cron: "0 * * * *" # run every hour
workflow_dispatch:

jobs:
flatpak-external-data-checker:
runs-on: ubuntu-latest
container: ghcr.io/flathub/flatpak-external-data-checker:latest

strategy:
matrix:
branch: [ main ] # list all branches to check

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}

# The f-e-d-c safe.directory handling is currently broken when the
# manifest is in a subdirectory, so it has to be handled outside
# of the checker.
#
# https://github.com/flathub/flatpak-external-data-checker/issues/386
- name: Mark git checkout safe
run: |
git config --global --add safe.directory "$PWD"
- name: Run flatpak-external-data-checker
env:
GIT_AUTHOR_NAME: Flatpak External Data Checker
GIT_COMMITTER_NAME: Flatpak External Data Checker
# email sets "github-actions[bot]" as commit author, see https://github.community/t/github-actions-bot-email-address/17204/6
GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
working-directory: build-aux/flatpak
run: |
/app/flatpak-external-data-checker --update --verbose --never-fork \
build-aux/flatpak/org.learningequality.Kolibri.Devel.json
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.0.1
rev: v3.11.0
hooks:
- id: reorder-python-imports
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.9.1
hooks:
- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
# language_version: python3.10
# language_version: python3.11
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 6.1.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
rev: v1.5.1
hooks:
- id: mypy
exclude: '\.patch$'
77 changes: 76 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ dependencies in addition to installing the desktop front-end.

It will also take advantage of having the following Kolibri plugins installed:
- [kolibri-app-desktop-xdg-plugin](https://github.com/endlessm/kolibri-app-desktop-xdg-plugin)
- [kolibri-desktop-auth-plugin](https://github.com/endlessm/kolibri-desktop-auth-plugin)

If so, they will be automatically registered before Kolibri is
initialized.
Expand Down Expand Up @@ -128,3 +127,79 @@ URIs like `kolibri-channel://`, `x-kolibri-dispatch://` and converts
them into kolibri-gnome arguments. Starts kolibri-gnome with a
specific application ID depending on the URI. This is why a launcher
process is needed instead of handling these URIs in kolibri-gnome.

#### Managing release notes

While making changes for an upcoming release, please update [org.learningequality.Kolibri.metainfo.xml.in.in](data/metainfo/org.learningequality.Kolibri.metainfo.xml.in.in)
with information about those changes. In the `<releases>` section, there should
always be a release entry with `version` set to the previous version followed by
`+next`, like this:

```
<release version="3.0.0+next" date="2024-04-23" type="development">
<description>
<ul>
<li>The description of a new feature goes here.</li>
</ul>
</description>
</release>
```

If there is not one, please create one as the first entry in `<releases>`.

#### Creating releases

To create a release, use [bump-my-version](<https://pypi.org/project/bump-my-version/>):

```
bump-my-version bump minor
git push
git push --tags
```

This will create a new git tag, update the `VERSION` file in the project root,
and update the "+next" release entry in [org.learningequality.Kolibri.metainfo.xml.in.in](data/metainfo/org.learningequality.Kolibri.metainfo.xml.in.in).

Note that it is possible to increment either the `major`, `minor`, or `patch`
component of the project's version number.

### Debugging and advanced usage

#### Web inspector

For development builds, kolibri-gnome enables WebKit developer extras. You can
open the web inspector by pressing F12, or by right clicking and choosing
"Inspect Element" from the context menu. If this is not available, try running
the application with `env KOLIBRI_APP_DEVELOPER_EXTRAS=1` for a production
build, or with `env KOLIBRI_DEVEL_APP_DEVELOPER_EXTRAS=1` for a development
build.

#### Automatic provisioning

The kolibri-daemon service will automatically provision Kolibri when it starts
for the first time. This skips Kolibri's first-run setup wizard and sets up
Kolibri with no root user. To disable this feature, start kolibri-daemon with
the `KOLIBRI_APP_AUTOMATIC_PROVISION` environment variable set to `0` for a
production build, or with `KOLIBRI_DEVEL_APP_AUTOMATIC_PROVISION` for a
development build. For example, using the reference flatpak:

```
env KOLIBRI_DEVEL_APP_AUTOMATIC_PROVISION=0 flatpak run --command=/app/libexec/kolibri-app/kolibri-daemon org.learningequality.Kolibri.Devel
```

Alternatively, provide your own [automatic provisioning file](httpshttps://github.com/learningequality/kolibri/blob/release-v0.16.x/kolibri/core/device/utils.py#L335-L365)
and start kolibri-daemon with `env KOLIBRI_AUTOMATIC_PROVISION_FILE=/path/to/automatic_provision.json`.

#### Automatic sign in

The kolibri-gnome application will automatically sign in to Kolibri using a
private token assigned to the current desktop user. This is necessary to
support the automatic provisioning feature. To disable automatic sign in, so
Kolibri will instead require you to sign in with a password, start the
application with the `KOLIBRI_APP_AUTOMATIC_LOGIN` environment variable set
to `0` for a production build, or with `KOLIBRI_DEVEL_APP_AUTOMATIC_LOGIN`
for a development build. For example, using the reference flatpak:

```
env KOLIBRI_DEVEL_APP_AUTOMATIC_LOGIN=0 flatpak run org.learningequality.Kolibri.Devel
```
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.3.4
19 changes: 12 additions & 7 deletions build-aux/flatpak/modules/iproute2.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
{
"name" : "iproute2",
"buildsystem" : "autotools",
"make-install-args" : [
"name": "iproute2",
"buildsystem": "autotools",
"make-install-args": [
"PREFIX=${FLATPAK_DEST}",
"SBINDIR=${FLATPAK_DEST}/bin",
"CONFDIR=${FLATPAK_DEST}/etc/iproute2"
],
"sources" : [
"sources": [
{
"type" : "archive",
"url" : "https://mirrors.edge.kernel.org/pub/linux/utils/net/iproute2/iproute2-5.7.0.tar.xz",
"sha256" : "725dc7ba94aae54c6f8d4223ca055d9fb4fe89d6994b1c03bfb4411c4dd10f21"
"type": "git",
"url": "https://git.kernel.org/pub/scm/network/iproute2/iproute2.git",
"tag": "v6.8.0",
"x-checker-data": {
"type": "git",
"tag-pattern": "^v([\\d.]+)$"
},
"commit": "e5fd785830671180e934a84a44da93c51cce839d"
}
]
}
19 changes: 0 additions & 19 deletions build-aux/flatpak/modules/kolibri-home-template.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,51 @@
"name": "python3-kolibri-app-desktop-xdg-plugin",
"buildsystem": "simple",
"build-commands": [
"pip3 install --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} kolibri-app-desktop-xdg-plugin"
"pip3 install --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} --use-pep517 kolibri-app-desktop-xdg-plugin"
],
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/90/d4/a7c9b6c5d176654aa3dbccbfd0be4fd3a263355dc24122a5f1937bdc2689/Pillow-8.3.2.tar.gz",
"sha256": "dde3f3ed8d00c72631bc19cbfff8ad3b6215062a5eed402381ad365f82f0c18c"
"url": "https://files.pythonhosted.org/packages/f7/29/13965af254e3373bceae8fb9a0e6ea0d0e571171b80d6646932131d6439b/setuptools-69.5.1-py3-none-any.whl",
"sha256": "c636ac361bc47580504644275c9ad802c50415c7522212252c033bd15f301f32",
"x-checker-data": {
"type": "pypi",
"name": "setuptools",
"packagetype": "bdist_wheel"
}
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/3e/b8/46e65ec41b08c8f78a5e571357d6a0634187286f6ba558c447fb99f4512c/kolibri_app_desktop_xdg_plugin-1.1.4-py2.py3-none-any.whl",
"sha256": "16d16a21c55cae262dbf587e43815af1646b3b7dac70f07bf1d0c412833911aa"
"url": "https://files.pythonhosted.org/packages/7d/cd/d7460c9a869b16c3dd4e1e403cce337df165368c71d6af229a74699622ce/wheel-0.43.0-py3-none-any.whl",
"sha256": "55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81",
"x-checker-data": {
"type": "pypi",
"name": "wheel",
"packagetype": "bdist_wheel"
}
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/ef/43/c50c17c5f7d438e836c169e343695534c38c77f60e7c90389bd77981bc21/pillow-10.3.0.tar.gz",
"sha256": "9d2455fbf44c914840c793e89aa82d0e1763a14253a000743719ae5946814b2d",
"x-checker-data": {
"type": "pypi",
"name": "Pillow",
"versions": {
">=": "10.1.0",
"<": "11.0.0"
}
}
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/44/01/a40f3823fc367731e5cd7a90306b0cc3af080b1e13f59fd66efb3ff7bec4/kolibri_app_desktop_xdg_plugin-1.2.0-py3-none-any.whl",
"sha256": "d689e7cdcdad49a2897fa1ce9069ff9d57e375c7918a4e5b27bb6fbe4d3e5859",
"x-checker-data": {
"type": "pypi",
"name": "kolibri-app-desktop-xdg-plugin",
"packagetype": "bdist_wheel"
}
}
]
}
14 changes: 0 additions & 14 deletions build-aux/flatpak/modules/python3-kolibri-desktop-auth-plugin.json

This file was deleted.

Loading

0 comments on commit c7824bf

Please sign in to comment.