docs: update references from setup.py to pyproject.toml

Update documentation, comments, and docstrings throughout the codebase
to reflect the migration from setup.py to pyproject.toml:

- Transformer class docstrings: changed to reference "entry point name
  in the package configuration" for better future-proofing
- Block structure module docs: updated to reference pyproject.toml
- Test file comments: updated entry point references
- Config files (tox.ini, pytest.ini): updated references
- Documentation (extension_points.rst, course apps ADRs): updated to
  reference pyproject.toml with inclusive language for external packages
- Requirements documentation (github.in): updated with inclusive language
- edxmako README: modernized install command to use pip install

Historical ADRs and references to external packages that may still use
setup.py were intentionally left unchanged or updated with inclusive
language acknowledging both pyproject.toml and setup.py.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Feanil Patel
2026-01-26 15:56:50 -05:00
parent 98ec84aec8
commit 8143796b26
29 changed files with 60 additions and 55 deletions

View File

@@ -1,6 +1,6 @@
[pytest]
# Note: The first file of settings found is used, there is no combining, so
# this file is used for the tests in the cms tree, and setup.cfg is ignored.
# this file is used for the tests in the cms tree, and pyproject.toml is ignored.
# Details at https://docs.pytest.org/en/latest/reference/customize.html
DJANGO_SETTINGS_MODULE = cms.envs.test

View File

@@ -19,5 +19,5 @@ Mako: http://www.makotemplates.org/
How to install?
================================================================================
$ sudo python setup.py install
$ pip install .

View File

@@ -1,6 +1,6 @@
[pytest]
# Note: The first file of settings found is used, there is no combining, so
# this file is used for the tests in the common/test tree, and setup.cfg is ignored.
# this file is used for the tests in the common/test tree, and pyproject.toml is ignored.
# Details at https://docs.pytest.org/en/latest/reference/customize.html
addopts = -p no:randomly --durations=20 --json-report --json-report-omit keywords streams collectors log traceback tests --json-report-file=none

View File

@@ -87,7 +87,7 @@ If you wish to customize aspects of the learner or educator experiences, you'll
Most python plugins are enabled using one of two methods:
1. A Python Entry point: the core Open edX platform provides a standard plugin loading mechanism in |edx_django_utils.plugins|_ which uses `stevedore`_ to find all installed python packages that declare a specific "entry point" in their setup.py file. See the ``entry_points`` defined in edx-platform's own ``setup.py`` for examples.
1. A Python Entry point: the core Open edX platform provides a standard plugin loading mechanism in |edx_django_utils.plugins|_ which uses `stevedore`_ to find all installed python packages that declare a specific "entry point" in their package configuration (typically ``pyproject.toml`` or ``setup.py``). See the ``entry_points`` defined in edx-platform's own ``pyproject.toml`` for examples.
2. A Django setting: Some plugins require modification of Django settings, which is typically done by editing ``/edx/etc/lms.yml`` (in Production) or ``edx-platform/lms/envs/private.py`` (on Devstack).
.. |edx_django_utils.plugins| replace:: ``edx_django_utils.plugins``

View File

@@ -18,8 +18,8 @@ class AccessDeniedMessageFilterTransformer(BlockStructureTransformer):
@classmethod
def name(cls):
"""
Unique identifier for the transformer's class;
same identifier used in setup.py.
Unique identifier for the transformer's class.
This must match the entry point name in the package configuration.
"""
return "access_denied_message_filter"

View File

@@ -39,8 +39,8 @@ class HiddenContentTransformer(BlockStructureTransformer):
@classmethod
def name(cls):
"""
Unique identifier for the transformer's class;
same identifier used in setup.py.
Unique identifier for the transformer's class.
This must match the entry point name in the package configuration.
"""
return "hidden_content"

View File

