Skip to content

Commit

Permalink
perf: add compatibility with palm release (#49)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: add compatibility with palm release

* ci: update workflow dependencies

* docs: update README

* build: update plugin requirements

* fix: message_control enabled weren't being used

* refactor: allow 120 characters per line when pylint is executed

* feat: override get_dirs method

* chore: increase eox-tenant version

* fix: gh-action-pypi-publish version

---------

Co-authored-by: andrey-canon <[email protected]>
  • Loading branch information
bra-i-am and andrey-canon authored Nov 20, 2023
1 parent 4b1b2d2 commit c476ceb
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 168 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bumpversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
default_prerelease_bump: false
dry_run: true
- name: Set up Python 3.8
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Create bumpversion
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Commit bumpversion
id: bumpversion
if: steps.tag_version.outputs.new_version
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: ${{ github.ref }}
commit_message: "docs(bumpversion): ${{ steps.tag_version.outputs.previous_tag }} → ${{ steps.tag_version.outputs.new_version }}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4.1.12
- uses: wagoid/commitlint-github-action@v5.4.4
2 changes: 1 addition & 1 deletion .github/workflows/pr_issue_assignment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Auto-assign PR-Issue'
uses: pozil/auto-assign-issue@v1.5.0
uses: pozil/auto-assign-issue@v1.13.0
with:
repo-token: ${{ secrets.DEDALO_PAT }}
teams: theming
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
Expand All @@ -34,7 +34,7 @@ jobs:
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

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

- name: Cache dependency
uses: actions/cache@v3
Expand All @@ -26,7 +26,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Compatibility Notes
+------------------+---------------------+
| Olive | >= 5.0 |
+------------------+---------------------+
| Palm | >= 6.0 |
+------------------+---------------------+

**NOTE**: From Lilac version Django 2.2 is not supported, you should use Django 3.2 and eox-tenant >=4.0.

Expand Down Expand Up @@ -56,8 +58,8 @@ Koa (optional)**
EOX_THEMING_EDXMAKO_BACKEND = 'eox_theming.edxapp_wrapper.backends.l_mako'
Lilac - Maple - Nutmeg - Olive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lilac - Maple - Nutmeg - Olive - Palm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: bash
Expand Down
15 changes: 15 additions & 0 deletions eox_theming/theming/template_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class EoxThemeTemplateLoader(OpenedxThemeLoader):
See: openedx.core.djangoapps.theming.template_loaders.py
"""

def __init__(self, *args):
MakoLoader.__init__(self, EoxThemeFilesystemLoader(*args))

Expand Down Expand Up @@ -79,3 +80,17 @@ def get_grandparent_theme_template_sources():
return grandparent_theme.template_dirs

return template_paths

def get_dirs(self):
"""This overrides the default get_dirs method from django
https://github.com/django/django/blob/3.2/django/template/loaders/filesystem.py#L18
due to the django implementation depends on the initialization process that is performed by
the sub-class ThemeFilesystemLoader
https://github.com/eduNEXT/edunext-platform/blob/open-release/maple.master/openedx/core/djangoapps/theming/template_loaders.py#L30
however that implementation is cached and doesn't allow to get the right values during the execution time.
Finally this returns the result of the `get_theme_template_sources` method
https://github.com/eduNEXT/edunext-platform/blob/master/openedx/core/djangoapps/theming/template_loaders.py#L39
instead of using the cached values of self.dirs on runtime.
"""
return ThemeFilesystemLoader.get_theme_template_sources()
14 changes: 8 additions & 6 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# make upgrade
#
asgiref==3.6.0
asgiref==3.7.2
# via django
django==3.2.16
django==3.2.23
# via
# -c requirements/constraints.txt
# -r requirements/base.in
eox-tenant==8.0.0
eox-tenant==10.0.0
# via
# -c requirements/constraints.txt
# -r requirements/base.in
pytz==2022.2.1
pytz==2022.7.1
# via
# -c requirements/constraints.txt
# django
six==1.16.0
# via -r requirements/base.in
sqlparse==0.4.3
sqlparse==0.4.4
# via django
typing-extensions==4.8.0
# via asgiref
16 changes: 4 additions & 12 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,9 @@

# Keep same platform version
Django<4.0
pylint<2.14
testfixtures==7.0.0
coverage[toml]==6.5.0
mako==1.2.3
mock==4.0.3
path-py==12.5.0
pylint<2.16.0
pycodestyle<2.9.0
pytz==2022.2.1
pytz<2023

# Version used in Olive version of edx-platform
edx-opaque-keys==2.3.0

# Version used in Olive version of eox-tenant
eox-tenant>= 8.0
# Version used in Palm version of eox-tenant
eox-tenant>= 10.0.0
2 changes: 1 addition & 1 deletion requirements/django.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Django==3.2.16
Django==3.2.23
21 changes: 14 additions & 7 deletions requirements/pip-tools.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# make upgrade
#
build==0.10.0
build==1.0.3
# via pip-tools
click==8.1.3
click==8.1.7
# via pip-tools
packaging==23.0
importlib-metadata==6.8.0
# via build
pip-tools==6.12.2
packaging==23.2
# via build
pip-tools==7.3.0
# via -r requirements/pip-tools.in
pyproject-hooks==1.0.0
# via build
tomli==2.0.1
# via build
wheel==0.38.4
# via
# build
# pip-tools
# pyproject-hooks
wheel==0.41.3
# via pip-tools
zipp==3.17.0
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# pip
Expand Down
63 changes: 28 additions & 35 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,84 +1,77 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# make upgrade
#
asgiref==3.6.0
asgiref==3.7.2
# via
# -r requirements/base.txt
# django
astroid==2.11.7
astroid==2.13.5
# via
# -r requirements/test.in
# pylint
coverage[toml]==6.5.0
# via
# -c requirements/constraints.txt
# -r requirements/test.in
dill==0.3.6
coverage==7.3.2
# via -r requirements/test.in
dill==0.3.7
# via pylint
# via
# -c requirements/constraints.txt
# -r requirements/base.txt
# -r requirements/test.in
eox-tenant==8.0.0
eox-tenant==10.0.0
# via
# -c requirements/constraints.txt
# -r requirements/base.txt
isort==5.12.0
# via pylint
lazy-object-proxy==1.9.0
# via astroid
mako==1.2.3
# via
# -c requirements/constraints.txt
# -r requirements/test.in
markupsafe==2.1.2
mako==1.3.0
# via -r requirements/test.in
markupsafe==2.1.3
# via mako
mccabe==0.7.0
# via pylint
mock==4.0.3
# via
# -c requirements/constraints.txt
# -r requirements/test.in
path==16.6.0
mock==5.1.0
# via -r requirements/test.in
path==16.7.1
# via path-py
path-py==12.5.0
# via
# -c requirements/constraints.txt
# -r requirements/test.in
platformdirs==2.6.2
# via -r requirements/test.in
platformdirs==3.11.0
# via pylint
pycodestyle==2.8.0
# via
# -c requirements/constraints.txt
# -r requirements/test.in
pylint==2.13.9
pylint==2.15.10
# via
# -c requirements/constraints.txt
# -r requirements/test.in
pytz==2022.2.1
pytz==2022.7.1
# via
# -c requirements/constraints.txt
# -r requirements/base.txt
# django
six==1.16.0
# via -r requirements/base.txt
sqlparse==0.4.3
sqlparse==0.4.4
# via
# -r requirements/base.txt
# django
testfixtures==7.0.0
# via
# -c requirements/constraints.txt
# -r requirements/test.in
testfixtures==7.2.2
# via -r requirements/test.in
tomli==2.0.1
# via pylint
tomlkit==0.12.3
# via pylint
typing-extensions==4.8.0
# via
# coverage
# -r requirements/base.txt
# asgiref
# astroid
# pylint
wrapt==1.14.1
wrapt==1.16.0
# via astroid

# The following packages are considered to be unsafe in a requirements file:
# setuptools
22 changes: 11 additions & 11 deletions requirements/tox.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# make upgrade
#
cachetools==5.3.0
cachetools==5.3.2
# via tox
chardet==5.1.0
chardet==5.2.0
# via tox
colorama==0.4.6
# via tox
distlib==0.3.6
distlib==0.3.7
# via virtualenv
filelock==3.9.0
filelock==3.13.1
# via
# tox
# virtualenv
packaging==23.0
packaging==23.2
# via
# pyproject-api
# tox
platformdirs==2.6.2
platformdirs==3.11.0
# via
# tox
# virtualenv
pluggy==1.0.0
pluggy==1.3.0
# via tox
pyproject-api==1.5.0
pyproject-api==1.6.1
# via tox
tomli==2.0.1
# via
# pyproject-api
# tox
tox==4.4.3
tox==4.11.3
# via -r requirements/tox.in
virtualenv==20.17.1
virtualenv==20.24.6
# via tox
Loading

0 comments on commit c476ceb

Please sign in to comment.