Skip to content

Commit cbb0348

Browse files
committed
build: Restructure repo & rename to xblocks-core
Part of: #237 Part of: #149
1 parent f14731c commit cbb0348

564 files changed

Lines changed: 1702 additions & 1084 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveragerc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[run]
22
branch = True
33
source =
4-
xblocks_contrib
5-
xblock_pdf
4+
src

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ output/*/index.html
8181
# Sphinx
8282
docs/_build/
8383
docs/modules.rst
84-
docs/xblocks_contrib.rst
85-
docs/xblocks_contrib.*.rst
84+
docs/xblock_*.rst
8685

8786
# Private requirements
8887
requirements/private.in

CHANGELOG.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Change Log
22
##########
33

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

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

MANIFEST.in

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,29 @@ include requirements/base.in
44
include requirements/constraints.txt
55

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

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

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

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

2827
# --- TEST UTILITY INCLUSIONS ---
2928
# Re-include specific test files that are excluded above.
3029
# We do this because openedx-platform imports these specific test helpers.
31-
include xblocks_contrib/problem/capa/tests/test_util.py
32-
include xblocks_contrib/problem/capa/tests/helpers.py
33-
include xblocks_contrib/problem/capa/tests/response_xml_factory.py
30+
include src/xblock_problem/capa/tests/test_util.py
31+
include src/xblock_problem/capa/tests/helpers.py
32+
include src/xblock_problem/capa/tests/response_xml_factory.py

Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
.PHONY: detect_changed_source_translations dummy_translations build_dummy_translations
66
.PHONY: validate_translations pull_translations push_translations install_transifex_clients
77

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

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

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

4345
## Localization targets
4446

README.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
===============
2-
xblocks-contrib
3-
===============
1+
============
2+
xblocks-core
3+
============
44

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

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

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

@@ -132,11 +132,11 @@ This iterates over every XBlock and:
132132

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

135-
xblocks_contrib/<xblock>/conf/locale/en/LC_MESSAGES/text.po
135+
src/xblock_<name>/conf/locale/en/LC_MESSAGES/text.po
136136

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

139-
xblocks_contrib/conf/locale/en/LC_MESSAGES/django.po
139+
src/xblocks_core_locale/conf/locale/en/LC_MESSAGES/django.po
140140

141141
This combined file is used by the
142142
`openedx-translations <https://github.com/openedx/openedx-translations>`_ pipeline (OEP-58)

catalog-info.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
apiVersion: backstage.io/v1alpha1
88
kind: Component
99
metadata:
10-
name: xblocks-contrib
10+
name: xblocks-core
1111
annotations:
1212
openedx.org/component-type: "XBlock"
1313
openedx.org/arch-interest-groups: "feanil"

docs/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ qthelp:
9696
@echo
9797
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
9898
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
99-
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/xblocks-contrib.qhcp"
99+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/xblocks-core.qhcp"
100100
@echo "To view the help file:"
101-
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/xblocks-contrib.qhc"
101+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/xblocks-core.qhc"
102102

103103
.PHONY: applehelp
104104
applehelp:
@@ -115,8 +115,8 @@ devhelp:
115115
@echo
116116
@echo "Build finished."
117117
@echo "To view the help file:"
118-
@echo "# mkdir -p $$HOME/.local/share/devhelp/xblocks-contrib"
119-
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/xblocks-contrib"
118+
@echo "# mkdir -p $$HOME/.local/share/devhelp/xblocks-core"
119+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/xblocks-core"
120120
@echo "# devhelp"
121121

122122
.PHONY: epub

docs/conf.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pylint: disable=invalid-name
22
"""
3-
xblocks-contrib documentation build configuration file.
3+
xblocks-core documentation build configuration file.
44
55
This file is execfile()d with the current directory set to its
66
containing dir.
@@ -54,7 +54,7 @@ def get_version(*file_paths):
5454
REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
5555
sys.path.append(REPO_ROOT)
5656

57-
VERSION = get_version("../xblocks_contrib", "__init__.py")
57+
VERSION = get_version("../src/xblocks_core", "__init__.py")
5858

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

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

112112
# Set display_github to False if you don't want "edit on Github" button
113113
html_context = {
114114
"display_github": True, # Integrate GitHub
115115
"github_user": "edx", # Username
116-
"github_repo": "xblocks-contrib", # Repo name
116+
"github_repo": "xblocks-core", # Repo name
117117
"github_version": "main", # Version
118118
"conf_py_path": "/docs/", # Path in the checkout to the docs root
119119
}
@@ -198,7 +198,7 @@ def get_version(*file_paths):
198198
# documentation.
199199
#
200200
html_theme_options = {
201-
"repository_url": "https://github.com/openedx/xblocks-contrib",
201+
"repository_url": "https://github.com/openedx/xblocks-core",
202202
"repository_branch": "main",
203203
"path_to_docs": "docs/",
204204
"home_page_in_toc": True,
@@ -235,7 +235,7 @@ def get_version(*file_paths):
235235
# The name for this set of Sphinx documents.
236236
# "<project> v<release> documentation" by default.
237237
#
238-
# html_title = 'xblocks-contrib v0.1.0'
238+
# html_title = 'xblocks-core v0.1.0'
239239

240240
# A shorter title for the navigation bar. Default is the same as html_title.
241241
#
@@ -551,8 +551,7 @@ def on_init(app): # pylint: disable=unused-argument
551551
apidoc_path,
552552
"-o",
553553
docs_path,
554-
os.path.join(root_path, "xblocks_contrib"),
555-
os.path.join(root_path, "xblocks_contrib/migrations"),
554+
os.path.join(root_path, "src"),
556555
]
557556
)
558557

docs/decisions/0002-pointer-tags-handling.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Both formats are supported by edx-platform's `XmlMixin`, which handles:
5454
- **Parsing:** detecting pointer tags and loading their definitions from the pointed-to file.
5555
- **Exporting:** serializing blocks in pointer format.
5656

57-
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**.
57+
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**.
5858

5959
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.
6060
This transition removed pointer-tag handling functionality for those blocks.
@@ -115,4 +115,4 @@ References
115115

116116
- `openedx/XBlock#830` - Initial attempt to add pointer-tag parsing to XBlock core
117117
- `openedx/edx-platform#37133` - Runtime-based pointer resolution PR
118-
- `xblocks_contrib` - Repository containing extracted XBlocks and new `PointerTagMixin`
118+
- `xblocks-core` - Repository containing extracted XBlocks and new `PointerTagMixin`

0 commit comments

Comments
 (0)