@@ -36,8 +36,8 @@ class ContentLibraryTransformer(FilteringTransformerMixin, BlockStructureTransfo
@classmethod
def name(cls):
"""
Unique identifier for the transformer's class;
same identifier used in setup.py.
Unique identifier for the transformer's class.
This must match the entry point name in the package configuration.
"""
return "library_content"
@@ -197,8 +197,8 @@ class ContentLibraryOrderTransformer(BlockStructureTransformer):
@classmethod
def name(cls):
"""
Unique identifier for the transformer's class;
same identifier used in setup.py
Unique identifier for the transformer's class.
This must match the entry point name in the package configuration.
"""
return "library_content_randomize"

View File

@@ -67,8 +67,8 @@ class OverrideDataTransformer(BlockStructureTransformer):
@classmethod
def name(cls):
"""
Unique identifier for the transformer's class;
same identifier used in setup.py.
Unique identifier for the transformer's class.
This must match the entry point name in the package configuration.
"""
return "load_override_data"

View File

@@ -30,8 +30,8 @@ class SplitTestTransformer(FilteringTransformerMixin, BlockStructureTransformer)
@classmethod
def name(cls):
"""
Unique identifier for the transformer's class;
same identifier used in setup.py.
Unique identifier for the transformer's class.
This must match the entry point name in the package configuration.
"""
return "split_test"

View File

@@ -39,8 +39,8 @@ class StartDateTransformer(FilteringTransformerMixin, BlockStructureTransformer)
@classmethod
def name(cls):
"""
Unique identifier for the transformer's class;
same identifier used in setup.py.
Unique identifier for the transformer's class.
This must match the entry point name in the package configuration.
"""
return "start_date"

View File

@@ -32,8 +32,8 @@ class UserPartitionTransformer(BlockStructureTransformer):
@classmethod
def name(cls):
"""
Unique identifier for the transformer's class;
same identifier used in setup.py.
Unique identifier for the transformer's class.
This must match the entry point name in the package configuration.
"""
return "user_partitions"

View File

@@ -32,8 +32,8 @@ class VisibilityTransformer(FilteringTransformerMixin, BlockStructureTransformer
@classmethod
def name(cls):
"""
Unique identifier for the transformer's class;
same identifier used in setup.py.
Unique identifier for the transformer's class.
This must match the entry point name in the package configuration.
"""
return "visibility"

View File

@@ -18,8 +18,8 @@ class OpenAssessmentDateTransformer(FilteringTransformerMixin, BlockStructureTra
@classmethod
def name(cls):
"""
Unique identifier for the transformer's class;
same identifier used in setup.py.
Unique identifier for the transformer's class.
This must match the entry point name in the package configuration.
"""
return 'open_assessment_transformer'

View File

@@ -55,8 +55,8 @@ class GradesTransformer(BlockStructureTransformer):
@classmethod
def name(cls):
"""
Unique identifier for the transformer's class;
same identifier used in setup.py.
Unique identifier for the transformer's class.
This must match the entry point name in the package configuration.
"""
return 'grades'

View File

@@ -49,7 +49,7 @@ Transformers.
Registry. Transformers are registered using the platform's
PluginManager (e.g., Stevedore). This is currently done by updating
setup.py. Only registered transformers are called during the Collect
pyproject.toml. Only registered transformers are called during the Collect
Phase. And only registered transformers can be used during the
Transform phase. Exceptions to this rule are any nested transformers
that are contained within higher-order transformers - as long as the

View File

@@ -65,7 +65,7 @@ class BlockStructureTransformer:
identify the transformer's cached data. So it should be unique
and not conflict with other transformers. Consider using the
same name that is used in the Transformer Registry. For example,
for Stevedore, it is specified in the setup.py file.
for Stevedore, it is specified in the package configuration (pyproject.toml).
Once the transformer is in use and its data is cached, do not
modify this name value without consideration of backward

View File

@@ -105,14 +105,14 @@ check.
Course App Plugin Class
=======================
To be loaded as a Course App, you need to provide an entrypoint in ``setup.py``
To be loaded as a Course App, you need to provide an entrypoint in ``pyproject.toml``
with the namespace ``openedx.course_app``. The entry should point to a Python
class with the following basic structure:
.. code-block:: python
class CourseApp:
# The app id should match what is specified in the setup.py entrypoint
# The app id should match what is specified in the pyproject.toml entrypoint
app_id: str = 'wiki'
name: str = 'Wiki'
description: str = 'A short description of what the Wiki does.'

View File

@@ -254,7 +254,7 @@ class TestCohortPartitionScheme(ModuleStoreTestCase):
class TestExtension(django.test.TestCase):
"""
Ensure that the scheme extension is correctly plugged in (via entry point
in setup.py)
in pyproject.toml)
"""
def test_get_scheme(self):

View File

@@ -29,10 +29,10 @@ Decision
We proposed to add the course live as a plugin with the following structure
Course Live App Plugin Class
-----------------------
----------------------------
The app will be loaded as a plugin and added to `setup.py` with the namespace
"openedx.course_app".
The app will be loaded as a plugin and added to ``pyproject.toml`` with the namespace
``openedx.course_app``.
.. code-block :: python

View File

@@ -19,8 +19,8 @@ class DiscussionsTopicLinkTransformer(BlockStructureTransformer):
@classmethod
def name(cls):
"""
Unique identifier for the transformer's class;
same identifier used in setup.py.
Unique identifier for the transformer's class.
This must match the entry point name in the package configuration.
"""
return "discussions_link"

View File

@@ -141,7 +141,7 @@ class TestRandomUserPartitionScheme(PartitionTestCase):
class TestExtension(TestCase):
"""
Ensure that the scheme extension is correctly plugged in (via entry point
in setup.py)
in pyproject.toml)
"""
def test_get_scheme(self):

View File

@@ -94,7 +94,7 @@ class EnrollmentTrackPartitionSchemeTest(SharedModuleStoreTestCase):
def test_get_scheme(self):
"""
Ensure that the scheme extension is correctly plugged in (via entry point in setup.py)
Ensure that the scheme extension is correctly plugged in (via entry point in pyproject.toml)
"""
assert UserPartition.get_scheme('enrollment_track') == EnrollmentTrackPartitionScheme

View File

@@ -123,7 +123,7 @@ class XBlockPipelineFinder(BaseFinder): # lint-amnesty, pylint: disable=abstrac
# xblock_resource_info holds (package_name, resources_dir) tuples. While
# it never happens in practice, the XBlock API does allow different
# XBlocks installed with the same setup.py to refer to their shared
# XBlocks installed from the same package to refer to their shared
# static assets using different prefixes.
xblock_resource_info = {
(xblock_resource_pkg(xblock_class), xblock_class.get_resources_dir())

View File

@@ -25,8 +25,8 @@ class ContentTypeGateTransformer(BlockStructureTransformer):
@classmethod
def name(cls):
"""
Unique identifier for the transformer's class;
same identifier used in setup.py.
Unique identifier for the transformer's class.
This must match the entry point name in the package configuration.
"""
return "content_type_gate"

View File

@@ -53,7 +53,10 @@ class EffortEstimationTransformer(BlockStructureTransformer):
@classmethod
def name(cls):
"""Unique identifier for the transformer's class; same identifier used in setup.py."""
"""
Unique identifier for the transformer's class.
This must match the entry point name in the package configuration.
"""
return 'effort_estimation'
@classmethod

View File

@@ -29,9 +29,9 @@ class InvalidTestName(Exception):
'''
This means you have an entry point for a test that does not correspond
to a properly named test class. For example, if you cut-and-paste entry
points in `setup.py`, and forgot to repoint the class (so it points to
`DoneXBlock` instead of `TestDone`), or otherwise made an error, you
will see this exception.
points in your package configuration, and forgot to repoint the class
(so it points to `DoneXBlock` instead of `TestDone`), or otherwise made
an error, you will see this exception.
'''
pass # lint-amnesty, pylint: disable=unnecessary-pass

View File

@@ -57,19 +57,21 @@
#
# * DIST-NAME is the distribution name, the same name you'd use in a
# "pip install" command. It might be different than REPO-NAME. It must
# be the same as the `name="DIST-NAME"` value in the repo's setup.py.
# be the same as the package name defined in the repo's pyproject.toml
# (or setup.py for older packages).
#
# * VERSION might not be the same as TAG-OR-SHA, but if the tag names the
# version, please make it match the VERSION, but with a "v" prefix.
# VERSION must be the same as the `version="VERSION"` value in the repo's
# setup.py. An alternative is to use 0.0 as VERSION: this forces pip to
# re-install the package each time, and can be useful when working with two
# repos before picking a version number. Don't use 0.0 on master, only for
# tight-loop work in progress.
# VERSION must be the same as the version defined in the repo's pyproject.toml
# (or setup.py for older packages). An alternative is to use 0.0 as VERSION:
# this forces pip to re-install the package each time, and can be useful when
# working with two repos before picking a version number. Don't use 0.0 on
# master, only for tight-loop work in progress.
#
# * Don't prefix the URL with "-e". That would install the package in "editable"
# mode A.K.A "development" mode, which takes longer and does not
# fully respect setup.py, making the transition back to PyPI more complex.
# mode A.K.A "development" mode, which takes longer and does not fully respect
# the package's build configuration, making the transition back to PyPI more
# complex.
#
# * Organize the URL into one of the two categories below:

View File

@@ -2,7 +2,7 @@
envlist = py{311} quality
# This is needed to prevent the lms, cms, and openedx packages inside the "Open
# edX" package (defined in setup.py) from getting installed into site-packages
# edX" package (defined in pyproject.toml) from getting installed into site-packages
# where they can get imported, which is bad because those won't even contain
# most of the source code since we don't explicitly add anything to the source
# distribution.

View File

@@ -17,7 +17,7 @@ from stevedore.extension import ExtensionManager
# * 1 -> 49: Unused/Reserved
# * 50: The enrollment track partition
# * 51: The content type gating partition (defined elsewhere)
# * 52-99: Available for other single user partitions, plugged in via setup.py.
# * 52-99: Available for other single user partitions, plugged in via entry points.
# Operators, beware of conflicting IDs between plugins!
# * 100 -> 2^31-1: General namespace for generating IDs at runtime.
# This includes, at least: content partitions, the cohort partition, and teamset partitions.