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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[run]
branch = True
source =
xblocks_contrib
xblock_pdf
src
2 changes: 1 addition & 1 deletion .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Run Python Tests and Coverage
runs-on: ubuntu-latest
strategy:
fail-fast: true
fail-fast: false
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
fail-fast: false
fail-fast: true

Note to self: Undo this before merging

matrix:
python-version: ["3.12"]
toxenv: [quality, docs, django42, django52]
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ output/*/index.html
# Sphinx
docs/_build/
docs/modules.rst
docs/xblocks_contrib.rst
docs/xblocks_contrib.*.rst
docs/xblock_*.rst

# Private requirements
requirements/private.in
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Change Log
##########

..
All enhancements and patches to xblocks-contrib will be documented
All enhancements and patches to xblocks-core will be documented
in this file. It adheres to the structure of https://keepachangelog.com/ ,
but in reStructuredText instead of Markdown (for ease of incorporation into
Sphinx documentation and the PyPI description).
Expand All @@ -14,6 +14,15 @@ Change Log
Unreleased
**********

* Renamed pypi package and repo from ``xblocks-contrib`` to ``xblocks-core``.
* Restructured Python source into ``src/xblock_<name>/`` packages (one per XBlock); the shared
XML helpers moved to ``src/xblocks_core.legacy_utils/``.
* Renamed Django app entry points ``xblocks_contrib_problem_capa`` → ``xblock_problem_capa`` and
``xblocks_contrib_discussion`` → ``xblock_discussion`` (consumers in edx-platform must update
``INSTALLED_APPS`` and any direct imports).
* Renamed Transifex resource slugs ``xblocks-contrib-<name>`` → ``xblocks-core-<name>``; the
combined source ``django.po`` now lives at ``src/xblocks_core_locale/conf/locale/en/LC_MESSAGES/``.

0.16.0 - 2026-04-21
**********************************************

Expand Down
25 changes: 12 additions & 13 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,29 @@ include requirements/base.in
include requirements/constraints.txt

# --- PACKAGE DATA ---
recursive-include xblocks_contrib *.html *.js *.css *.jar *.png *.gif *.jpg *.jpeg *.svg *.yaml *.underscore
recursive-include xblock_pdf *.html *.js *.css
recursive-include src *.html *.js *.css *.jar *.png *.gif *.jpg *.jpeg *.svg *.yaml *.underscore

# --- EXCLUSIONS ---
# Prevent raw frontend source files and node_modules from bloating the Python wheel.
prune xblocks_contrib/*/assets
prune xblocks_contrib/*/node_modules
prune src/*/assets
prune src/*/node_modules
global-exclude webpack*.config.js karma*.js package*.json package-lock.json .gitignore

# Exclude top-level tests and JS specs by default to keep the distribution size small.
# NOTE: The `*` here only looks one directory deep (e.g., `foo/tests`).
prune */tests
prune */spec
# NOTE: The `*` here only looks one directory deep (e.g., `foo/tests`).
prune src/*/tests
prune src/*/spec

# Because MANIFEST.in does not support `**` (globstar) for infinite folder depth,
# generic wildcards cannot reach deeply nested folders. We must explicitly prune
# these deep directories to prevent them from being swept up by `recursive-include`.
prune xblocks_contrib/problem/capa/static/js/capa/spec
prune xblocks_contrib/problem/capa/static/js/capa/fixtures
prune xblocks_contrib/problem/capa/tests/test_files
prune src/xblock_problem/capa/static/js/capa/spec
prune src/xblock_problem/capa/static/js/capa/fixtures
prune src/xblock_problem/capa/tests/test_files

# --- TEST UTILITY INCLUSIONS ---
# Re-include specific test files that are excluded above.
# We do this because openedx-platform imports these specific test helpers.
include xblocks_contrib/problem/capa/tests/test_util.py
include xblocks_contrib/problem/capa/tests/helpers.py
include xblocks_contrib/problem/capa/tests/response_xml_factory.py
include src/xblock_problem/capa/tests/test_util.py
include src/xblock_problem/capa/tests/helpers.py
include src/xblock_problem/capa/tests/response_xml_factory.py
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
.PHONY: detect_changed_source_translations dummy_translations build_dummy_translations
.PHONY: validate_translations pull_translations push_translations install_transifex_clients

PACKAGE_NAME := xblocks_contrib
SRC_DIR := src
EXTRACT_DIR := conf/locale/en/LC_MESSAGES
COMBINED_LOCALE_DIR := $(PACKAGE_NAME)/conf/locale/en/LC_MESSAGES
JS_TARGET := $(PACKAGE_NAME)/public/js/translations
# Combined-locale output for the openedx-translations pipeline (OEP-58),
# which expects a single `django.po` source file per repository.
COMBINED_LOCALE_DIR := $(SRC_DIR)/xblocks_core_locale/conf/locale/en/LC_MESSAGES
JS_TARGET := $(SRC_DIR)/xblocks_core_locale/public/js/translations

