Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,28 @@ jobs:
- name: Install pip
run: pip install -r requirements/pip.txt

- name: Build package
- name: Build the package (openedx-core)
run: python setup.py sdist bdist_wheel

- name: Publish to PyPI
- name: Publish openedx-core to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}

# TEMPORARY: Build and publish the transitional openedx-learning shell package.
# TODO: Remove after the transition is complete.
# See https://github.com/openedx/openedx-learning/issues/470

- name: Build shell package (openedx-learning)
run: |
cd tmp-openedx-learning
python setup.py sdist bdist_wheel
cd ..

- name: Publish openedx-learning shell to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}
packages-dir: tmp-openedx-learning/dist/
28 changes: 0 additions & 28 deletions CHANGELOG.rst

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ selfcheck: ## check that the Makefile is well-formed

## Localization targets
# TODO: Need to audit these, and then actually tell openedx-translations
# to use them. https://github.com/openedx/openedx-learning/issues/483
# to use them. https://github.com/openedx/openedx-core/issues/483

extract_translations: ## extract strings to be translated, outputting .mo files
rm -rf docs/_build
Expand Down
107 changes: 27 additions & 80 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
Open edX Learning Core (and Tagging)
====================================
Open edX Core: Foundational Packages for a Teaching & Learning Platform
=======================================================================

|pypi-badge| |ci-badge| |codecov-badge| |doc-badge| |pyversions-badge|
|license-badge|

Overview
--------

The ``openedx-learning`` project holds Django apps that represent core learning platform concepts.
*Formerly known as "Learning Core" or "openedx-learning".*

The ``openedx-core`` project holds Django apps which represent core teaching & learning platform concepts.

Each app exposes stable, public API of Python functions and Django models. Some apps additionally provides REST APIs. These APIs are suitable for use in ``openedx-platform`` as well as in community-developed Open edX plugins.

Motivation
----------

The short term goal of this project is to create a small, extensible core that is easier to reason about and write extensions for than openedx-platform. The longer term goal is to create a more nimble core learning platform, enabling rapid experimentation and drastic changes to the learner experience that are difficult to implement with Open edX today.
The short term goal of this project is to create a small, extensible core that is easier to reason about and write extensions for than ``openedx-platform``. The longer term goal is to create a more nimble core learning platform, enabling rapid experimentation and drastic changes to the learner experience that are difficult to implement with Open edX today.

Replacing openedx-platform is explicitly *not* a goal of this project, as only a small fraction of the concepts in openedx-platform make sense to carry over here. When these core concepts are extracted and the data migrated, openedx-platform will import apps from this repo and make use of their public in-process APIs.
Replacing ``openedx-platform`` is explicitly *not* a goal of this project, as only a small fraction of the concepts in openedx-platform make sense to carry over here. When these core concepts are extracted and the data migrated, openedx-platform will import apps from this repo and make use of their public in-process APIs.

Architecture
------------

Learning Core Package Dependencies
Open edX Core Package Dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Learning Core code should never import from ``openedx-platform``.
Open edX Core code should never import from ``openedx-platform``.

We want to be very strict about dependency management internally as well. Please read the `.importlinter config file <.importlinter>`_ file and the `Python API Conventions ADR <docs/decisions/0016-python-public-api-conventions>`_ for more details.

Expand All @@ -37,7 +41,6 @@ We have a few different identifier types in the schema, and we try to avoid ``_i
* ``key`` is intended to be a case-sensitive, alphanumeric key, which holds some meaning to library clients. This is usually stable, but can be changed, depending on the business logic of the client. The apps in this repo should make no assumptions about it being stable. It can be used as a suffix. Since ``key`` is a reserved name on certain database systems, the database field is ``_key``.
* ``num`` is like ``key``, but for use when it's strictly numeric. It can also be used as a suffix.


See Also
~~~~~~~~

