Skip to content

Commit

Permalink
Merge Nightly in master (#95)
Browse files Browse the repository at this point in the history
* ci: upgrade publish_pypi to ubuntu-latest and python 3.12 (#85)

* fix: use __package__ in importlib_resources for compatibility with sumac (#88)

---------

Co-authored-by: Danyal Faheem <[email protected]>
Co-authored-by: Overhang.IO <[email protected]>
  • Loading branch information
3 people authored Dec 5, 2024
1 parent e071bc5 commit ce7f165
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ on:
jobs:

push:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/openedx-scorm-xblock

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

- name: setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- name: Install setup tool and wheel
run: pip install setuptools wheel
Expand All @@ -25,7 +29,4 @@ jobs:
run: python setup.py sdist bdist_wheel

- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}
uses: pypa/gh-action-pypi-publish@release/v1
5 changes: 4 additions & 1 deletion openedxscorm/scormxblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ def initialize_student_info(self):
@staticmethod
def resource_string(path):
"""Handy helper for getting static resources from our kit."""
data = importlib_resources.files(__name__).joinpath(path).read_bytes()
try:
data = importlib_resources.files(__name__).joinpath(path).read_bytes()
except TypeError:
data = importlib_resources.files(__package__).joinpath(path).read_bytes()
return data.decode("utf8")

def author_view(self, context=None):
Expand Down

0 comments on commit ce7f165

Please sign in to comment.