Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be36969dce | ||
|
|
25fa14e030 | ||
|
|
8b682f0902 | ||
|
|
a539ca2693 | ||
|
|
cfee151f6b | ||
|
|
78b29f1ec6 | ||
|
|
7b4af1f15c | ||
|
|
c2ba1b57fd | ||
|
|
243bbeb79a | ||
|
|
05fc54b68d | ||
|
|
8fa95c708f | ||
|
|
46ed8a91cd | ||
|
|
8d04f8ac02 | ||
|
|
ca03a2f844 | ||
|
|
1d87ec5193 | ||
|
|
5d2e945a15 | ||
|
|
bef534a00d | ||
|
|
aa1c67a6a3 | ||
|
|
b7af7ba707 | ||
|
|
d43952befb | ||
|
|
cb789e8604 | ||
|
|
af56259343 | ||
|
|
519062a168 | ||
|
|
097ad05609 | ||
|
|
5648bc4829 | ||
|
|
3f19e83300 | ||
|
|
96404d74c0 | ||
|
|
446587b788 | ||
|
|
b8281e51dc | ||
|
|
2dd92f1801 | ||
|
|
dde6ed73dc | ||
|
|
95d7c74377 | ||
|
|
145ac9519a |
7
.github/workflows/auto-add-to-project.yml
vendored
7
.github/workflows/auto-add-to-project.yml
vendored
@ -1,9 +1,12 @@
|
||||
name: Auto Add Issues to Project
|
||||
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
|
||||
@ -11,7 +14,7 @@ jobs:
|
||||
name: Add issue and bugs to project
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/add-to-project@v0.5.0
|
||||
- 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 }}
|
||||
|
||||
4
.github/workflows/sync.yml
vendored
4
.github/workflows/sync.yml
vendored
@ -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
|
||||
|
||||
10
.github/workflows/test.yml
vendored
10
.github/workflows/test.yml
vendored
@ -2,22 +2,22 @@ name: Run tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master]
|
||||
branches: [ release, main ]
|
||||
push:
|
||||
branches: [ release, main ]
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.8', '3.12']
|
||||
python-version: ['3.9', '3.12']
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Upgrade pip
|
||||
run: python -m pip install --upgrade pip setuptools
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install .[dev]
|
||||
|
||||
22
.hatch_build.py
Normal file
22
.hatch_build.py
Normal 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
|
||||
25
CHANGELOG.md
25
CHANGELOG.md
@ -19,6 +19,31 @@ 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)
|
||||
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
recursive-include tutorandroid/patches *
|
||||
recursive-include tutorandroid/templates *
|
||||
24
Makefile
24
Makefile
@ -1,25 +1,30 @@
|
||||
.DEFAULT_GOAL := help
|
||||
.PHONY: docs
|
||||
SRC_DIRS = ./tutorandroid
|
||||
BLACK_OPTS = --exclude templates ${SRC_DIRS}
|
||||
|
||||
# Warning: These checks are not necessarily run on every PR.
|
||||
test: test-lint test-types test-format # Run some static checks.
|
||||
test: test-lint test-types test-format test-pythonpackage # Run some static checks.
|
||||
|
||||
test-format: ## Run code formatting tests
|
||||
black --check --diff $(BLACK_OPTS)
|
||||
ruff format --check --diff ${SRC_DIRS}
|
||||
|
||||
test-lint: ## Run code linting tests
|
||||
pylint --errors-only --enable=unused-import,unused-argument --ignore=templates --ignore=docs/_ext ${SRC_DIRS}
|
||||
ruff check ${SRC_DIRS}
|
||||
|
||||
test-types: ## Run type checks.
|
||||
mypy --exclude=templates --ignore-missing-imports --implicit-reexport --strict ${SRC_DIRS}
|
||||
|
||||
format: ## Format code automatically
|
||||
black $(BLACK_OPTS)
|
||||
build-pythonpackage: ## Build the "tutor-android" python package for upload to pypi
|
||||
python -m build --sdist
|
||||
|
||||
isort: ## Sort imports. This target is not mandatory because the output may be incompatible with black formatting. Provided for convenience purposes.
|
||||
isort --skip=templates ${SRC_DIRS}
|
||||
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
|
||||
@ -27,6 +32,9 @@ changelog-entry: ## Create a new changelog entry.
|
||||
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 \
|
||||
|
||||
@ -18,7 +18,7 @@ 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.edly.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
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@ -66,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.edly.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>`_.
|
||||
|
||||
@ -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)
|
||||
@ -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]
|
||||
|
||||
65
setup.py
65
setup.py
@ -1,65 +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>=18.0.0,<19.0.0"],
|
||||
extras_require={"dev": ["tutor[dev]>=18.0.0,<19.0.0"]},
|
||||
entry_points={
|
||||
"tutor.plugin.v1": [
|
||||
"android = tutorandroid.plugin"
|
||||
]
|
||||
},
|
||||
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.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
],
|
||||
)
|
||||
@ -1 +1 @@
|
||||
__version__ = "18.0.0"
|
||||
__version__ = "20.0.0"
|
||||
|
||||
@ -15,8 +15,8 @@ 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 }}
|
||||
|
||||
@ -11,7 +11,7 @@ from tutor.types import Config, get_typed
|
||||
|
||||
from .__about__ import __version__
|
||||
|
||||
# Handle version suffix in nightly mode, just like tutor core
|
||||
# Handle version suffix in main mode, just like tutor core
|
||||
if __version_suffix__:
|
||||
__version__ += "-" + __version_suffix__
|
||||
|
||||
@ -23,8 +23,8 @@ config: t.Dict[str, t.Dict[str, t.Any]] = {
|
||||
# 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",
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM docker.io/ubuntu:23.10 AS base
|
||||
FROM docker.io/ubuntu:24.04 AS base
|
||||
LABEL maintainer="Overhang.IO <contact@overhang.io>"
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
@ -16,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 11076708
|
||||
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 && \
|
||||
@ -53,7 +53,7 @@ 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/tutor.yaml ./default_config/dev/config.yaml
|
||||
@ -72,6 +72,6 @@ RUN ./gradlew assembleProd{{ "Release" if ANDROID_ENABLE_RELEASE_MODE else "Debu
|
||||
|
||||
#### File server to serve apk file
|
||||
# https://hub.docker.com/_/caddy?tab=tags
|
||||
FROM docker.io/caddy:2.6.4-alpine as production
|
||||
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
|
||||
|
||||
@ -68,7 +68,7 @@ BRANCH:
|
||||
ALTERNATE_HOST: ''
|
||||
|
||||
#Platform names
|
||||
PLATFORM_NAME: "{{ PLATFORM_NAME }}"
|
||||
PLATFORM_NAME: "{{ PLATFORM_NAME }}"
|
||||
PLATFORM_FULL_NAME: "{{ PLATFORM_NAME }}"
|
||||
#App sourceSets dir
|
||||
THEME_DIRECTORY: "openedx"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user