Expand All @@ -49,66 +52,10 @@ The structure of this repo follows [OEP-0049](https://open-edx-proposals.readthe
Code Overview
-------------

The ``src`` folder contains all our Django applications.

Development Workflow
--------------------

One Time Setup
~~~~~~~~~~~~~~
.. code-block::

# Clone the repository
git clone git@github.com:ormsbee/openedx-learning.git
cd openedx-learning

# Set up a virtualenv using virtualenvwrapper with the same name as the repo and activate it
mkvirtualenv -p python3.11 openedx-learning


Every time you develop something in this repo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::

# Activate the virtualenv
workon openedx-learning

# Grab the latest code
git checkout master
git pull

# Install/update the dev requirements
make requirements

# Run the tests and quality checks (to verify the status before you make any changes)
make validate

# Make a new branch for your changes
git checkout -b <your_github_username>/<short_description>

# Using your favorite editor, edit the code to make your change.
vim …

# Run your new tests
pytest ./path/to/new/tests

# Run all the tests and quality checks
make validate

# Commit all your changes
git commit …
git push

# Open a PR and ask for review.

Configuring Visual Studio Code
------------------------------

If you are using VS Code as your editor, you can enable the Testing bar by copying from the example configuration provided in the ``.vscode`` directory::

cd .vscode/
cp launch.json.example launch.json
cp settings.json.example settings.json
* ``./src/``: All published code. Packages are importable relative to this directory (e.g., ``import openedx_content``). See ``readme.rst`` in each sub-folder.
* ``./tests/``: Unit tests (not published).
* ``./test_utils/``: Internal helpers for unit tests (not published).
* ``./olx_importer/``: Internal utility for importing data for development (not published).

License
-------
Expand Down Expand Up @@ -140,26 +87,26 @@ For more information about these options, see the `Getting Help`_ page.
.. _community Slack workspace: https://openedx.slack.com/
.. _Getting Help: https://openedx.org/getting-help

.. |pypi-badge| image:: https://img.shields.io/pypi/v/openedx-learning.svg
:target: https://pypi.python.org/pypi/openedx-learning/
.. |pypi-badge| image:: https://img.shields.io/pypi/v/openedx-core.svg
:target: https://pypi.python.org/pypi/openedx-core/
:alt: PyPI

.. |ci-badge| image:: https://github.com/openedx/openedx-learning/workflows/Python%20CI/badge.svg?branch=master
:target: https://github.com/openedx/openedx-learning/actions
.. |ci-badge| image:: https://github.com/openedx/openedx-core/workflows/Python%20CI/badge.svg?branch=master
:target: https://github.com/openedx/openedx-core/actions
:alt: CI

.. |codecov-badge| image:: https://codecov.io/github/edx/openedx-learning/coverage.svg?branch=master
:target: https://codecov.io/github/edx/openedx-learning?branch=master
.. |codecov-badge| image:: https://codecov.io/github/edx/openedx-core/coverage.svg?branch=master
:target: https://codecov.io/github/edx/openedx-core?branch=master
:alt: Codecov

.. |doc-badge| image:: https://readthedocs.org/projects/openedx-learning/badge/?version=latest
:target: https://openedx-learning.readthedocs.io/en/latest/
.. |doc-badge| image:: https://readthedocs.org/projects/openedx-core/badge/?version=latest
:target: https://openedx-core.readthedocs.io/en/latest/
:alt: Documentation

.. |pyversions-badge| image:: https://img.shields.io/pypi/pyversions/openedx-learning.svg
:target: https://pypi.python.org/pypi/openedx-learning/
.. |pyversions-badge| image:: https://img.shields.io/pypi/pyversions/openedx-core.svg
:target: https://pypi.python.org/pypi/openedx-core/
:alt: Supported Python versions

.. |license-badge| image:: https://img.shields.io/github/license/edx/openedx-learning.svg
:target: https://github.com/openedx/openedx-learning/blob/master/LICENSE.txt
.. |license-badge| image:: https://img.shields.io/github/license/edx/openedx-core.svg
:target: https://github.com/openedx/openedx-core/blob/master/LICENSE.txt
:alt: License
2 changes: 1 addition & 1 deletion catalog-info.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: openedx-learning
name: openedx-core
spec:
type: other
lifecycle: unknown
Expand Down
8 changes: 4 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/openedx-learning.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/openedx-core.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/openedx-learning.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/openedx-core.qhc"

.PHONY: applehelp
applehelp:
Expand All @@ -115,8 +115,8 @@ devhelp:
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/openedx-learning"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/openedx-learning"
@echo "# mkdir -p $$HOME/.local/share/devhelp/openedx-core"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/openedx-core"
@echo "# devhelp"

.PHONY: epub
Expand Down
14 changes: 7 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pylint: disable=invalid-name
"""
openedx-learning documentation build configuration file.
openedx-core documentation build configuration file.

This file is execfile()d with the current directory set to its
containing dir.
Expand Down Expand Up @@ -89,10 +89,10 @@ def get_version(*file_paths):
top_level_doc = 'index'

# General information about the project.
project = 'openedx-learning'
copyright = f'{datetime.now().year}, edX Inc.' # pylint: disable=redefined-builtin
author = 'edX Inc.'
project_title = 'Open edX Learning Core'
project = 'openedx-core'
copyright = f'{datetime.now().year}, Axim Collaborative, Inc.' # pylint: disable=redefined-builtin
author = 'Axim Collaborative, Inc.'
project_title = 'Open edX Core'
documentation_title = f"{project_title}"

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -169,7 +169,7 @@ def get_version(*file_paths):
# documentation.
#
html_theme_options = {
"repository_url": "https://github.com/openedx/openedx-learning",
"repository_url": "https://github.com/openedx/openedx-core",
"repository_branch": "main",
"path_to_docs": "docs/",
"home_page_in_toc": True,
Expand Down Expand Up @@ -206,7 +206,7 @@ def get_version(*file_paths):
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#
# html_title = 'openedx-learning v0.1.0'
# html_title = 'openedx-core v0.1.0'

# A shorter title for the navigation bar. Default is the same as html_title.
#
Expand Down
56 changes: 56 additions & 0 deletions docs/decisions/0021-openedx-core.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
21. Learning Core is now Open edX Core
======================================

Context
-------

When this repo was created, it was intended to only encompass learning concepts. The content models were supposed to be read-optimized LMS-friendly representations of learning content. It was imaged that the authoring models would live elsewhere (e.g. Blockstore). That's why this was called "Learning Core".
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When this repo was created, it was intended to only encompass learning concepts. The content models were supposed to be read-optimized LMS-friendly representations of learning content. It was imaged that the authoring models would live elsewhere (e.g. Blockstore). That's why this was called "Learning Core".
When this repo was created, it was intended to only encompass learning concepts. The content models were supposed to be read-optimized LMS-friendly representations of learning content. It was imagined that the authoring models would live elsewhere (e.g. Blockstore). That's why this was called "Learning Core".


Over time, we realized that we actually needed to start by developing write-optimized CMS-friendly models, many of which are ideal to be also be used in LMS. We ended up with an "Authoring API" which powered the Studio-only Content Libraries feature.

Now, we are working on CBE, Pathways, and Catalog-realted features in this repo. There's also still a Tagging API in this repo. So, the scope of Learning Core has increased, although it still makes sense to develop these important foundational, stable packages together in one core repository.

Decision
--------

The Learning Core is now the Open edX Core. The openedx-learning repository is now openedx-core, as is the installable PyPI project. It's a place to put foundational teaching and learning models and stable APIs. It is **not** a place to put code that is periphery, highly feature-specific, or lacking a path towards stability.

The Open edX Core will consist of several Django apps, each implementing a cohesive yet significant platform concern. Each app should expose a Python API (at ``.api``) and a models API (ideally at ``.models_api``), and optionally a REST API (at ``.rest_api``). We'll use importlinter to enforce boundaries between the apps. In the future, if we move to uv, we may manage these as `uv workspaces <https://docs.astral.sh/uv/concepts/projects/workspaces/>`_.

We will initially have two top-level Django applications:

* ``openedx_content``
* ``openedx_tagging``

We expect it to grow a few more top-level Django applications, including:

* ``openedx_learning`` (learner-facing models, similar to the original intent of Learning Core).
* ``openedx_catalog`` (CourseRun, etc.)
* ``openedx_cbe`` (Models related to pathways, credential-based education. Still in discussion).

Long term, we are open to more stable, core APIs moving in, such as:

* ``openedx_events``
* ``openedx_filters``
* ``openedx_authz``
* ``openedx_keys`` (renamed from ``opaque_keys``)

There are dependencies between these apps we'd want to keep in mind. For example, we wouldn't want to move in ``openedx_keys`` without moving in ``openedx_authz`` first, otherwise we'd create a cyclical dependency between ``openex-authz`` and ``openedx-core``.

By keeping each app as a top-level package and by using importlinter, we leave the door open for packages to be removed later. For example, if it becomes cumbersome to maintain ``openedx_catalog`` alongside the other core apps, then it should be possible to extract it into a separate ``openedx-catalog`` repo without breaking any external instances of ``from openedx_catalog import ...``.

Consequences
------------

We'll implement this change immediately as detailed in https://github.com/openedx/openedx-core/issues/470

Rejected alternatives
---------------------

* Separate repos for ``openedx-content``, ``openedx-cbe``, etc.

* Axim is making a conscious effort to slow the proliferation of new repos, as it has been challenging to maintain consistent standards, tooling, and upgrades across all of them. If there is not a strong reason to separate repos, then we would prefer to start off with a single repo.

* A combined top level Python package with nested apps: ``openedx_core.content.api``, ``openedx_core.cbe.api``, etc.

* This would make it harder to split apps out into separate repos, later because it would involve either (a) updating all the import statements or (b) having the ``openedx_core`` namespace split across multiple repos. We'd like to remain flexible with code reorganization given the fast-moving and experimental nature of these projects.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* This would make it harder to split apps out into separate repos, later because it would involve either (a) updating all the import statements or (b) having the ``openedx_core`` namespace split across multiple repos. We'd like to remain flexible with code reorganization given the fast-moving and experimental nature of these projects.
* This would make it harder to split apps out into separate repos later, because it would involve either (a) updating all the import statements or (b) having the ``openedx_core`` namespace split across multiple repos. We'd like to remain flexible with code reorganization given the fast-moving and experimental nature of these projects.

6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.. openedx-learning documentation top level file, created by
.. openedx-core documentation top level file, created by
sphinx-quickstart on Sun Aug 08 00:18:04 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Open edX Learning Core
======================
Open edX Core
=============

The boring, foundational bits of a learning platform that are hard to get right at scale. Currently being developed for content storage.

Expand Down
4 changes: 2 additions & 2 deletions docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ if "%1" == "qthelp" (
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\openedx-learning.qhcp
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\openedx-core.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\openedx-learning.ghc
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\openedx-core.ghc
goto end
)

Expand Down
7 changes: 0 additions & 7 deletions docs/public_apis/authoring_api.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/public_apis/authoring_models.rst

This file was deleted.

Loading