Compare commits

...

83 Commits

Author SHA1 Message Date
Florian du Garage Num
be36969dce remove hard-coded uid 1000
Some checks failed
Sync with private repo / sync (push) Has been cancelled
Run tests / tests (3.12) (push) Has been cancelled
Run tests / tests (3.9) (push) Has been cancelled
2025-09-30 21:37:57 +02:00
Abdul-Muqadim-Arbisoft
25fa14e030
Merge pull request #41 from overhangio/muqadim/migrate-ruff
feat: migrate from pylint/black to ruff
2025-09-15 23:50:48 +05:00
Abdul-Muqadim-Arbisoft
8b682f0902 fix: add one line where file ends
according to pep8 principle missed one line empty priciple at end of file, add that in this commit
2025-09-07 19:50:54 +05:00
Abdul-Muqadim-Arbisoft
a539ca2693 feat: migrate from pylint/black to ruff (#64)
* feat: migrate from pylint/black to ruff
Linked Epic: overhangio/tutor#1251

Some new rules that have been added are:

I: sort imports
N: check for pep8-naming standards
W292: check for missing extra line at EOF

Some of our lines, particularly in config break the 88 character line length limit. For that, we add a # noqa: E501 to let ruff know to ignore the rule for that line

* test: python package distribution build when running make test
Pushing to pypi would occasionally fail because of breaking distribution build.
We verify the build in the github CI now so that we can mitigate those errors later on.

* fix: install ruff instead of pylint/black as optional dev dependency
2025-09-07 19:44:37 +05:00
Ahmed Khalid
cfee151f6b
Merge pull request #40 from overhangio/teak 2025-06-27 17:18:30 +05:00
Abdul-Muqadim-Arbisoft
78b29f1ec6 update changelog 2025-06-10 11:00:15 +05:00
Abdul-Muqadim-Arbisoft
7b4af1f15c v20.0.0 2025-04-06 19:16:47 +05:00
Syed Muhammad Dawoud Sheraz Ali
c2ba1b57fd
build: Add hatch_build in sdist to fix installation issues (#39) 2025-03-12 16:06:59 +05:00
Abdul-Muqadim-Arbisoft
243bbeb79a
Merge pull request #38 from overhangio/muqadim/migrate-to-pyproject
feat: migrate from setup.py/setuptools to pyproject.toml/hatch
2025-03-10 13:05:45 +05:00
Abdul-Muqadim-Arbisoft
05fc54b68d feat: migrate from setup.py/setuptools to pyproject.toml/hatch 2025-02-24 08:26:09 +05:00
Syed Muhammad Dawoud Sheraz Ali
8fa95c708f
build: re-add auto-add for PRs with a different target (#37) 2025-01-17 11:28:18 +05:00
Abdul-Muqadim-Arbisoft
46ed8a91cd
Merge pull request #36 from edly-io/muqadim/change-maintainer
Change maintainer in readme.md and setup.py
2025-01-16 13:11:22 +05:00
Abdul-Muqadim-Arbisoft
8d04f8ac02 Change maintainer in readme.md and setup.py 2025-01-16 12:07:28 +05:00
Régis Behmo
ca03a2f844
v19.0.0 Upgrade to sumac 2024-12-16 20:34:06 +01:00
Abdul-Muqadim-Arbisoft
1d87ec5193 chore: removing hard coded platform name value (#31) 2024-12-09 18:19:39 +05:00
Abdul-Muqadim-Arbisoft
5d2e945a15 chore: Replace Hardcoded PLATFORM_NAME with Configuration Variable (#29) 2024-12-09 18:19:39 +05:00
Abdul-Muqadim-Arbisoft
bef534a00d v19.0.0 Upgrade to sumac 2024-12-09 18:19:39 +05:00
Overhang.IO
aa1c67a6a3 Merge remote-tracking branch 'origin/release' 2024-11-28 09:33:35 +00:00
Régis Behmo
b7af7ba707 v18.0.1 2024-11-28 10:32:41 +01:00
Overhang.IO
d43952befb Merge remote-tracking branch 'origin/release' 2024-11-28 09:25:19 +00:00
Abdul-Muqadim-Arbisoft
cb789e8604 feat: ubuntu 24.04 upgrade
Close #34.
2024-11-28 10:21:14 +01:00
Régis Behmo
af56259343 Merge branch 'release' 2024-11-27 18:35:01 +01:00
Syed Muhammad Dawoud Sheraz Ali
519062a168 feat!: Rename branches master->release, nightly->main 2024-11-27 18:33:32 +01:00
Overhang.IO
097ad05609 Merge remote-tracking branch 'origin/master' into nightly 2024-11-14 16:32:58 +00:00
Abdul-Muqadim-Arbisoft
5648bc4829
chore: remove python 3.8 references (#32) 2024-11-14 21:20:40 +05:00
Abdul-Muqadim-Arbisoft
3f19e83300
feat: ubuntu upgrade (#27) 2024-10-28 12:19:26 +05:00
Régis Behmo
96404d74c0 docs: *.local.edly.io -> *.local.openedx.io
The default URL to run a local platform switched from local.edly.io to
local.openedx.io. This changes makes it clearer for everyone that Tutor
is to run Open edX.

See: https://github.com/overhangio/tutor/issues/1120
2024-10-17 08:36:40 +02:00
Régis Behmo
446587b788 ci: upgrade vendor actions 2024-10-03 11:16:24 +02:00
Régis Behmo
b8281e51dc docs: fix author domain name 2024-10-01 09:08:48 +02:00
Muhammad Ali
2dd92f1801
Merge pull request #26 from overhangio/ali/add-maintainer
Add new maintainer in readme.md and setup.py
2024-09-05 12:10:37 +05:00
muhammadali286
dde6ed73dc chore: add Muhammad Ali as maintainer in readme.md and setup.py 2024-09-04 14:33:25 +05:00
Régis Behmo
95d7c74377 build: fix readme content type warning 2024-07-23 10:37:35 +02:00
Régis Behmo
145ac9519a fix: docker build deprecation warnings
With the latest Docker upgrade, we got the following warnings during
build:

	FromAsCasing: 'as' and 'FROM' keywords' casing do not match
	LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format
2024-06-21 17:12:57 +02:00
Régis Behmo
4d4bc48689
Merge pull request #24 from overhangio/redwood
Upgrade to Redwood
2024-06-20 02:50:08 +02:00
Syed Muhammad Dawoud Sheraz Ali
e35b24fd53 v18.0.0 2024-06-20 01:55:21 +02:00
Max Sokolski
13e384484b
feat: apply a new configuration template file (#22)
Source: https://github.com/openedx/openedx-app-android/blob/main/default_config/prod/config.yaml
2024-06-11 12:19:50 +05:00
Hamza Shafique
5f10cfe451
feat: build main branch in nightly 2024-06-11 09:14:33 +02:00
Abdul-Muqadim-Arbisoft
b5d60b812c
Update plugin for compatibility with new openedx mobile repositories and upgrade dependencies (#21) 2024-06-06 16:59:22 +05:00
Régis Behmo
f5f11b8ef6 ci: don't even try to auto-add PRs to github project
Auto-adding PRs to the Github project is not working because the
github-token is not available there.
2024-03-05 12:03:03 +05:00
Régis Behmo
24ed22f36f ci: remove now useless OPENEDX_RELEASE variable 2024-02-20 15:15:41 +01:00
Régis Behmo
ffe3d6bcf9 fix: remove pkg_resources for compatibility with python 3.12
pkg_resources is a package that is unavailable in python 3.12, unless
setuptools is explicitely installed. Turns out, there are replacement
functions coming from importlib_resources, which can be obtained from
the importlib-resources pypi package. This package will be installed
with tutor starting from 17.0.2.
2024-02-12 11:57:51 +01:00
Muhammad Ali
93c9168ff5
ci: support arm64 image building
By removing the IMAGES_BUILD_PLATFORM key from the CI file, the CI script will pick up the default value, which is a cross-platform (linux/amd64,linux/arm64) build.
2024-01-30 09:44:56 +01:00
Régis Behmo
3e697590c3 ci: auto-add issues and items to github project 2024-01-12 12:33:36 +01:00
Muhammad Ali
93edbdeea5 feat: upgrade to quince 2023-12-11 18:12:10 +01:00
Régis Behmo
7726bfb1c6 local.overhang.io -> local.edly.io
This is related to https://github.com/overhangio/tutor/issues/945
2023-12-09 15:54:28 +01:00
Overhang.IO
7776ba9ce2 Merge remote-tracking branch 'origin/master' into nightly 2023-12-08 18:41:21 +00:00
Emad Rad
f421b6804c
fix: dev dependency 2023-12-08 19:33:20 +01:00
Overhang.IO
fa644d342d Merge remote-tracking branch 'origin/master' into nightly 2023-12-05 11:03:03 +00:00
Régis Behmo
35e375cd26 docs: docs.tutor.overhang.io -> docs.tutor.edly.io
See: https://github.com/overhangio/tutor/issues/945
2023-12-05 11:45:48 +01:00
Overhang.IO
cdd3f5e499 Merge remote-tracking branch 'origin/master' into nightly 2023-11-21 08:56:11 +00:00
Emad Rad
df108fd4c6 chore: cleanup 2023-11-21 09:54:41 +01:00
Emad Rad
139f241de4 fix: typing added 2023-11-21 09:54:41 +01:00
Emad Rad
f59425268a chore: changelog entry added 2023-11-21 09:54:41 +01:00
Emad Rad
0cb623b1c0 feat: Makefile added 2023-11-21 09:54:41 +01:00
Emad Rad
98ba2a58e7 ci: test action added 2023-11-21 09:54:41 +01:00
Régis Behmo
5a005908cb Merge branch 'master' into nightly 2023-11-20 17:46:41 +01:00
Régis Behmo
7dea2459a7 feat: simplify nightly version management
By pulling the version suffix from tutor, we avoid git conflicts when
merging the release branch in nightly.
2023-11-20 17:39:46 +01:00
Overhang.IO
c775b8348b Merge remote-tracking branch 'origin/master' into nightly 2023-10-03 06:43:19 +00:00
Régis Behmo
084318a5ef chore: mark compatibility with python 3.12 2023-10-03 08:23:48 +02:00
Overhang.IO
a433d48a7d Merge remote-tracking branch 'origin/master' into nightly 2023-09-07 16:57:09 +00:00
Régis Behmo
06feeb087e fix: nightly package version
The package version may not include the "-nightly" suffix. Otherwise,
`pip install .` fails with:

    setuptools.extern.packaging.version.InvalidVersion: Invalid version: '...-nightly'
2023-09-07 18:39:53 +02:00
Overhang.IO
15e496e0b1 Merge remote-tracking branch 'origin/master' into nightly 2023-09-05 14:26:16 +00:00
Emad Rad
f2fb5680eb doc: course visibility section added 2023-09-05 16:21:02 +02:00
Overhang.IO
b83745a77c Merge remote-tracking branch 'origin/master' into nightly 2023-06-27 14:56:36 +00:00
Régis Behmo
9ce82f787e feat: don't override imagepullpolicy on k8s 2023-06-27 16:40:11 +02:00
Régis Behmo
1ee7014960 fix: development status is stable 2023-06-27 15:53:57 +02:00
Overhang.IO
fd44a2d9eb Merge remote-tracking branch 'origin/master' into nightly 2023-06-14 23:34:57 +00:00
Régis Behmo
56de7a8f5b ci: fix release name 2023-06-15 01:33:15 +02:00
Régis Behmo
3b2b0546ec Merge branch 'master' into nightly 2023-06-15 00:27:11 +02:00
Régis Behmo
d7cbce8467 fix: nightly package version
The package version number may not include the "-nightly" suffix.
Otherwise, installation fails with:

   setuptools.extern.packaging.version.InvalidVersion: Invalid version: '15.0.7-nightly'
2023-05-26 18:47:48 +02:00
Régis Behmo
32ce115a27 feat: label nightly version
This is to address https://github.com/overhangio/tutor-mfe/issues/122
As a consequence of this change, images will be tagged with a "-nightly"
suffix. Next, we'll probably have to build them periodically in CI.
2023-05-26 18:26:28 +02:00
Overhang.IO
a1a9aeb7a3 Merge remote-tracking branch 'origin/master' into nightly 2023-05-26 14:54:33 +00:00
Overhang.IO
a92475e07b Merge remote-tracking branch 'origin/master' into nightly 2023-05-26 14:39:24 +00:00
Overhang.IO
772939d992 Merge remote-tracking branch 'origin/master' into nightly 2023-05-22 07:42:39 +00:00
Overhang.IO
1f9450c177 Merge remote-tracking branch 'origin/master' into nightly 2023-05-19 14:27:41 +00:00
Overhang.IO
71d8643480 Merge remote-tracking branch 'origin/master' into nightly 2023-05-17 08:29:11 +00:00
Overhang.IO
3f9987eeff Merge remote-tracking branch 'origin/master' into nightly 2023-05-16 08:13:56 +00:00
Overhang.IO
c1ddb65cb5 Merge remote-tracking branch 'origin/master' into nightly 2023-02-27 11:10:55 +00:00
Régis Behmo
dac6dd5418 Merge branch 'master' into nightly 2022-12-12 18:52:13 +01:00
Overhang.IO
f3d48d742a Merge remote-tracking branch 'origin/master' into nightly 2022-11-25 15:26:37 +00:00
Overhang.IO
fdf79fa0e4 Merge remote-tracking branch 'origin/master' into nightly 2022-11-25 15:15:41 +00:00
Régis Behmo
8572483d95 docs: make it clear who is maintaining this plugin 2022-11-10 16:28:17 +01:00
Carlos Muniz
999fe79a29 docs: change quickstart to launch
This change is due to renaming quickstart to launch in tutor.
2022-10-03 14:02:39 +02:00
18 changed files with 382 additions and 140 deletions

View File

@ -0,0 +1,20 @@
name: Auto Add Issues and Pull Requests to Project
on:
issues:
types:
- opened
pull_request_target:
types:
- opened
jobs:
# https://github.com/actions/add-to-project
add-to-project:
name: Add issue and bugs to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v1.0.2
with:
project-url: https://github.com/orgs/overhangio/projects/4
github-token: ${{ secrets.GH_PROJECT_PERSONAL_ACCESS_TOKEN }}

View File

@ -2,13 +2,13 @@ name: Sync with private repo
on:
push:
branches: [ master, main, nightly ]
branches: [ release, main ]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add remote

25
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: Run tests
on:
pull_request:
branches: [ release, main ]
push:
branches: [ release, main ]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install .[dev]
- name: Test lint, types, and format
run: make test

View File

@ -2,9 +2,7 @@ variables:
TUTOR_PLUGIN: android
TUTOR_IMAGES: android
TUTOR_PYPI_PACKAGE: tutor-android
OPENEDX_RELEASE: olive
GITHUB_REPO: overhangio/tutor-android
IMAGES_BUILD_PLATFORM: "linux/amd64"
include:
- project: 'community/tutor-ci'

22
.hatch_build.py Normal file
View File

@ -0,0 +1,22 @@
# https://hatch.pypa.io/latest/how-to/config/dynamic-metadata/
import os
import typing as t
from hatchling.metadata.plugin.interface import MetadataHookInterface
HERE = os.path.dirname(__file__)
class MetaDataHook(MetadataHookInterface):
def update(self, metadata: dict[str, t.Any]) -> None:
about = load_about()
metadata["version"] = about["__version__"]
def load_about() -> dict[str, str]:
about: dict[str, str] = {}
with open(
os.path.join(HERE, "tutorandroid", "__about__.py"), "rt", encoding="utf-8"
) as f:
exec(f.read(), about)
return about

View File

@ -19,6 +19,48 @@ instructions, because git commits are used to generate release notes:
<!-- scriv-insert-here -->
<a id='changelog-20.0.0'></a>
## v20.0.0 (2025-06-10)
- [Improvement] Migrate packaging from setup.py/setuptools to pyproject.toml/hatch. (by @Abdul-Muqadim-Arbisoft)
- For more details view tutor core PR: https://github.com/overhangio/tutor/pull/1163
- [Improvement] Add hatch_build.py in sdist target to fix the installation issues (by @dawoudsheraz)
- 💥[Feature] Upgrade to teak. (by @Abdul-Muqadim-Arbisoft)
<a id='changelog-19.0.0'></a>
## v19.0.0 (2024-12-09)
- 💥[Feature] Upgrade to Sumac (by @Abdul-Muqadim-Arbisoft)
<a id='changelog-18.0.1'></a>
## v18.0.1 (2024-11-28)
- [Bugfix] Fix legacy warnings during Docker build. (by @regisb)
- 💥[Feature] Update android image to use Ubuntu `24.04` as base OS. (by @Abdul-Muqadim-Arbisoft)
- 💥 [Deprecation] Drop support for python 3.8 and set Python 3.9 as the minimum supported python version. (by @Abdul-Muqadim-Arbisoft)
- 💥[Improvement] Rename Tutor's two branches (by @DawoudSheraz):
* Rename **master** to **release**, as this branch runs the latest official Open edX release tag.
* Rename **nightly** to **main**, as this branch runs the Open edX master branches, which are the basis for the next Open edX release.
<a id='changelog-18.0.0'></a>
## v18.0.0 (2024-06-20)
- 💥[Feature] Upgrade to redwood (by @dawoudsheraz)
- [Bugfix] Make plugin compatible with Python 3.12 by removing dependency on `pkg_resources`. (by @regisb)
- 💥[Feature] Upgrade the deprecated [edx-app-android](https://github.com/openedx-unsupported/edx-app-android) to [openedx-app-android](https://github.com/openedx/openedx-app-android). (by @hamza-56)
- [Feature] Update the tutor.yaml configuration to align with the new apps default settings. See the default configuration here: [default_config/prod/config.yaml](https://github.com/openedx/openedx-app-android/blob/main/default_config/prod/config.yaml) (by @cmltawt0).
- [Feature] Enhanced `ANDROID_APP_VERSION` logic to dynamically set the version based on `OPENEDX_COMMON_VERSION`: for nightly builds, `ANDROID_APP_VERSION` is set to main. For other builds, `ANDROID_APP_VERSION` is set to the value of `OPENEDX_COMMON_VERSION`. (by @hamza-56)
<a id='changelog-17.0.0'></a>
## v17.0.0 (2023-12-09)
- 💥 [Feature] Upgrade to Quince (by @muhammadali286).
- The nightly branch will now build the master branch of the edx-app-android repository. (by @regisb)
- [Improvement] Added Typing to code, Makefile and test action to the repository and formatted code with Black and isort. (by @CodeWithEmad)
<a id='changelog-16.0.0'></a>
## v16.0.0 (2023-06-14)

View File

@ -1,2 +0,0 @@
recursive-include tutorandroid/patches *
recursive-include tutorandroid/templates *

42
Makefile Normal file
View File

@ -0,0 +1,42 @@
.DEFAULT_GOAL := help
.PHONY: docs
SRC_DIRS = ./tutorandroid
# Warning: These checks are not necessarily run on every PR.
test: test-lint test-types test-format test-pythonpackage # Run some static checks.
test-format: ## Run code formatting tests
ruff format --check --diff ${SRC_DIRS}
test-lint: ## Run code linting tests
ruff check ${SRC_DIRS}
test-types: ## Run type checks.
mypy --exclude=templates --ignore-missing-imports --implicit-reexport --strict ${SRC_DIRS}
build-pythonpackage: ## Build the "tutor-android" python package for upload to pypi
python -m build --sdist
test-pythonpackage: build-pythonpackage ## Test that package can be uploaded to pypi
twine check dist/tutor_android-$(shell make version).tar.gz
format: ## Format code automatically
ruff format ${SRC_DIRS}
fix-lint: ## Fix lint errors automatically
ruff check --fix ${SRC_DIRS}
changelog-entry: ## Create a new changelog entry.
scriv create
changelog: ## Collect changelog entries in the CHANGELOG.md file.
scriv collect
version: ## Print the current tutor-android version
@python -c 'import io, os; about = {}; exec(io.open(os.path.join("tutorandroid", "__about__.py"), "rt", encoding="utf-8").read(), about); print(about["__version__"])'
ESCAPE = 
help: ## Print this help
@grep -E '^([a-zA-Z_-]+:.*?## .*|######* .+)$$' Makefile \
| sed 's/######* \(.*\)/@ $(ESCAPE)[1;31m\1$(ESCAPE)[0m/g' | tr '@' '\n' \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[33m%-30s\033[0m %s\n", $$1, $$2}'

View File

@ -1,4 +1,4 @@
Android application plugin for `Tutor <https://docs.tutor.overhang.io>`__
Android application plugin for `Tutor <https://docs.tutor.edly.io>`__
=========================================================================
This is a plugin to easily build an Android mobile application for your `Open edX <https://open.edx.org>`__ instance.
@ -18,24 +18,29 @@ Enable the plugin and start the platform::
tutor plugins enable android
tutor local launch
The ``.apk`` file will then be available for download at http(s)://mobile.LMS_HOST/app.apk. When running locally, this will be: http://mobile.local.overhang.io/app.apk. You can forward this address to your students for download.
The ``.apk`` file will then be available for download at http(s)://mobile.LMS_HOST/app.apk. When running locally, this will be: http://mobile.local.openedx.io/app.apk. You can forward this address to your students for download.
Building a custom Android app
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Android app is built from the `official edx-app-android repository <https://github.com/edx/edx-app-android/>`__. To change this repository or the app version, you can simply build a different docker image with::
The Android app is built from the `official openedx-app-android repository <https://github.com/openedx/openedx-app-android/>`__. To change this repository or the app version, you can simply build a different docker image with::
tutor images build \
--build-arg ANDROID_APP_REPOSITORY=https://github.com/mycustomfork/edx-app-android \
--build-arg ANDROID_APP_REPOSITORY=https://github.com/mycustomfork/openedx-app-android \
--build-arg ANDROID_APP_VERSION=master \
android
Alternatively, you can build an image from a local checked-out fork of edx-app-android::
Alternatively, you can build an image from a local checked-out fork of openedx-app-android::
tutor mounts add /path/to/edx-app-android
tutor mounts add /path/to/openedx-app-android
tutor local launch
Making courses visible in app
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By default, courses are not visible in the mobile app. To make them available, go to Studio → YOUR COURSE → Settings → Advanced Settings and set ``Mobile Course Available`` to true.
Releasing an Android app
~~~~~~~~~~~~~~~~~~~~~~~~
@ -61,9 +66,9 @@ Customising the application, such as the logo or the background image, is curren
Troubleshooting
---------------
This Tutor plugin is maintained by Régis Behmo from `Overhang.IO <https://overhang.io>`__. Community support is available from the official `Open edX forum <https://discuss.openedx.org>`__. Do you need help with this plugin? See the `troubleshooting <https://docs.tutor.overhang.io/troubleshooting.html>`__ section from the Tutor documentation.
This Tutor plugin is maintained by Abdul-Muqadim from `Edly <https://edly.io>`__. Community support is available from the official `Open edX forum <https://discuss.openedx.org>`__. Do you need help with this plugin? See the `troubleshooting <https://docs.tutor.edly.io/troubleshooting.html>`__ section from the Tutor documentation.
License
-------
This software is licensed under the terms of the AGPLv3.
This work is licensed under the terms of the `GNU Affero General Public License (AGPL) <https://github.com/overhangio/tutor-android/blob/release/LICENSE.txt>`_.

View File

@ -0,0 +1,2 @@
- [Improvement] Migrate from pylint and black to ruff. (by @Abdul-Muqadim-Arbisoft)
- [Improvement] Test python package distribution build when running make test. (by @Abdul-Muqadim-Arbisoft)

View File

@ -1,2 +1,83 @@
# https://packaging.python.org/en/latest/tutorials/packaging-projects/
# https://hatch.pypa.io/latest/config/build/
[project]
name = "tutor-android"
license = { text = "AGPL-3.0-only" }
authors = [
{ name = "Edly" },
{ email = "hello@edly.io" }
]
maintainers = [
{ name = "Abdul-Muqadim" },
{ email = "abdul.muqadim@arbisoft.com" }
]
description = "Android mobile app plugin for Tutor"
readme = { file = "README.rst", content-type = "text/x-rst" }
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"tutor>=20.0.0,<21.0.0"
]
# Version will be dynamically loaded from __about__.py
dynamic = ["version"]
[project.optional-dependencies]
dev = [
"tutor[dev]>=20.0.0,<21.0.0",
"ruff",
]
[project.entry-points."tutor.plugin.v1"]
android = "tutorandroid.plugin"
# URLs for documentation and issue tracking
[project.urls]
Homepage = "https://github.com/overhangio/tutor-android"
Documentation = "https://github.com/overhangio/tutor-android"
Code = "https://github.com/overhangio/tutor-android"
Issues = "https://github.com/overhangio/tutor-android/issues"
Community = "https://discuss.openedx.org/tag/tutor"
# Hatch-specific configuration
[tool.hatch.metadata.hooks.custom]
path = ".hatch_build.py"
[build-system]
requires = ["setuptools", "wheel"]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.sdist]
# Disable strict naming for twine compatibility
strict-naming = false
include = [ "/tutorandroid", '.hatch_build.py' ]
exclude = [ "tests*" ]
[tool.hatch.build.targets.wheel]
packages = ["tutorandroid"]
[tool.ruff]
exclude = ["templates", "docs/_ext"]
[tool.ruff.lint]
# E: pycodestyle errors
# I: isort
# N: pep8-naming
select = ["E", "I", "N"]
# F401: unused-import
# F841: unused-variable
# W292: missing-newline-at-end-of-file
extend-select = ["F401", "F841", "W292"]
[tool.ruff.format]

View File

@ -1,63 +0,0 @@
import io
import os
from setuptools import setup, find_packages
HERE = os.path.abspath(os.path.dirname(__file__))
def load_readme():
with io.open(os.path.join(HERE, "README.rst"), "rt", encoding="utf8") as f:
return f.read()
def load_about():
about = {}
with io.open(
os.path.join(HERE, "tutorandroid", "__about__.py"),
"rt",
encoding="utf-8",
) as f:
exec(f.read(), about) # pylint: disable=exec-used
return about
ABOUT = load_about()
setup(
name="tutor-android",
version=ABOUT["__version__"],
url="https://github.com/overhangio/tutor-android",
project_urls={
"Code": "https://github.com/overhangio/tutor-android",
"Issue tracker": "https://github.com/overhangio/tutor-android/issues",
"Community": "https://discuss.openedx.org",
},
license="AGPLv3",
author="Overhang.IO",
author_email="contact@overhang.io",
maintainer="Overhang.IO",
maintainer_email="regis@overhang.io",
description="Android mobile app plugin for Tutor",
long_description=load_readme(),
packages=find_packages(exclude=["tests*"]),
include_package_data=True,
python_requires=">=3.8",
install_requires=["tutor>=16.0.0,<17.0.0"],
entry_points={
"tutor.plugin.v1": [
"android = tutorandroid.plugin"
]
},
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
)

View File

@ -1,8 +1 @@
__version__ = "16.0.0"
# Handle version suffix for nightly, just like tutor core.
__version_suffix__ = ""
if __version_suffix__:
__version__ += "-" + __version_suffix__
__version__ = "20.0.0"

View File

@ -15,12 +15,11 @@ spec:
app.kubernetes.io/name: android-app
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
runAsUser: {{ APP_USER_ID }}
runAsGroup: {{ APP_USER_ID }}
containers:
- name: android-app
image: {{ ANDROID_APP_DOCKER_IMAGE }}
imagePullPolicy: Always
ports:
- containerPort: 8000
securityContext:

View File

@ -1,35 +1,43 @@
from __future__ import annotations
from glob import glob
import os
import typing as t
from glob import glob
import pkg_resources
import importlib_resources
from tutor import hooks as tutor_hooks
from tutor.__about__ import __version_suffix__
from tutor.types import Config, get_typed
from .__about__ import __version__
config = {
"unique": {"OAUTH2_SECRET": "{{ 24|random_string }}"},
# Handle version suffix in main mode, just like tutor core
if __version_suffix__:
__version__ += "-" + __version_suffix__
config: t.Dict[str, t.Dict[str, t.Any]] = {
"defaults": {
"VERSION": __version__,
"APP_HOST": "mobile.{{ LMS_HOST }}",
# Version 4.0.0 is not working:
# https://github.com/overhangio/tutor-android/pull/6#issuecomment-1541510489
"APP_VERSION": "3.1.4",
"DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android:{{ ANDROID_VERSION }}",
"APP_DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android-app:{{ ANDROID_VERSION }}",
"DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android:{{ ANDROID_VERSION }}", # noqa: E501
"APP_DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android-app:{{ ANDROID_VERSION }}", # noqa: E501
"ENABLE_RELEASE_MODE": False,
"RELEASE_STORE_PASSWORD": "android store password",
"RELEASE_KEY_PASSWORD": "android release key password",
"RELEASE_KEY_ALIAS": "android release key alias",
},
"unique": {
"OAUTH2_SECRET": "{{ 24|random_string }}",
},
}
with open(
os.path.join(
pkg_resources.resource_filename("tutorandroid", "templates"),
str(importlib_resources.files("tutorandroid") / "templates"),
"android",
"tasks",
"lms",
@ -63,7 +71,9 @@ tutor_hooks.Filters.IMAGES_BUILD.add_items(
@tutor_hooks.Filters.IMAGES_PULL.add()
@tutor_hooks.Filters.IMAGES_PUSH.add()
def _add_remote_android_app_image_iff_customized(images, user_config):
def _add_remote_android_app_image_iff_customized(
images: list[tuple[str, str]], user_config: Config
) -> list[tuple[str, str]]:
"""
Register ANDROID-APP image for pushing & pulling if and only if it has
been set to something other than the default.
@ -75,7 +85,7 @@ def _add_remote_android_app_image_iff_customized(images, user_config):
to push/pull the ANDROID-APP image if the user has customized it to anything
other than the default image URL.
"""
image_tag = user_config["ANDROID_APP_DOCKER_IMAGE"]
image_tag = get_typed(user_config, "ANDROID_APP_DOCKER_IMAGE", str, "")
if not image_tag.startswith("docker.io/overhangio/openedx-android-app:"):
# Image has been customized. Add to list for pulling/pushing.
images.append(("android-app", image_tag))
@ -106,9 +116,9 @@ def _build_custom_android_app(
mounts: list[tuple[str, str]], host_path: str
) -> list[tuple[str, str]]:
path_basename = os.path.basename(host_path)
if path_basename == "edx-app-android":
if path_basename == "openedx-app-android":
# Bind-mount repo at build-time
mounts.append(("android", "edx-app-android"))
mounts.append(("android", "openedx-app-android"))
return mounts
@ -123,10 +133,9 @@ def _print_android_app_public_hosts(
return hostnames
####### Boilerplate code
# Add the "templates" folder as a template root
tutor_hooks.Filters.ENV_TEMPLATE_ROOTS.add_item(
pkg_resources.resource_filename("tutorandroid", "templates")
str(importlib_resources.files("tutorandroid") / "templates")
)
# Render the "build" and "apps" folders
tutor_hooks.Filters.ENV_TEMPLATE_TARGETS.add_items(
@ -138,7 +147,7 @@ tutor_hooks.Filters.ENV_TEMPLATE_TARGETS.add_items(
# Load patches from files
for path in glob(
os.path.join(
pkg_resources.resource_filename("tutorandroid", "patches"),
str(importlib_resources.files("tutorandroid") / "patches"),
"*",
)
):

View File

@ -1,11 +1,12 @@
FROM docker.io/ubuntu:22.04 AS base
# syntax=docker/dockerfile:1
FROM docker.io/ubuntu:24.04 AS base
LABEL maintainer="Overhang.IO <contact@overhang.io>"
ENV DEBIAN_FRONTEND=noninteractive
RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked {% endif %}apt update && \
apt upgrade -y && \
apt install -y wget unzip git openjdk-11-jre openjdk-11-jdk
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked apt update && \
apt upgrade -y && \
apt install -y wget unzip git openjdk-17-jre openjdk-17-jdk
RUN mkdir /app
@ -15,9 +16,9 @@ FROM base AS sdk
# Install Android SDK
# Inspired from https://github.com/LiveXP/docker-android-sdk/blob/master/Dockerfile
# Get sdk version from here: https://developer.android.com/studio#command-tools
ENV ANDROID_SDK_VERSION 9477386
ENV ANDROID_SDK_PATH /app/android-sdk
ENV ANDROID_HOME /app/android-sdk
ENV ANDROID_SDK_VERSION=11076708
ENV ANDROID_SDK_PATH=/app/android-sdk
ENV ANDROID_HOME=/app/android-sdk
RUN mkdir ${ANDROID_HOME}
WORKDIR /app/android-sdk
RUN wget --quiet https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip && \
@ -27,47 +28,50 @@ RUN wget --quiet https://dl.google.com/android/repository/commandlinetools-linux
# Accept licenses
# https://developer.android.com/studio/command-line/sdkmanager
# Check target version: https://github.com/edx/edx-app-android/blob/master/constants.gradle
ARG ANDROID_API_LEVEL=31
ARG ANDROID_API_LEVEL=34
RUN yes | /app/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} --install "platforms;android-$ANDROID_API_LEVEL" 1> /dev/null
###### Checkout code
FROM base AS code
# Install android app repo
ARG ANDROID_APP_REPOSITORY=https://github.com/openedx/edx-app-android
ARG ANDROID_APP_VERSION=release/{{ ANDROID_APP_VERSION }}
RUN git clone $ANDROID_APP_REPOSITORY --branch $ANDROID_APP_VERSION /app/edx-app-android
ARG ANDROID_APP_REPOSITORY=https://github.com/openedx/openedx-app-android.git
ARG ANDROID_APP_VERSION={% if OPENEDX_COMMON_VERSION == "master" %}main{% else %}{{ OPENEDX_COMMON_VERSION }}{% endif %}
ADD --keep-git-dir $ANDROID_APP_REPOSITORY#$ANDROID_APP_VERSION /app/openedx-app-android
###### Empty layer to mount custom repo at build time
FROM scratch AS edx-app-android
COPY --from=code /app/edx-app-android /
FROM scratch AS openedx-app-android
COPY --from=code /app/openedx-app-android /
###### Common layer, which will be used to build the user-specific image later
FROM sdk AS common
COPY --from=edx-app-android / /app/edx-app-android
WORKDIR /app/edx-app-android
COPY --from=openedx-app-android / /app/openedx-app-android
WORKDIR /app/openedx-app-android
# Install gradle and all dependencies
RUN ./gradlew -v
RUN ./gradlew tasks
###### Build image with app-specific settings
FROM common as build
FROM common AS build
# User-customized config
COPY ./config/edx.properties ./OpenEdXMobile/default_config/edx.properties
COPY ./config/tutor.yaml ./OpenEdXMobile/default_config/tutor.yaml
COPY ./config/tutor.yaml ./default_config/dev/config.yaml
COPY ./config/tutor.yaml ./default_config/stage/config.yaml
COPY ./config/tutor.yaml ./default_config/prod/config.yaml
{% if ANDROID_ENABLE_RELEASE_MODE %}
# Add release settings
COPY ./config/gradle.properties ./gradle.properties.tutor
RUN cat ./gradle.properties.tutor >> ./gradle.properties
{% endif %}
RUN sed -i "s/APPLICATION_ID = .*/APPLICATION_ID = \"{{ LMS_HOST|reverse_host|replace("-", "_") }}\"/g" constants.gradle
RUN ./gradlew assembleProd{{ "Release" if ANDROID_ENABLE_RELEASE_MODE else "Debuggable" }}
# uncomment this line for for release APK.
# RUN sed -i "s/APPLICATION_ID = .*/APPLICATION_ID = \"{{ LMS_HOST|reverse_host|replace("-", "_") }}\"/g" constants.gradle
RUN ./gradlew assembleProd{{ "Release" if ANDROID_ENABLE_RELEASE_MODE else "Debug" }}
# ./gradlew assembleProdRelease
#### File server to serve apk file
# https://hub.docker.com/_/caddy?tab=tags
FROM docker.io/caddy:2.6.4-alpine as production
COPY --from=build /app/edx-app-android/OpenEdXMobile/build/outputs/apk/prod/{{ "release" if ANDROID_ENABLE_RELEASE_MODE else "debuggable" }}/edx-{{ "release" if ANDROID_ENABLE_RELEASE_MODE else "debuggable" }}-{{ ANDROID_APP_VERSION }}.apk /srv/app.apk
FROM docker.io/caddy:2.6.4-alpine AS production
COPY --from=build /app/openedx-app-android/app/build/outputs/apk/prod/{{ "release" if ANDROID_ENABLE_RELEASE_MODE else "debug" }}/app-prod-{{ "release" if ANDROID_ENABLE_RELEASE_MODE else "debug" }}.apk /srv/app.apk
CMD caddy file-server --listen=:8000 --root=/srv

View File

@ -1,4 +1,4 @@
RELEASE_STORE_FILE=/app/edx-app-android/OpenEdXMobile/app.keystore
RELEASE_STORE_FILE=/app/openedx-app-android/app.keystore
RELEASE_STORE_PASSWORD={{ ANDROID_RELEASE_STORE_PASSWORD }}
RELEASE_KEY_PASSWORD={{ ANDROID_RELEASE_KEY_PASSWORD }}
RELEASE_KEY_ALIAS={{ ANDROID_RELEASE_KEY_ALIAS }}

View File

@ -1,18 +1,83 @@
# See docs: https://openedx.atlassian.net/wiki/spaces/LEARNER/pages/48792067/App+Configuration+Flags
API_HOST_URL: "{{ "https" if ENABLE_HTTPS else "http" }}://{{ LMS_HOST }}"
APPLICATION_ID: 'org.openedx.app'
ENVIRONMENT_DISPLAY_NAME: "tutor"
PLATFORM_NAME: "{{ PLATFORM_NAME }}"
PLATFORM_DESTINATION_NAME: "{{ LMS_HOST }}"
URI_SCHEME: ''
FEEDBACK_EMAIL_ADDRESS: "{{ CONTACT_EMAIL }}"
FAQ_URL: ''
OAUTH_CLIENT_ID: "android"
COURSE_VIDEOS_ENABLED: true
CERTIFICATES_ENABLED: true
DISCUSSIONS_ENABLED: true
# Keep empty to hide setting
AGREEMENT_URLS:
PRIVACY_POLICY_URL: ''
COOKIE_POLICY_URL: ''
DATA_SELL_CONSENT_URL: ''
TOS_URL: ''
EULA_URL: ''
SUPPORTED_LANGUAGES: [ ] #en is default language
DISCOVERY:
COURSE:
TYPE: native
DOWNLOAD_TO_SD_CARD_ENABLED: true
NEW_LOGISTRATION_ENABLED: true
USER_PROFILES_ENABLED : true
VIDEO_TRANSCRIPT_ENABLED: true
TYPE: 'native'
WEBVIEW:
BASE_URL: ''
COURSE_DETAIL_TEMPLATE: ''
PROGRAM_DETAIL_TEMPLATE: ''
PROGRAM:
TYPE: 'native'
WEBVIEW:
PROGRAM_URL: ''
PROGRAM_DETAIL_URL_TEMPLATE: ''
FIREBASE:
ENABLED: false
ANALYTICS_SOURCE: '' # segment | none
CLOUD_MESSAGING_ENABLED: false
PROJECT_NUMBER: ''
PROJECT_ID: ''
APPLICATION_ID: '' #App ID field from the Firebase console or mobilesdk_app_id from the google-services.json file.
API_KEY: ''
SEGMENT_IO:
ENABLED: false
SEGMENT_IO_WRITE_KEY: ''
BRAZE:
ENABLED: false
PUSH_NOTIFICATIONS_ENABLED: false
GOOGLE:
ENABLED: false
CLIENT_ID: ''
MICROSOFT:
ENABLED: false
CLIENT_ID: ''
PACKAGE_SIGNATURE: ''
FACEBOOK:
ENABLED: false
FACEBOOK_APP_ID: ''
CLIENT_TOKEN: ''
BRANCH:
ENABLED: false
KEY: ''
URI_SCHEME: ''
HOST: ''
ALTERNATE_HOST: ''
#Platform names
PLATFORM_NAME: "{{ PLATFORM_NAME }}"
PLATFORM_FULL_NAME: "{{ PLATFORM_NAME }}"
#App sourceSets dir
THEME_DIRECTORY: "openedx"
#tokenType enum accepts JWT and BEARER only
TOKEN_TYPE: "JWT"
#feature flag for activating Whats New feature
WHATS_NEW_ENABLED: false
#feature flag enable Social Login buttons
SOCIAL_AUTH_ENABLED: false
#Course navigation feature flags
COURSE_NESTED_LIST_ENABLED: false
COURSE_UNIT_PROGRESS_ENABLED: false