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:
@@ -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
|
||||
|
||||
@@ -19,5 +19,5 @@ Mako: http://www.makotemplates.org/
|
||||
How to install?
|
||||
================================================================================
|
||||
|
||||
$ sudo python setup.py install
|
||||
$ pip install .
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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``
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.'
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
2
tox.ini
2
tox.ini
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user