help:
@perl -nle'print $& if m{^[\.a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}'
Expand Down Expand Up @@ -37,8 +39,8 @@ piptools: ## install pinned version of pip-compile and pip-sync
requirements: piptools ## install development environment requirements
pip-sync -q requirements/dev.txt requirements/private.*

# XBlock directories
XBLOCKS=$(shell find $(shell pwd)/$(PACKAGE_NAME) -mindepth 2 -maxdepth 2 -type d -name 'conf' -exec dirname {} \;)
# XBlock directories: each src/xblock_<name>/ that has its own conf/ subdir
XBLOCKS=$(shell find $(shell pwd)/$(SRC_DIR) -mindepth 2 -maxdepth 2 -type d -name 'conf' -exec dirname {} \;)

## Localization targets

Expand Down
16 changes: 9 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
===============
xblocks-contrib
===============
============
xblocks-core
============

*Before Verawood, this repository was known as "xblocks-contrib"*

This repository is the new home for XBlocks which are part of the base openedx-platform
installation.
Expand Down Expand Up @@ -71,8 +73,8 @@ For information on how to enable translations, visit the `Open edX XBlock tutori

The included Makefile contains targets for extracting, compiling and validating translatable strings.
Each XBlock in this repository has its own translation configuration under
``xblocks_contrib/<xblock>/conf/locale/`` and its own Transifex resource mapping under
``xblocks_contrib/<xblock>/.tx/config``. All Make targets iterate over every XBlock automatically.
``src/xblock_<name>/conf/locale/`` and its own Transifex resource mapping under
``src/xblock_<name>/.tx/config``. All Make targets iterate over every XBlock automatically.

The general steps to provide multilingual messages for a Python program (or an XBlock) are:

Expand Down Expand Up @@ -132,11 +134,11 @@ This iterates over every XBlock and:

The output for each XBlock is a single file at::

xblocks_contrib/<xblock>/conf/locale/en/LC_MESSAGES/text.po
src/xblock_<name>/conf/locale/en/LC_MESSAGES/text.po

Additionally, all per-xblock ``text.po`` files are merged into a single combined file at::

xblocks_contrib/conf/locale/en/LC_MESSAGES/django.po
src/xblocks_core_locale/conf/locale/en/LC_MESSAGES/django.po

This combined file is used by the
`openedx-translations <https://github.com/openedx/openedx-translations>`_ pipeline (OEP-58)
Expand Down
2 changes: 1 addition & 1 deletion catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: xblocks-contrib
name: xblocks-core
annotations:
openedx.org/component-type: "XBlock"
openedx.org/arch-interest-groups: "feanil"
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/xblocks-contrib.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/xblocks-core.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/xblocks-contrib.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/xblocks-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/xblocks-contrib"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/xblocks-contrib"
@echo "# mkdir -p $$HOME/.local/share/devhelp/xblocks-core"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/xblocks-core"
@echo "# devhelp"

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

This file is execfile()d with the current directory set to its
containing dir.
Expand Down Expand Up @@ -54,7 +54,7 @@ def get_version(*file_paths):
REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(REPO_ROOT)

VERSION = get_version("../xblocks_contrib", "__init__.py")
VERSION = get_version("../src/xblocks_core", "__init__.py")

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -103,17 +103,17 @@ def get_version(*file_paths):
top_level_doc = "index"

# General information about the project.
project = "xblocks-contrib"
project = "xblocks-core"
copyright = f"{datetime.now().year}, Axim Collaborative, Inc." # pylint: disable=redefined-builtin
author = "Axim Collaborative, Inc."
project_title = "xblocks-contrib"
project_title = "xblocks-core"
documentation_title = f"{project_title}"

# Set display_github to False if you don't want "edit on Github" button
html_context = {
"display_github": True, # Integrate GitHub
"github_user": "edx", # Username
"github_repo": "xblocks-contrib", # Repo name
"github_repo": "xblocks-core", # Repo name
"github_version": "main", # Version
"conf_py_path": "/docs/", # Path in the checkout to the docs root
}
Expand Down Expand Up @@ -198,7 +198,7 @@ def get_version(*file_paths):
# documentation.
#
html_theme_options = {
"repository_url": "https://github.com/openedx/xblocks-contrib",
"repository_url": "https://github.com/openedx/xblocks-core",
"repository_branch": "main",
"path_to_docs": "docs/",
"home_page_in_toc": True,
Expand Down Expand Up @@ -235,7 +235,7 @@ def get_version(*file_paths):
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#
# html_title = 'xblocks-contrib v0.1.0'
# html_title = 'xblocks-core v0.1.0'

# A shorter title for the navigation bar. Default is the same as html_title.
#
Expand Down Expand Up @@ -551,8 +551,7 @@ def on_init(app): # pylint: disable=unused-argument
apidoc_path,
"-o",
docs_path,
os.path.join(root_path, "xblocks_contrib"),
os.path.join(root_path, "xblocks_contrib/migrations"),
os.path.join(root_path, "src"),
]
)

Expand Down
4 changes: 2 additions & 2 deletions docs/decisions/0002-pointer-tags-handling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Both formats are supported by edx-platform's `XmlMixin`, which handles:
- **Parsing:** detecting pointer tags and loading their definitions from the pointed-to file.
- **Exporting:** serializing blocks in pointer format.

However, this was disrupted when **built-in XBlocks** (such as `WordCloud`, `Annotatable`, `LTI`, `HTML`, `Poll`, `Video`, `Problem`) were **extracted from edx-platform** into a new repository: **xblocks-contrib**.
However, this was disrupted when **built-in XBlocks** (such as `WordCloud`, `Annotatable`, `LTI`, `HTML`, `Poll`, `Video`, `Problem`) were **extracted from edx-platform** into a new repository: **xblocks-core**.

The key architectural change was that **extracted XBlocks no longer depend on `XmlMixin`** and instead inherit directly from the base `XBlock` class — following the *pure XBlock* pattern.
This transition removed pointer-tag handling functionality for those blocks.
Expand Down Expand Up @@ -115,4 +115,4 @@ References

- `openedx/XBlock#830` - Initial attempt to add pointer-tag parsing to XBlock core
- `openedx/edx-platform#37133` - Runtime-based pointer resolution PR
- `xblocks_contrib` - Repository containing extracted XBlocks and new `PointerTagMixin`
- `xblocks-core` - Repository containing extracted XBlocks and new `PointerTagMixin`
6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.. xblocks-contrib documentation top level file, created by
.. xblocks-core documentation top level file, created by
sphinx-quickstart on Thu Jul 04 13:23:33 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

xblocks-contrib
===============
xblocks-core
============

core xblocks

Expand Down
12 changes: 6 additions & 6 deletions docs/internationalization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ Project structure
*****************
Each XBlock in this repository manages its own translations independently:

- **Config**: ``xblocks_contrib/<xblock>/conf/locale/config.yaml`` -- defines supported languages and
- **Config**: ``src/xblock_<name>/conf/locale/config.yaml`` -- defines supported languages and
ignored directories.
- **Source strings**: ``xblocks_contrib/<xblock>/conf/locale/en/LC_MESSAGES/text.po`` -- extracted
- **Source strings**: ``src/xblock_<name>/conf/locale/en/LC_MESSAGES/text.po`` -- extracted
English strings (Python, HTML, and JavaScript combined into a single file).
- **Transifex mapping**: ``xblocks_contrib/<xblock>/.tx/config`` -- maps the local ``conf/locale/``
- **Transifex mapping**: ``src/xblock_<name>/.tx/config`` -- maps the local ``conf/locale/``
paths to the Transifex resource for that XBlock.
- **Combined source file**: ``xblocks_contrib/conf/locale/en/LC_MESSAGES/django.po`` -- all per-xblock
``text.po`` files merged into one, used by the openedx-translations pipeline (OEP-58).
- **Combined source file**: ``src/xblocks_core_locale/conf/locale/en/LC_MESSAGES/django.po`` -- all
per-xblock ``text.po`` files merged into one, used by the openedx-translations pipeline (OEP-58).

All ``make`` targets iterate over every XBlock that has a ``conf/`` directory automatically.

Expand All @@ -37,7 +37,7 @@ the `openedx-translations`_ repository rather than directly via Transifex.

1. A daily GitHub Actions workflow in openedx-translations clones this repo and runs
``make extract_translations``.
2. The combined ``django.po`` file at ``xblocks_contrib/conf/locale/en/`` is committed to
2. The combined ``django.po`` file at ``src/xblocks_core_locale/conf/locale/en/`` is committed to
openedx-translations.
3. The Transifex GitHub App syncs source strings to the ``openedx-translations`` Transifex project
under the ``open-edx`` organization.
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\xblocks-contrib.qhcp
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\xblocks-core.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\xblocks-contrib.ghc
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\xblocks-core.ghc
goto end
)

Expand Down
2 changes: 1 addition & 1 deletion docs/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Testing
#######

xblocks-contrib has an assortment of test cases and code quality
xblocks-core has an assortment of test cases and code quality
checks to catch potential problems during development. To run them all in the
version of Python you chose for your virtualenv:

Expand Down
21 changes: 21 additions & 0 deletions docs/xblocks_core.legacy_utils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
xblocks\_core.legacy\_utils package
===================================

Submodules
----------

xblocks\_core.legacy\_utils.xml\_utils module
---------------------------------------------

.. automodule:: xblocks_core.legacy_utils.xml_utils
:members:
:show-inheritance:
:undoc-members:

Module contents
---------------

.. automodule:: xblocks_core.legacy_utils
:members:
:show-inheritance:
:undoc-members:
18 changes: 18 additions & 0 deletions docs/xblocks_core.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
xblocks\_core package
=====================

Subpackages
-----------

.. toctree::
:maxdepth: 4

xblocks_core.legacy_utils

Module contents
---------------

.. automodule:: xblocks_core
:members:
:show-inheritance:
:undoc-members:
Loading
Loading